Skip to content

Instantly share code, notes, and snippets.

@awcator
Created January 2, 2023 08:07
Show Gist options
  • Select an option

  • Save awcator/87f3b60b4df0eb564348f39c96e67dce to your computer and use it in GitHub Desktop.

Select an option

Save awcator/87f3b60b4df0eb564348f39c96e67dce to your computer and use it in GitHub Desktop.
apk d original.apk
apk b /path/to/extracteAPK_contents -o mod.apk
keytool -genkey -keystore awcator1.keystore -validity 10000 -alias awcator1 -keyalg rsa
jarsigner -keystore awcator1.keystore -verbose mod.apk awcator1
@awcator
Copy link
Copy Markdown
Author

awcator commented Dec 31, 2024

1) Install the original APK file

adb install original.apk

2) Decode the original APK file, decompiling into Smali

apktool decode --output original original.apk

3) Apply the logic patch

patch -p1 < switch.patch

4) Rebuild an APK file with the patch

apktool build --output rebuilt.apk original

5) Create an aligned APK file

zipalign 4 rebuilt.apk rebuilt-aligned.apk

6) Sign the rebuilt APK file

apksigner sign --ks keystore --ks-pass pass:password rebuilt-aligned.apk

7) Attempt installation of the rebuilt APK file

adb install -r rebuilt-aligned.apk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment