JesusFreke / smali

smali/baksmali
6.29k stars 1.07k forks source link

BakSmali decompile Bug #835

Closed demonwu123 closed 2 years ago

demonwu123 commented 2 years ago

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
...
JesusFreke commented 2 years ago

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.