×

odex优化 dex work

odex优化(如何在Ubuntu下进行framework和普通文件的odex优化)

admin admin 发表于2024-03-26 17:18:20 浏览21 评论0

抢沙发发表评论

本篇文章给大家谈谈odex优化,以及如何在Ubuntu下进行framework和普通文件的odex优化对应的知识点,文章可能有点长,但是希望大家可以阅读完,增长自己的知识,最重要的是希望对各位有所帮助,可以解决了您的问题,不要忘了收藏本站喔。

本文目录

如何在Ubuntu下进行framework和普通文件的odex优化

如何在Ubuntu下进行framework和普通文件的odex优化最近玩几个android手机,修改了部分framework下的jar和apk,当然jar和apk都是从odex合并来的,然后没有odex化,导致制作的刷机包输入系统之后,第一次开机系统启动非常的慢,因为后台在davik的process进程中间进行odex化,于是,我就像能否先把这些jar和apk给odex了。以前都是单独做apk的odex,使用的在手机端运行dexopt-wrapper工具完成的,现在这么多的jar和apk,我不想在手机端通过批处理进行odex化,我觉得既然android源码可以完成user版本release,那么,我们抽出源码编译user版本的工具,一定可以完成的。经过艰难的寻找,终于在build/core/dex_preopt.mk文件中找到了工具:dex-preopt。这个工具在./dalvik/tools/dex-preopt下面这个工具用法如下:## Usage: dex-preopt path/to/input.jar path/to/output.odex## This tool runs a host build of dalvikvm in order to preoptimize dex# files that will be run on a device.# The input may be any sort of jar file (including .apk files), as long# as it contains a classes.dex file. Note that optimized versions of# bootstrap classes must be created before this can be run on other files;# use the "--bootstrap" option to do this.## The "output.odex" file must not already exist.# ## This is expected to be running in a user build environment, where# "dexopt" is available on the host.## Options:# --build-dir=path/to/out -- Specify where the base of the build tree is.# This is typically a directory named "out". If not specified, it is# assumed to be the current directory. The specified input and output# paths are taken to be relative to this directory.# --dexopt=path/to/dexopt -- Specify the path to the dexopt executable.# If unspecified, there must be a unique subdirectory of the build-dir# that looks like host/ARCH/bin which must contain dexopt.# --product-dir=path/to/product -- Specify the path, relative to the build# directory, where the product tree to be used is. This directory should# contain the boot classpath jar files. If not specified, then there# must be a unique directory in the build named "target/product/NAME",# and this is the directory that will be used.# --boot-dir=path/to/bootclasspath -- Specify the path, relative to the# product directory, of the directory where the boot classpath files# reside. If not specified, this defaults to "system/framework"# --boot-jars=list:of:jar:base:names -- Specify the list of base names# of bootstrap classpath elements, colon-separated. Order is significant# and must match the BOOTCLASSPATH that is eventually specified at# runtime on the device. This defaults to "core". However, this really# needs to match the target product’s BOOTCLASSPATH, which, as of this# writing, doesn’t have a super-strict way of being defined within the# build. You can find variations of it in different init.rc files under# system/core/rootdir or under product-specific directories.# --bootstrap -- Process the bootstrap classes. If this is specified,# then, instead of processing a specified input file, no other arguments# are taken, and what is processed is the entirety of the boot jar# list, in order.# --verify={none,remote,all} -- Specify what level of verification to# do. Defaults to "all".# --optimize={none,verified,all} -- Specify which classes to optimize.# Defaults to "verified".# --no-register-maps -- Indicate that the output should not contain# register maps. By default, register maps are created and included.# --uniprocessor -- Indicate that the output should target a uniprocessor.# By default, optimizations will be made that specifically target# SMP processors (which will merely be superfluous on uniprocessors).#按照思路进行framework odex化。首先建立一个odex目录,放置所有文件接着,确定--build-dir目录内容,我们建立framework-original目录--build-dir=framework-original建立dexopt-tool,目录,用来放置dexopt工具,这个工具在./out/host/linux-x86/bin/dexopt,同时把linux-x86下面所有的库给copy到/usr/lib下面。--dexopt=dexopt-tool建立bootclasspath, bootclasspath包含所有的boot jar文件,这个变量定义在init.rc中间,解包boot.img可以得到,如果手头有真机,可以通过adb echo方式获得。***隐藏网址***建立建立product目录, product包含所有的boot jar文件--product-dir=./product--boot-dir=./boot***隐藏网址***执行命令为:***隐藏网址***接着尝试处理app下apk上面的命令,去掉 --bootstrap项,修改--build-dir=***隐藏网址***建立一个脚本文件#!/bin/sh***隐藏网址***然后使用这个命令一个一个处理app下面文件这样就OK,当然,也可以建立一个脚本文件批量处理。

华为手机怎么关闭odex优化功能

打开腾讯手机管家,体检加速健康优化,手机加速,进程管理,自启管理,进行加速及禁止健康优化,垃圾清理,垃圾扫描全新体验:全新视觉界面,创新操作体验.手机管理:一键优化,轻松管理你的手机手机体验、手机加速,享受一站式手机服务;短信、通讯录、应用等快速添加、删除。海量资源:重新整合海量资源,独立呈现下载中心

如何在Ubuntu下进行framework和普通文件的odex优化的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于如何在Ubuntu下进行framework和普通文件的odex优化、如何在Ubuntu下进行framework和普通文件的odex优化的信息别忘了在本站进行查找哦。