sky201503 / android-apktool2

Automatically exported from code.google.com/p/android-apktool
0 stars 0 forks source link

Make possible to set smali breakpoints easily #177

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
"As most major IDEs don't allow to set BPs in Whitespace or comments (also 
IntelliJ IDEA which I use does not allow), I have a suggestion for this that 
works with IDEA and probably with all IDEs but in IDEA I've tested. Don't make 
the smali code a block comment, but make it line-comments preceded by a single 
semicolon. The single semicolon is seen by the IDE and compiler as empty 
instruction (NOP) and you can set a BP there, at least in IntelliJ IDEA this 
works even if not inside a method, like it is currently in the files "apktool d 
-d" produces currently. The "apktool b -d" then has to simply remove the ";//" 
parts in the beginning of the line like how it probably currently removes the 
class declaration and block comment before smaliing the code again."

Thanks Björn Kautler for the idea!

Original issue reported on code.google.com by Brut.alll on 12 Jun 2011 at 1:33

GoogleCodeExporter commented 9 years ago
Also in the Netbeans you could add a breakpoint in the commented out line using 
New Breakpoint dialog. Just place a cursor in proper line, hit ctrl+shift+F8 
and set breakpoint type to Line.

Original comment by Brut.alll on 12 Jun 2011 at 1:41

GoogleCodeExporter commented 9 years ago
Eclipse is too smart for NOPs. But something like "i=0;//" should work.

Original comment by Brut.alll on 12 Jun 2011 at 2:12

GoogleCodeExporter commented 9 years ago
You could also make it configurable by commandline parameter or whatever, with 
a sane default that works for most IDEs. Just in case someone is using an IDE 
that the default doesn't work with.

Original comment by vampi...@gmail.com on 12 Jun 2011 at 3:28

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Brut fixed for 2.0 w/ adjusting prefix support.

 -d,--debug                        Decode in debug mode. Check project page for more info.
    --debug-line-prefix <prefix>   Smali line prefix when decoding in debug mode. Default is "a=0;// ".

Original comment by connor.tumbleson on 4 May 2013 at 8:24