JesusFreke/smali

BakSmali decompile Bug

Closed this issue · 1 comments

When I build the apk with gradle 3.6.4,and I use baksmail-2.5.2 to decompile the apk, the private variable string became public.
The source code is built with gradle 3.6.4,

**private** static final String[] MESSAGE_LIST =
{"xxx"};

**private** static final String[] MODULES_LIST =
        {"xxx"};

After Baksmali-2.5.2 decompiled the apk, the smali code became,

# static fields
.field **public** static final MESSAGE_LIST:[Ljava/lang/String;
.field **public** static final MODULES_LIST:[Ljava/lang/String;
# direct methods
.method **public** static constructor <clinit>()V
...

baksmali disassembles what's there. It's quite unlikely to be a bug in baksmali, but rather, some quirk of the compilation process. My guess is that there may be an inner class that needs to access the field, and instead of making a synthetic accessor method, the compiler just marks the field as public.