Hi first Forgive me for my weak english . i have a class named Class A in my android application with the content below :
public class A {
public static final SomeClass1 variable_C = new SomeClass1();
public static final SomeClass1 variable_A = new SomeClass1();
public static final SomeClass1 variable_D = new SomeClass1();
public static final SomeClass1 variable_B = new SomeClass1();
}
when i compile my project and then give my project apk to apktool to decompile it , apktool decompiles Class A Like below :
public class A {
public static final SomeClass1 variable_A = new SomeClass1();
public static final SomeClass1 variable_B = new SomeClass1();
public static final SomeClass1 variable_C = new SomeClass1();
public static final SomeClass1 variable_D = new SomeClass1();
}
apktool when decompile my project apk changes global variables ordering to alphabetical order . How can i force apktool does not sort global variables in alphabetical order and keep main global variables ordering when decompile my apk ?
thanks for your answers .
This is not apktool's fault. Unlike the Java classfile format, the Android dex format requires that fields appear in sorted order, which means that the source level ordering is lost as soon as you compile your code.
From https://source.android.com/devices/tech/dalvik/dex-format#class-data-item