-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Description
When decompiling an APK or DEX, line numbers corresponding to the LineNumberTable in the Java Class file structure are correctly displayed next to the decompiled source code, however, there is not a way to dump the contents of the source file while retaining those line numbers.
Example:
package com.example.foo;
public class MainActivity extends Activity {
14 protected void onCreate(Bundle bundle) {
15 super.onCreate(bundle);
16 foo();
}
22 public void foo() {
23 // foo impl
}
}
Since there was additional whitespace somewhere in the original source files, jagx detects that correct line numbers (corresponding to the LineNumberTable in the Java Class file structure), but when the file is saved, these numbers will not align with the output.
Example of desired output:
package com.example.foo;
public class MainActivity extends Activity {
// empty lines inserted here ...
protected void onCreate(Bundle bundle) {
super.onCreate(bundle);
foo();
}
// and here, so that line numbers match
public void foo() {
// foo impl
}
}
Why is this useful?
If we were able to align the decompiled source code with the correct line numbers, the jagx output would be suitable for attaching a debugger to the target APK.