File tree Expand file tree Collapse file tree
main/java/jadx/plugins/stringdecoder
test/java/jadx/plugins/stringdecoder Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55public class B64DeobfuscateOptions extends BasePluginOptionsBuilder {
66
77 private boolean enable ;
8+ private boolean enableByteArrayStringPass ;
89 private int minInputLength ;
910 private int minDecodedLength ;
1011 private int maxCommentLength ;
@@ -19,6 +20,10 @@ public void registerOptions() {
1920 .description ("Enable Base64 string detection and decoding" )
2021 .defaultValue (true )
2122 .setter (v -> enable = v );
23+ boolOption (JadxStringDecoderPlugin .PLUGIN_ID + ".enableByteArrayStringPass" )
24+ .description ("Enable byte[] field string detection pass" )
25+ .defaultValue (true )
26+ .setter (v -> enableByteArrayStringPass = v );
2227 intOption (JadxStringDecoderPlugin .PLUGIN_ID + ".minInputLength" )
2328 .description ("Minimum length of an encoded string to be considered for decoding" )
2429 .defaultValue (8 )
@@ -53,6 +58,10 @@ public boolean isEnable() {
5358 return enable ;
5459 }
5560
61+ public boolean isEnableByteArrayStringPass () {
62+ return enableByteArrayStringPass ;
63+ }
64+
5665 public int getMinInputLength () {
5766 return minInputLength ;
5867 }
Original file line number Diff line number Diff line change @@ -26,7 +26,9 @@ public void init(JadxPluginContext context) {
2626 if (options .isEnable ()) {
2727 context .addPass (new B64DeobfuscatePass (options ));
2828 context .addPass (new B64FieldInitPass (options ));
29- context .addPass (new ByteArrayStringPass (options ));
29+ if (options .isEnableByteArrayStringPass ()) {
30+ context .addPass (new ByteArrayStringPass (options ));
31+ }
3032 }
3133 }
3234}
Original file line number Diff line number Diff line change @@ -228,6 +228,15 @@ public void byteArrayStringTest() throws Exception {
228228 assertThat (code ).contains ("bytes: \" Hello, World!\" " );
229229 }
230230
231+ @ Test
232+ public void byteArrayStringPassDisabledTest () throws Exception {
233+ // with enableByteArrayStringPass=false the bytes: comment must not appear
234+ String code = decompileSmali ("bytes/byte_array_string.smali" ,
235+ Map .of (opt ("enableByteArrayStringPass" ), "false" ));
236+ System .out .println (code );
237+ assertThat (code ).doesNotContain ("bytes:" );
238+ }
239+
231240 private String decompileSmali (String fileName ) throws Exception {
232241 return decompileSmali (fileName , Map .of ());
233242 }
You can’t perform that action at this time.
0 commit comments