1

I'm looking to rename an apk package name with existing tools like aapt or apktool.

Found this question that is related : Rename package name using aapt

I tried to adapt the command aapt p -f --rename-manifest-package com.mynewpackagename -M AndroidManifest.xml -F myapp.apk -I android.jar -S res

But it gives an error.

Narendra_Nath
  • 4,578
  • 3
  • 13
  • 31

2 Answers2

1

You can decompile the apk using apktool: apktool d apk_path.apk and change this property in apk_path/apktool.yml

renameManifestPackage: new.package.name
Leo Lamas
  • 178
  • 9
  • it doesn't seem to be enough. I cannot install modified app on top of existing one with different name – Future Jan 13 '22 at 10:25
  • what error do you get when trying to install the apk? – Leo Lamas Jan 14 '22 at 17:17
  • was not installing. Anyway i realized i needed to update pkg name references in the smali files, as well as in the smali folder structure and worked without relying on modifying apktool.yml – Future Jan 16 '22 at 18:19
  • usually it's enough to make changes to apktool.yml and maybe AndroidManifest.xml, but yeah, good you fixed it! – Leo Lamas Jan 18 '22 at 20:00
0

If you are looking for a safe and fast rename package name solution. I recommend using "Android Package Renamer" plugin in Android Studio Or Intellij IDEA.

What you need to do is download it:

  • Open Your Project.
  • Click -> File -> Rename Package
  • Input the Package you want to change.
  • Click OK.
  • Sync Project with Gradle Files or Invalidate Caches

You can see the detailed answer here or go to the github of this repo

Phuc VR
  • 111
  • 1
  • 3