[MTCB Android Head Units Q&A] dhmsjs:
Changing the Radio app PTY "Categories" and a quick primer on modding apps

First-time poster here so to start off a big THANKS to all the contributors here! (Really enjoying my KLD2 3188 HU too).

The categories are wrong probably because you are in North America (RBDS) and the radio app assumes European (RDS) categories. It's not too hard to change these. I've recently done this with MTCRadio5(08-06-15).apk (attached below as MTCRadio5US.apk -- for 800x480 screens).

For those who might want to do this themselves, here's a quick primer. This is for Windows.

1) Download and install APK Multi-Tool. This is a very nice set of DOS batch files (yes really) that automate the process of modding apks.

2) Install an ADB wifi app on the HU (I used "WiFi ADB"). This allows you to connect the Windows machine to the HU via wifi instead of a USB cable. Not essential, but very convenient.

3) Run the APK Multi-Tool "setup" batch file to create the directory structure the tool needs. You'll want to open a command line window and then run the batch files from there, so you can see any error messages if the batch file terminates unexpectedly.

4) Copy the "framework-res.apk" from your HU into the "other" subdirectory. This was the only library file I needed in order to modify the radio app, and if possible you really want these library files to come from your HU itself. You can do this manually by copying the file from the HU onto an sd card or USB stick and then copying from that into the "other" subdirectory on your windows machine.

4a) Or if you've got a USB connection, or the ADB wifi set up you can do this with the Multitool's "setup" batch file. I think it was option 9. It connects to your HU and pulls all the library files it needs from there automatically. The tool assumes you're going to use a USB connection, so to use the wifi connection instead, simply start the ADB wifi app on the HU. It will tell you what IP address and port number to use on the windows side. Then on the windows machine open a second command line window and run "adb connect ip-address-and-port" where ip-address-and-port is (of course) what you got from the HU app. You will find the adb.exe program in the Multi Tool's "other" subdirectory.

5) Once you've got the Mult-tool subdirectories set up and library files installed, you can start modding apps. Run the "script" batch file to do this. It presents you with an extensive menu to select from. Option 22 "Clean Files/Folders" is handy to clean up the directories before you start a new project.

6) Use the script (option 27) to create a new project with the apk you want to modify.

7) Use option 0 "apk pull" to get the app from the HU, or sneakernet it across manually. It needs to go into the subdirectory "place-apk-here-for-modding."

8) Use option 9 "Decompile APK" to decompile and expand the app into its component subdirectories and files. These will appear under the Multi-Tool's "projects" subdirectory. Now you can modify these with your favorite editor (Notepad++ is mine).

9) To change the PTY category strings, you will find them in the res->values->strings.xml file. Use wikipedia to find the correct strings for RBDS (i.e. North America). Note also that there are multiple "values-xx" subdirectories, one for each language supported by the app. The "values" subdirectory is the app's default. It is replaced by the others when you select an alternate language. Thus to do this right, what you really want to do is rename "values" to "values-en-rGB" (for UK English) and then create a "values-en-rUS" (or whatever) for your North American PTY strings. In my version of the radio app the default values subdirectory also contains the RBDS strings.

10) When done with your changes, select option 11 "Compile System APK" since the radio app is a system app. It recompiles the project files into an apk, and uses the original app's signature.

11) When recompiling you have the option to recompile using the original app's files, and only substituting the ones you have specifically modified. This is not required but it helps to insure you have disturbed the app as little as possible.

12) If you choose that option the tool will create a "keep" subdirectory which has all those original files in it. It prompts you to delete only the ones that you have modified, so that it will use your changed files instead. You will find that it does NOT contain any of the "values" subdirectories, so if you are changing PTY strings, they are already deleted for you. HOWEVER, you must ALWAYS delete the resources.arsc file! If you do not, then the new app will not contain any of your new PTY strings! Took me a while to figure that one out.

13) After compiling, your new app is saved in the "modified-system-apk-files-here" with "system" prepended to the app's filename. If you want you can copy this to a SD card or USB stick and sneakernet it back to the app (and probably remove "system" from the filename in the process).

14) Or you can use option 8 "Adb push" to write the new app directly into your HU. Choose "a" to write it into the /system/app subdirectory on the HU. If your new app's filename is the same as the currently installed app, then the push will overwrite the old app and you can immediately test it.

So by using the combination of APK Multi-tool and an ADB wifi app, you get a setup that allows you to rapidly make changes to the app and test them on the HU. Well worth the effort IMO!

Anyway, hope this helps encourage others to make simple mods to the apps, instead of asking the heavy lifters here to do them ;).