重命名包名内的APK [英] Renaming the Package Name inside an APK

查看:156
本文介绍了重命名包名内的APK的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个 AIR应用程序这是目前市场上。要更新应用程序,很明显,我必须保持相同的包名。我的第一个版本的采用打包的的Eclipse 与ADT插件。

I have created an AIR app that is currently on the market. To update the app, obviously I must keep the same package name. My first version's were packaged using Eclipse with the ADT plugin.

现在使用的 AIR 3.0的原生扩展(ANE),它是不可用当我第一次开发的应用程序,我目前必须使用AIR的命令行工具创建我的APK。不幸的是,这些命令行工具,迫使你必须以单词空气开头的包名。例如,我还需要包名称为com.example。 AIR将创建包的名称为air.com.example。

Now to use AIR 3.0 Native Extensions (ANE) which were not available when I first developed the app, I currently must create my APK using AIR's command line tools. Unfortunately, these command line tools force you to have a package name that starts with the word "air". For example, I need the package name "com.example". AIR creates the package name as "air.com.example".

所以,现在,我不能因为包名称已更改,更新我在市场上的应用程序。 Adobe公司这个可怕的文章来帮助你重命名和删除空气在包中。我不是一个伟大的程序员,所以这真的难倒我。 http://kb2.adobe.com/cps/875/cpsid_87562.html

So now, I cannot update my app in the market since the package name has changed. Adobe has this horrific article to help you rename and remove the "air" in the package. I'm not a great programmer so this has really stumped me. http://kb2.adobe.com/cps/875/cpsid_87562.html

显然,这信息是过时或不正确在几个领域。 在它采用12步我已经完全偶然的 apkbuilder

Apparently this info is out of date or incorrect in a few areas. I have completely stumbled at step 12 which uses apkbuilder:

 apkbuilder final.apk -u -z resources.arsc -f classes.dex

我收到此错误信息:

I am getting this error message:

这个工具是DE preCATED。请参见--help以获取更多信息。 java.io.FileNotFoundException: resources.arsc 不存在

THIS TOOL IS DEPRECATED. See --help for more information. java.io.FileNotFoundException: resources.arsc does not exist

我已经用第10步创建新的 resources.arsc 文件。它清楚地确实存在,并在正确的位置。我尝试使用apkbuilder与其他项目采取的其他resources.arsc文件。我仍然得到同样的错误信息。

I have used step 10 to create the new resources.arsc file. It clearly DOES exist and in the correct location. I tried using apkbuilder with other resources.arsc files taken from other projects. I still get the same error message.

有没有在这方面的工作地狱的机会吗?如果有人有兴趣在此,我有一个样品AIR的apk一个压缩文件,所以他们并不需要下载窗口bat文件的所有命令行工作,所有必要的工具。要开始,你只需要改变我的path.bat,以适应您的系统。而你需要的Notepad ++(或同等学历),以一批自动化跨越多个文件重命名包名。 bradwallacedesign.com/dktimer/renameApkProject.zip

Is there a chance in hell of this working? If anyone is interested in this, I have a zip file with a sample AIR apk, windows bat files for all the command line work, and all the needed utilities so they don't need to be downloaded. To get started you just need to change my path.bat to fit your system. And you need notepad++ (or an equivalent) to batch automate renaming the package name across several files. bradwallacedesign.com/dktimer/renameApkProject.zip

太感谢了!

推荐答案

这样做是在PC上。我不知道如何做到这一点在Mac上。

this was done on a pc. i have no idea how to do this on a mac.

我不推荐使用这种删除的空气。从空气包名称。如果这样做,用户将不会被提示下载空气的设备。用户将收到一条错误信息,没有头绪的问题。当然你也可以使用空气俘虏运行时来解决这个问题。

i don't recommend using this to remove the "air." from an air package name. If you do so, the user will not be prompted to download air on their device. the user will get an error message instead with no clue to the problem. of course you can use air captive runtime to solve this issue.

<一个href="http://bradwallacedesign.com/share/renameAPK.zip">http://bradwallacedesign.com/share/renameAPK.zip

下载并解压我的文件(renameAPK.zip)到c:\ renameAPK

download and unzip my file (renameAPK.zip) to c:\renameAPK.

  1. 在我的文件(renameAPK.zip),其中包含apkTool
  2. 的Java JDK / JRE
  3. Android SDK中
  4. 在记事本+ +(或等效的文本编辑器,可以在多个文件重命名)

我做了很多bat文件,因为我不知道如何将它们合并成一个文件。你将需要编辑每一个改变你的路径名和文件名与您的计算机和APK文件的工作。

i made many bat files since i'm not sure how to combine them into one file. you will need to edit each one to change your path names and file names to work with your computer and your apk file.

我数点的蝙蝠,我使用的顺序。一旦命令行是开放的,我输入我想bat文件的编号,然后按下TAB键来自动完成bat文件的名称,然后按回车键运行该批处理文件。

i numbered all the bats in the order that i use them. once a command line is open, i type the number of the bat file i want then hit the tab key to automatically finish the name of the bat file then hit enter to run that bat file.

双击`openCmd.bat 打开命令行指向与您的所有文件的目录。

double click `openCmd.bat to open a command line pointing to the directory with all your files.

0 执行 0path.bat 以设置路径。 (我现在不能记得,如果是需要这个的Adobe AIR SDK,但我有它在我的道路,很明显,JDK是必要的,在Android SDK中的的jarsigner和zip对齐,我认为。)

0. run 0path.bat to set your path. (i can't remember now if the adobe air sdk is needed for this but i have it in my path. obviously, the JDK is needed and the android sdk for the jarsigner and zip align i think.)

1 执行 1decompileAPK.bat 有apkTool反编译你的应用程序到一个名为UNZIPPEDapk文件夹

1. run 1decompileAPK.bat to have apkTool decompile your app into a folder called UNZIPPEDapk

2 按照 2editManifest和放大器的说明。 PACKAGENAME - 说明(不是一个BAT).TXT 以编辑使用记事本++里面UNZIPPEDapk清单和包名称:

2. follow the instructions in 2editManifest & PackageName - Instructions (not a bat).txt to edit the manifest and package name using Notepad++ inside UNZIPPEDapk:

编辑AndroidManifest.xml中:

edit AndroidManifest.xml:

从air.oldPackageName变化包名newPackageName

a. change package name from air.oldPackageName to newPackageName

B 修改其他必要的条目:    

℃。重命名文件夹系统内的smali文件夹,以便它与你的新包的名字    例如:       如果旧包名称为:空气/使用oldName然后更改文件夹以匹配新包的名字:空气/了newName

b. edit other needed entries:

c. rename folder system inside "smali" folder so that it works with your new package name for example: if the old package name was: air/oldName then change the folders to match the new package name: air/newName

使用记事本+ + (或任何编辑器,可以查找和替换文本在多个文件)

use notepad++ (or any editor that can find and replace text over many files)

ð。 Ctrl + Shift + F ---在文件中查找

d. ctrl+shift+f --- "Find in files"

  find:
air/oldPackageName
  replace with:
newPackageName
  where:
all files in UNZIPPEDapk/smali

(我认为有超过200替换)

(i think there were over 200 replacements)

3。执行 3buildDistFolder.bat 有apkTool建立在UNZIPPEDapk \ DIST文件夹中的新的APK

3. run 3buildDistFolder.bat to have apkTool build the new apk in the UNZIPPEDapk\Dist folder

4 按照 4getMissingFiles的说明 - instructions.txt ,以恢复在新建的2丢失的文件:

4. follow the instructions in 4getMissingFiles - instructions.txt to reinstate the 2 missing files in the new build:

3buildDistFolder期间没有建立两个文件:

a. Two files were not built during 3buildDistFolder:

3buildDistFolder.bat建于\ UNZIPPEDapk \ DIST文件夹中的新的APK,但它无法复制2个文件:

3buildDistFolder.bat built the new apk in the \UNZIPPEDapk\dist folder but it failed to copy 2 files:

(skipping hidden file 'C:\Users\computer\apkTool\UNZIPPEDapk\assets\META-INF

\ AIR \分机\ com.adobe.mobile \ META-INF \ ANE \ Android的ARM.classpath)     (跳过隐藏的文件C:\用户\计算机\ apkTool \ UNZIPPEDapk \资产\ META-INF \ AIR \分机\ com.adobe.mobile \ META-INF \ ANE \ Android的ARM.project')

\AIR\extensions\com.adobe.mobile\META-INF\ANE\Android-ARM.classpath') (skipping hidden file 'C:\Users\computer\apkTool\UNZIPPEDapk\assets\META-INF \AIR\extensions\com.adobe.mobile\META-INF\ANE\Android-ARM.project')

从原始的APK抓住这两个文件拖放到新的APK在正确的文件夹

grab these 2 files from your original apk and drop them into your new apk in the correct folder

复制yourApp.apk从DKTimer /距离/到根目录下你的蝙蝠文件。

b. copy yourApp.apk from DKTimer/Dist/ to root directory where your bat files are.

5。执行 5signAPK.bat 签署的apk。

5. run 5signAPK.bat to sign the apk.

developer.android.com/guide/publishing/app-signing.html

developer.android.com/guide/publishing/app-signing.html

6。执行 6verifySigned.bat 以验证签署工作正常

6. run 6verifySigned.bat to verify the signing worked properly

7。执行 7zipAlign.bat 对齐apk文件。

7. run 7zipAlign.bat to align the apk file.

developer.android.com/guide/developing/tool​​s/zipalign.html

developer.android.com/guide/developing/tools/zipalign.html

您已完成在这一点上。如果要在设备上测试它继续。

You are finished at this point. Continue on if you want to test it on a device.

8。执行 8installAPK.bat 安装USB连接的设备上的apk。

8. run 8installAPK.bat to install the apk on a usb connected device.

9。执行 9remoteDebugger.bat 如果您想使用远程调试。

9. run 9remoteDebugger.bat if you want to use remote debugging.

我希望这可以帮助别人。让我知道,如果我忘了,包括什么。 同样,如果你知道一个更好的方式来做到这一点,请评论(比如如何这个合并成1个长暂停bat文件...)

i hope this helps someone. let me know if i forgot to include something. also, if you know a better way to do this, please comment (such as how to combine this into 1 long pausing bat file...)

这篇关于重命名包名内的APK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆