Changing the package name

后端 未结 2 720
闹比i
闹比i 2021-02-06 12:14

I planned to change the package name through smali(reverse)

when I open up apktool.yml, I saw this

forced-package-id: \'127\'

相关标签:
2条回答
  • 2021-02-06 13:01

    Assuming your goal is to rename the package name of the apk, the package names used for the classes are irrelevant. The package name of the apk is mostly unrelated to the package names of any classes in the apk. And there's no reason you need to touch the package id.

    I would recommend unpacking the apk with apktool, and then edit the apktool.yml, setting renameManifestPackage to the new package name. Then when you rebuild the apk with apktool, it should use aapt's --rename-manifest-package functionality to change the package name.

    After that, just resign the new apk and you should be good to go.

    apktool d app.apk
    // change "renameManifestPackage: null" in app/apktool.yml
    // to "renameManifestPackage: my.new.package"
    apktool b app -o new_app.apk
    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/my.keystore new_app.apk mykeyname
    

    And just to reiterate, you don't need to modify the package names of any classes.

    0 讨论(0)
  • 2021-02-06 13:15

    To my knowledge there are no fast ways to change the package name. You have to change the package="com.mycompany.myapp" in Manifest.xml and then manually replace all the package name occurrences in smali files (and folders). Finally edit apktool.yml replacing the old package name, with your new package name.

    A full detailed tutorial can be found here: http://forum.xda-developers.com/showthread.php?t=2760965

    0 讨论(0)
提交回复
热议问题