In an Android system, all the code for an app is inside a dex file. Dex is a jar-like archive that stores many Java-compiled bytecode. Because the Android system uses the Dalvik virtual machine, you need to convert the class file that was compiled with Java compiler into a class file that Dalvik can execute. The point
Summary of restrictions on the Android Dex method, androiddex
Address: http://greenrobot.me/devpost/about-android-dex-method-number-limit/
Android compilation process
Before learning about this issue, let's take a look at the Android
Android DEX basics and androiddex Basics1. What is dex?
To put it simply, optimize android .exe. Each apk installation package is available.Compared with the Java Virtual Machine on the PC, it can run. class; The Davlik Virtual Machine on android can run. dex.Why study
1. What is DEX?Simply put, the optimized Android version of. exe. Each APK installation package is available.Run with respect to the Java virtual function on the PC. The Davlik virtual function on the class;android runs. Dex.Why Study dex format? Because Dex contains all the
The reasons for the need for Dex must be known to all. It was in the previous Android system that the Dex file was stored with a short type of data for the method index. The maximum value for short is 65535, so when the project is large enough to contain more than 65535 of the methods (including all the methods in the referenced external Lib), when you run the ap
tool. This is what we can see in our Android project's packaged APK: the introduction of the contents of the other jars is packaged into the classes.dex.So this road is not through, please pay attention.1.2 What APIs are currently available for dynamic loading1.2.1 DexclassloaderThis can be loaded Jar/apk/dex, can also be loaded from the SD card, is also the focus of this article.1.2.3 PathclassloaderYou c
{
uint size;
map_item list [size];
}
struct map_item
{
ushort type;
ushort unuse;
uint size;
uint offset;
}
Map_list first with a uint description is followed by a size map_item, followed by a corresponding size Map_item description. The MAP_ITEM structure has 4 elements: type denotes the map_item, Dalvik the definition of type Code in executable Format; Size indicates the number of the type to subdivide this item, and offset is the offset of the first
Use the android packaging tool (aapt) to combine Dex files, resource files, and androidmanifest. xml files (in binary format) into an application package (APK ).
When optimizing the android Dex file, you must note that the DEX file structure is compact, but we still need
When optimizing the Android DEX file, you must note that the DEX file structure is compact, but we still need to find ways to improve the running speed of the program, we still need to further optimize the DEX file.
Adjust the byte order of all fields LITTLE_ENDIAN) and none of the fields in the alignment structure ver
. In particular, Mmin18 proposed the Githut address as follows:https://github.com/mmin18/Dex65536The principle of this solution is almost like this:1. Create the Custom_rules.xml file in the project directory and modify the compilation policy. Package The third-party plug-in jar packages contained in the files of the project Lib into libs.apk, and then use them as the second Dex file to compile the runtime.2. Finally, perform the operation through the
will set the Checkjni to False2. Persist the configuration to the simulator(1) First re-mount the system partition to make the system partition writable. If you do not do this, you will find that you cannot modify the Build.prop file.ADB remount(2) Next, enter the command line of the simulator:ADB shell(3) write the configuration to Build.prop:Echo " Dalvik.vm.dexopt-flags=v=n,o=v " >>/system/build.propecho" Dalvik.vm.checkjni=false" >> /system/build.propIn this way, the configuration is change
Well, I've thought about not moving Android in the future, but I didn't think it was the reason for the game. Many of the problems with Android are due to the imperfections of eclipse, such as the problem encountered today unable to execute Dex:multiple Dex files define[ .-Ten- at -: at: in - Dex Loader] unableTo exec
Java Files-----application source FilesAndroid itself is partly written in Java (basically the blue part of the architecture diagram is developed in Java), and Android'sApplications must use Java to developclass file------Java-compiled target fileUnlike J2se,java, which can be run directly from a class, the class file on the Android platform cannot be run directly on Android. Because GoogleUse your own Dalv
Javafile-----application source FilesAndroid itself is partly written in Java (basically the blue part of the architecture diagram is developed in Java), and Android'sApplications must use Java to developclass file------Java-compiled target fileUnlike J2se,java, which can be run directly from a class, the class file on the Android platform cannot be run directly on Android. Because GoogleUse your own Dalvik
filesystem, but to load the android executable with Dexclassloader Dex You must first store it on the file system, which is the biggest difficulty in adding shells to the Dex file. In order to solve this problem, I think of two ways, the first method is to reduce the time exposure in the file system,Dexclassloaderafter the source program is loaded, it is remov
re-mount the system partition to make the system partition writable. If you do not execute this operation, you cannot modify the build. prop file. Adb remount (2) Next, enter the command line of the simulator: adb shell (3) write the configuration to build. prop: echo "dalvik. vm. dexopt-flags = v = n, o = v ">/system/build. propecho "dalvik. vm. checkjni = false ">/system/build. in this way, the prop is changed to the simulator. After verification, it is found that
The Dex file is a Java binary file running on delvik on Android. If you are interested in the content and the developer has not published the source code, you can decompile the DEX file using the following method:
1. Decompress system. img
Use xyaffs2 to decompress system. IMG and the imgfile you want to decompress:
Xyaffs2 img_file output_dir
Xyaffs2 can be down
This article is only for pure Java Project execution interpretation, generally in the PC platform as a jar package exists, on the Android platform in the form of Dex package.Java is a high-level programming language, and Java programs need to run in a specific virtual machine, and the virtual machine translates Java bytecode into corresponding machine instructions for execution. Different platforms have dif
How to configure the android simulator dex file not optimized to odex
APK is a compressed program package with an execution program in it. ODEX optimization is to extract the execution program in the package and convert it into an ODEX file, because you have extracted it, when the system starts for the first time, it does not need to decompress the program compressed package, and a decompression process is
Android security-code security 3-dex file checksumTo recompile the APK is actually to recompile the Classes.dex file, after recompiling, the generated Classes.dex file hash value changed, so we can detect the installation after the Classes.dex file hash value to determine whether the APK has been re-packaged.(1) Read the Classes.dex file in/data/app/xxx.apk in the application installation directory and comp
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.