CepaceousLongspun
CepaceousLongspun

Reputation: 11

How to rename an apk package name with aapt / apktool?

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.

Upvotes: 1

Views: 8065

Answers (2)

Phuc VR
Phuc VR

Reputation: 171

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

Upvotes: 1

Leo Lamas
Leo Lamas

Reputation: 198

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

Upvotes: 2

Related Questions