This was done on a PC. I do not know how to do this on a Mac.
I do not recommend using this to remove βairβ. from the name of the air bag. If you do this, the user will not be prompted to load air onto his device. the user will receive an error message without indicating a problem. Of course, you can use the runtime in the air to solve this problem.
http://bradwallacedesign.com/share/renameAPK.zip
download and unzip my file (renameAPK.zip) to c: \ renameAPK.
required files:
- my file (renameAPK.zip) which contains apkTool
- java jdk / jre
- Android SDK
- notepad ++ (or an equivalent text editor that can rename multiple files)
I have made many bat files since I am not sure how to merge them into a single file. you will need to edit each to change the path names and file names to work with your computer and your apk file.
i numbered all the bits in the order in which I use them. after opening the command line, I type the number of the bat file that I want, then press the tab key to automatically end the name of the bat file, and then press Enter to launch this bat file.
instructions:
double-click `openCmd.bat to open a command line pointing to the directory with all your files.
0. run 0path.bat to specify the path. (I can't remember now if I need adobe air sdk for this, but I have it in my way. Obviously, JDK is needed, and Android sdk for jarsigner and zip align I think.)
1. run 1decompileAPK.bat so that apkTool decompiles your application into a folder called UNZIPPEDapk
2. Follow the instructions in 2editManifest and PackageName - Instructions (not bat) .txt to edit the manifest and package name using Notepad ++ inside UNZIPPEDapk:
edit AndroidManifest.xml:
a. change package name from air.oldPackageName to newPackageName
b. edit other necessary entries:
c. rename the folder system inside the "smali" folder to work with your new package name, for example: if the old package name is: air / oldName, then change the folders according to the new package name: air / newName
use notepad ++ (or any editor that can find and replace text across 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 more than 200 replacements)
3. run 3buildDistFolder.bat so that apkTool collects a new apk in the UNZIPPEDapk \ Dist folder
4. Follow the instructions in 4getMissingFiles - instructions.txt to recover 2 missing files in the new assembly:
a. Two files were not created during 3buildDistFolder:
3buildDistFolder.bat built a new apk in the \ UNZIPPEDapk \ dist folder, but could not copy 2 files:
(skipping hidden file 'C:\Users\computer\apkTool\UNZIPPEDapk\assets\META-INF
\ AIR \ extensions \ com.adobe.mobile \ META-INF \ ANX \ Android-ARM.classpath ') (skipping the hidden file "C: \ Users \ computer \ apkTool \ UNZIPPEDapk \ assets \ META-INF \ AIR \ extensions \ com.adobe.mobile \ META-INF \ ANX \ Android-ARM.project ')
grab these 2 files from your original apk and put them in a new apk in the correct folder
b. copy yourApp.apk file from DKTimer / Dist / to the root directory where your bat files are located.
5. run 5signAPK.bat to sign apk.
developer.android.com/guide/publishing/app-signing.html
6. run 6verifySigned.bat to verify that the signature works
7. run 7zipAlign.bat to align the apk file.
developer.android.com/guide/developing/tools/zipalign.html
You are done at this point. Continue if you want to test it on the device.
8. run 8installAPK.bat to install apk on the device connected to USB.
9. run 9remoteDebugger.bat if you want to use remote debugging.
Hope this helps someone. let me know if I forgot to turn something on. also, if you know the best way to do this, comment (for example, how to combine this into one long file with a pause) ...