这是在PC上完成的。我不知道如何在Mac上完成此操作。
我不建议使用此方法来删除"air.",因为这样会导致用户无法在设备上下载Air。相反,用户将收到一个错误消息,而没有任何关于问题的线索。当然,您可以使用Air Captive Runtime来解决此问题。
http://bradwallacedesign.com/share/renameAPK.zip
下载并解压我的文件(renameAPK.zip)到C:\ renameAPK中。
所需文件:
- 我的文件(renameAPK.zip),其中包含apkTool
- Java JDK / JRE
- Android SDK
- Notepad++(或能够重命名多个文件的等效文本编辑器)
由于我不确定如何将它们合并成一个文件,所以我制作了许多bat文件。您需要编辑每个文件以更改路径名和文件名,以使其与您的计算机和apk文件配合使用。
我对所有的bat进行了编号,以我使用它们的顺序为准。一旦打开了命令行,我就键入我想要的bat文件的编号,然后按Tab键自动完成bat文件的名称,最后按Enter运行该bat文件。
说明:
双击 `openCmd.bat 打开一个指向所有文件的目录的命令行。
0. 运行 0path.bat 设置路径。(我现在记不起来Adobe Air SDK是否需要了,但我已将它添加到我的路径中。显然,需要JDK和Android SDK来使用jarsigner和zipalign。)
1. 运行 1decompileAPK.bat 将apkTool反编译您的应用程序到名为UNZIPPEDapk的文件夹中。
2. 按照 2editManifest&PackageName - Instructions(not a bat).txt 中的说明使用Notepad ++在UNZIPPEDapk中编辑清单和包名称:
编辑AndroidManifest.xml:
a. 将包名称从air.oldPackageName更改为newPackageName
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)
d. ctrl+shift+f --- "Find in files"
find:
air/oldPackageName
replace with:
newPackageName
where:
all files in UNZIPPEDapk/smali
(i think there were over 200 replacements)
3. run 3buildDistFolder.bat to have apkTool build the new apk in the UNZIPPEDapk\Dist folder
4. follow the instructions in 4getMissingFiles - instructions.txt to reinstate the 2 missing files in the new build:
a. Two files were not built during 3buildDistFolder:
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\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')
grab these 2 files from your original apk and drop them into your new apk in the correct folder
b. copy yourApp.apk from DKTimer/Dist/ to root directory where your bat files are.
5. run 5signAPK.bat to sign the apk.
developer.android.com/guide/publishing/app-signing.html
6. run 6verifySigned.bat to verify the signing worked properly
7. run 7zipAlign.bat to align the apk file.
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. run 8installAPK.bat to install the apk on a usb connected device.
9. run 9remoteDebugger.bat if you want to use remote debugging.
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...)