btw does someone know what the standard procedure is to edit the resources of an apk? I mean of course I know how to do it,
cd /d %~dp0
java -jar apktool.jar decode -f SystemUI.apk
Then make adjustments in source
cd /d %~dp0
java -jar apktool.jar build -f SystemUI SystemUINew.apk
now I have to move "classes.dex, res (folder) and resource.asrc" from SystemUINew.apk to SystemUI.apk (so the META-INF (folder) and AndroidManifest.xml stays intact)
So this is what I did:
7za u SystemUI.zip classes.dex
7za u SystemUI.zip res
7za u SystemUI.zip resource.arsc
(its renamed to .zip in that phase because the 7za tool can't work with apk files it says (which is definitely not true ^^)
Well after that it renames back to SystemUI.apk and moves to complete folder, but then I'm getting the same resources as before compiling.
This is my script, it's probably just some stupid small error that I don't see right now XD)
$U_input = InputBox("Custom status bar label - broodROM RC5 -","Enter your custom label here.")
if $U_input = "" or 0 then Exit
TrayTip("Custom Status Bar Label", "Decompiling..", 0, 1)
TrayTip("Custom Status Bar Label", "Adjusting Resources..", 0, 1)
$read = FileRead(@ScriptDir&"\tmp\stringstem.xml")
FileWriteLine(@ScriptDir&"\tmp\SystemUI\res\values\strings.xml", @TAB&"<string name="&Chr(34)&"broodrom"&Chr(34)&">"&$U_input&"</string>")
TrayTip("Custom Status Bar Label", "Compiling Resources..", 0, 1)
FileMove(@ScriptDir&"\tmp\SystemUINew.apk", @ScriptDir&"\tmp\SystemUINew.zip", 1)
Run(@ScriptDir&"\tmp\SystemUINew\7za.exe x SystemUINew.zip")
RunWait(@ScriptDir&"\tmp\SystemUINew\7za u SystemUI.zip classes.dex")
RunWait(@ScriptDir&"\tmp\SystemUINew\7za u SystemUI.zip resource.arsc")
RunWait(@ScriptDir&"\tmp\SystemUINew\7za u SystemUI.zip res")
FileMove(@ScriptDir&"\tmp\SystemUINew\SystemUI.zip", @ScriptDir&"\complete\SystemUI.apk", 1)
if FileExists(@ScriptDir&"\complete\SystemUI.apk") then
MsgBox(0, "Custom Status Bar Label", "Your SystemUI.apk has been successfully compiled and can be found in "&@ScriptDir&"\complete\")
MsgBox(0, "Custom Status Bar Label", "Something has gone wrong, please try again!")
Ok fixed the apktool now , also thnx to FaeRhan who pmed me with some mistakes i made.
If someone wants to test it, attached it. be aware that it's only compatible with the extended status bar AND swipe to remove notification (as in RC5), if you have only 1 of them or none then don't even try it, it will cause fc's in that case
Ok so my development status is now actually finished, gonna put everything together and then build.
I am not 100% sure if the tonight's build will be the final RC5 build, I will need feedback mainly on the scripts part, I can't guarantee that every script works perfect in any situation.
Since i'm awake since friday morning and haven't slept for 2 days now, I'm not so focused anymore, so there is a change I make small mistakes, that's why I will make an other version tomorrow (if needed, the build might just be perfect tonight, who knows) to compensate any possible issue/bug.
Here is a screenshot of the result when entering "XDA Developers" as custom label
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?