Where is classes dex




















To make an APK file, a program for Android is first compiled, and then all of its parts are packaged into one file. This holds all of that program's code These are the. Programs are commonly written in Java and compiled to bytecode. They are then converted from Java Virtual Machine-compatible.

The compact Dalvik Executable format is designed to be suitable for systems that are constrained in terms of memory and processor speed.

As the. Android programs are compiled into. Code of the given application is written in java and then compiled to class files, then these class files are cross compiled with many optimisations to dalvik VM format. Note that there also might be some. You can not delete this file. You could also use tools ApkOneClick or ApkMultiTool to get Java source from the smali files but these would probably not be perfect and will require further fixing.

When you change the code you want you should build the classes. Note that then existing certificate files META-INF will not be valid anymore and you will need to delete this folder and resign the apk package in order to instal it on the phone or emulator. For more info you could check this question too What are. The role of classes.

It's a file containing bytecodes. In Android case, the bytecode is Dalvik bytecode, which is different from Java bytecode. If you modify classes. If you delete classes.

Its different than jar file. A jar file is a collection of. If we unzip. Dex files support both big endian and little endian encoding. The remaining values in the file header define the size and location of other data structures, which hold identifiers for methods, strings, and other items.

These values are summarized in the table below, where size equals the array length, and the offset is the number of bytes from the start of the file where this information can be found. As an example, we can see that there are five Strings IDs in our Dex file, encoded between bytes Each ID at this position also points to an offset within the data section that encodes the actual value of the String.

With this knowledge, we can use the offsets to resolve the actual information and determine what our Dex file encodes. All this business of IDs, offsets, and multiple headers may seem a bit useless at this point. Why not just encode the string value directly in the header? Some of the reasoning behind this is that these strings are referenced from multiple points within the Dex file. Providing an ID for each one prevents duplication of information and reduces the overall file size, simplifies parsing as an ID will always be a fixed length, and means values are only accessed when required.

Our Dex file defines three Java types. Therefore, we can determine that the types in our file are as follows:. The TypeDescriptor syntax may look somewhat unfamiliar, but the L simply refers to a full class name, and V is the type void. Our types include our custom BugsnagApp class, and the Application class from the Android framework.

A method prototype consists of information on the return type of a method and the number of parameters it takes. The Method section also uses indices. Each method looks up the class ID where it was defined, the method prototype, and the name of the method from the strings table.

This section contains the type, inheritance hierarchy, access metadata, and other class metadata such as annotations and source file indices.

The public access modifier is determined from a bit field. The first four bytes of our BugsnagApp class data define the number of static and instance fields, along with any direct or virtual methods. There is only one direct method defined in this class. If our class defined fields and other information, more data would be encoded in this section. Incidentally, if the method ID was a value larger than 65,, we would have encountered the infamous 64k method limit.

This corresponds to a register size of 1, 0 incoming arguments, outgoing arguments, and an offset of 16 where debug information is stored.

The most important part, however, is the last few bytes. We have an instruction list size of 1, which means that our method has compiled to one opcode: Some Android Apks contain multiple classes.

Is there a way to integrate them into one dex or jar file then decompile so there would be one source code in the end? Dex files have a maximum amount of methods which they can contain, specifically 64k methods. Knowing both of these, all you need to do is dex2jar or whatever you're using to create the jar file from the dex file each dex file individually. Then unzip each file to the same directory, enter the directory and then zip them all up into a single, massive, jar zip file.

Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. Ask Question. Asked 1 year, 5 months ago.



0コメント

  • 1000 / 1000