You have apk oldapk.apk
, you want to rename its package from com.oldcompany.oldname
to com.mycompany.myname
.
- Install:
apktool
- https://ibotpeaches.github.io/Apktool/install/signapk
-sudo apt install signapk
(https://manpages.ubuntu.com/manpages/bionic/man1/signapk.1.html)ruplacer
- https://github.com/dmerejkowsky/ruplacer (sed on all files in directory)- clone this repo: https://github.com/techexpertize/SignApk
-
Unzip apk:
apktool d oldapk.apk
-
Edit
oldapk/apktool.yml
:
- renameManifestPackage: null
+ renameManifestPackage: com.mycompany.myname
- Replace old names to new:
ruplacer "Lcom/oldcompany/oldname" "Lcom/mycompany/myname"
ruplacer "com\.oldcompany\.oldname" "com.mycompany.myname"
-
Rename folders
smali/com/oldcompany/oldname
tosmali/com/mycompany/myname
. You can check folders that has old name by usingfind | grep oldcompany
andfind | grep oldname
. -
(Optional) Change app name:
ruplacer "Old name" "New name"
-
Compress apk:
apktool b oldapk -o newapk.apk
-
Sign apk:
signapk SignApk/certificate.pem SignApk/key.pk8 newapk.apk newapksigned.apk