第一期线下班 apk 反编译命令

反编译apk

java -jar ~/Downloads/apktool_2.3.0.jar  d ../../keep-latest.apk

插入smali指令

vi  keep-latest/smali/com/gotokeep/keep/MainActivity.smali

在onCreate里面加入命令

    const-string v0, "testerhome"
    const-string v1, "hello from seveniruby"
    invoke-static {v0, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

重新打包签名

java -jar ~/Downloads/apktool_2.3.0.jar b keep-latest/
keytool -genkey -v -keystore my-release-key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias my-alias
jarsigner -verbose -keystore my-release-key.jks  -signedjar 1.apk  keep-latest/dist/keep-latest.apk my-alias

安装检查

adb install 1.apk
adb logcat | grep testerhome
关闭