Android Reversing

신석진( Seokjin Shin)·2022년 12월 12일
0

apktool 빌드 안될 때 use-aapt2 이슈 관련 자료
INSTALL_FAILED_INVALID_APK: Failed to extract native libraries, res=-2 에러 해결자료

keytool -genkey -v -keystore ./key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key

apktool d build/app/outputs/flutter-apk/app-x86_64-release.apk -o reverse -f

apktool -f b ./reverse --use-aapt2

zipalign -p -f -v 4 ./reverse/dist/app-x86_64-release.apk ./reverse/dist/tempered.apk

apksigner sign --ks ./key.jks ./reverse/dist/tempered.apk

adb -s emulator-5554 install ./reverse/dist/tempered.apk

변조된 앱을 알리기 위해 토스트 띄우는 smali 코드

# MainActivity.smali
# virtual methods
.method protected onResume()V
    .locals 3

    const-string v0, "Tampered"
    const/4 v1, 0x0
    invoke-static {p0, v0, v1}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
    move-result-object v0
    invoke-virtual {v0}, Landroid/widget/Toast;->show()V

    invoke-super {p0}, Lio/flutter/embedding/android/FlutterActivity;->onResume()V

    invoke-direct {p0}, Lcom/example/evar_charge_app/MainActivity;->a()V

    return-void
.end method

0개의 댓글