Steps:
1. Convert APK to JAR
2. Convert JAR to source code
I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: programmerworld1990@gmail.com
Details:
Source code:
package com.programmerworld.testappforapktosourecodeconversion;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private TextView textView;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
textView = findViewById(R.id.textView);
}
public void buttonSet(View view){
textView.setText("This is programmer world App");
}
public void buttonClear(View view){
textView.setText("Hello Programmer World!!!");
}
}
Screenshots:
C:\Work\dex-tools-2.1>d2j-dex2jar -h
d2j-dex2jar -- convert dex to jar
usage: d2j-dex2jar [options] <file0> [file1 ... fileN]
options:
--skip-exceptions skip-exceptions
-d,--debug-info translate debug info
-e,--exception-file <file> detail exception file, default is $current_dir/[fi
le-name]-error.zip
-f,--force force overwrite
-h,--help Print this help message
-n,--not-handle-exception not handle any exceptions thrown by dex2jar
-nc,--no-code
-o,--output <out-jar-file> output .jar file, default is $current_dir/[file-na
me]-dex2jar.jar
-os,--optmize-synchronized optimize-synchronized
-p,--print-ir print ir to System.out
-r,--reuse-reg reuse register while generate java .class file
-s same with --topological-sort/-ts
-ts,--topological-sort sort block by topological, that will generate more
readable code, default enabled
version: reader-2.1, translator-2.1, ir-2.1
C:\Work\dex-tools-2.1>d2j-dex2jar apk\app-debug.apk
dex2jar apk\app-debug.apk -> .\app-debug-dex2jar.jar
C:\Work\dex-tools-2.1>
Links of Tools: used in this demo:
Dex2Jar:
https://drive.google.com/file/d/1BaFRPTbhDD7BlPnmToq9AJxB0IAWpwmn/view?usp=drive_link
https://github.com/pxb1988/dex2jar/releases
https://sourceforge.net/projects/dex2jar/files/
JD-GUI/ Java decompiler:
https://drive.google.com/file/d/1eZOX6USPyy4Uq6YSXPFZN43OiF5ze75J/view?usp=drive_link
http://java-decompiler.github.io/