yashsingh1/xdaforums huggingface dataset:
[Android Themes] Tulsadiver:
You have to enable it in developer settings. In settings "about phone" find your build number. Tap on it rapidly 8-9 times until it says developer settings are now enabled. You'll find a new folder in settings/system called developer. Inside is where you toggle it on. Do it with your phone hooked up to your pc. It'll ask you if you trust this pc, check the box. If you are not aware of this already, you might need to find some tutorials before you start trying to mod.
[Android Themes] Tulsadiver:
I realize this is way off topic but since so many great devs use ticklemyandroid, I thought I would try. I'm looking to put the battery percentage on the left side of the battery icon. Anyone have any ideas? I've uploaded what I thought to be the applicable files, though I could very well be wrong. I can do it using a custom battery but would rather use the stock one.
[Android Themes] Thebear j koss:
I would think it would be in system ui smali somewhere since the battery percentage when enabled shifts all icons to the left. But I haven't looked in an app in a while now.
[Android Themes] Tulsadiver:
Yes, I believe it is in here but I can't seem to figure it out.
[Android Themes] Thebear j koss:
It may be easier than going thru smali. Did you try in layouts, moving the correct resources around in statusbar.xml, qspanel.xml, and quickstatiusbarexpanded.xml? I think it would be easier to move everything that way.
[Android Themes] Tulsadiver:
Battery is in system_icons.xml, which is in the status_bar.xml. The battery and battery percentage is not a separate entity but merged together at some point in the smali files. I just can't figure out where. I've done some smali editing but haven't been able to get this one yet.
[Android Themes] DaOldMan:
Placement of the battery depends on the layout in the xml files. No need to edit smali. If it's a linear layout then just change the position of the icon in the xml file. Done.
[Android Themes] Thebear j koss:
That's what I thought. But I'm not sure if things changed on Android 12.
[Android Themes] Tulsadiver:
These are the only layout files associated with the status bar and battery. I don't see any way to change location of the battery percentage in regard to the battery icon. Perhaps I'm not clear on what I want to accomplish.

100% 🔋

Instead of

🔋 100%
[Android Themes] Thebear j koss:
Sorry I misunderstood. As a test, switch their public id's and see if they swap.
[Android Themes] Tulsadiver:
That was a really good idea but it didn't work. I appreciate both of you for your feedback.
[Android Themes] Ticklefish:
Hmm.. Evenin' all, glad to see this is still going!

I think the solution to your issue may be in com/android/systemui/BatteryMeterView.smali

There should, in theory, be code that displays the text when activated and then code that displays the icon (or code that calls code that displays it at least). If I'm right then that code just needs to be swapped round.

I'm no smali expert but I can take a look if you can share that file.
[Android Themes] Tulsadiver:
I appreciate it. I've been going over it and just can't figure it out....
[Android Themes] Ticklefish:
Wow, this phone really is terrible at browsing smali..

Okay, so I still think I'm onto something here. Like I said, I'm not a smali expert and it's been literally years since I last did anything in that area. So I'd need to wade through the code on a PC and spend time working out what it all does. That's something I can't do right now, sadly.

But this smali is doing a lot to the percentage text and the battery icon so the answer's gotta be in there. All I can suggest for now is looking through that code and seeing what you can work out.

Sorry it's not much help but hopefully it's a start.
[Android Themes] Tulsadiver:
I appreciate it but I've been going over that code for a couple of weeks now, lol! Talk about being bad with code.
[Android Themes] Ticklefish:
I'll take a look when I can. But part of the reason why I haven't been here for so long is I don't really have access to a computer anymore. But maybe I'll be able to do something this weekend.

It would be good if there was an XML file that displayed the percentage and icon as discrete entities but Google have long since gone past that. I'm about 90% sure the answer is in that smali file.

Only 90% though..
[Android Themes] Tulsadiver:
I agree with you.
[Android Themes] DaOldMan:
I have checked the smali for few minutes. It seems this smali is for the Percentage number only. It uses the layouts we already checked. Also it creates a observer to check for change in settings and then display or hide the percentage number. Also it updates the value of the sign dependent on the battery. It doesn't seem to have much to do with the order of the icons. I would find the public value of the battery picture (not percentage) then find it's references in smali. That's how I did a lot of my moding in my roms. Cheers !
[Android Themes] Tulsadiver:
This smali is the one referenced by system_icons.xml and is one way I use to get rid of the battery icon when adding 3minit battery (I use 0.0dip for layout height and width) or zero out these dimensions which are found in this smali:

Lcom/android/systemui/R$dimen;->status_bar_battery_icon_height:I

Lcom/android/systemui/R$dimen;->status_bar_battery_icon_width:I

This same smali is used in the QS pulldown header for battery icon and percentage or "time remaining" when plugged into a charger.

This is refered to here as well:

<public type="string" name="status_bar_battery" id="0x1040816" />
[Android Themes] DaOldMan:
"public type="string" " means this is a reference to a TEXT. I can get rid of this text easily by specifying the height and width to 0.0. I used to make 3minit for many people on the xda hahaha.

Anyway try to find the other battery symbol - the "drawable". Find that public id and lets see the smali it is used in.

Cheers.
[Android Themes] Tulsadiver:
But if I zero out those two dimens, only the battery icon disappears, the percentage is still showing....
[Android Themes] DaOldMan:
The smali is then for the icon, but that id "0x1040816" must be used in more smali then.

Anyway in which smali is that icon referenced (with the Lcom/android/systemui/R$dimen;->status_bar_battery_icon_height:I variable) ?
[Android Themes] Tulsadiver:
BatteryMeterView.smali is where both:

Lcom/android/systemui/R$dimen;->status_bar_battery_icon_height:I

and

Lcom/android/systemui/R$dimen;->status_bar_battery_icon_width:I

are located (along with R$dimen.smali where all the dimensions are located).

0x1040816 is also located in BatteryPreference.smali in smali_classes2/com/android/systemui/tuner folder.
[Android Themes] Tulsadiver:
Found where I think the battery icon is built.

Edit: the battery height and width are referenced in BatteryMeterDrawableBase.smali as well....
[Android Themes] DaOldMan:
Ok, I think I found the place in smali where it initiates the view for the icons. Please try the following attached smali. Fingers crossed :)
[Android Themes] Tulsadiver:
Dang, it bootlooped...
[Android Themes] DaOldMan:
Didn't boot? Or systemui crash again and again?

I have another option, wait few minutes.
[Android Themes] Tulsadiver:
Wouldn't boot up.
[Android Themes] DaOldMan:
Weird, on older Android it would boot even without SystemUI. Test the next smali. Lets see. I am not sure about few things in there. Good luck !
[Android Themes] Tulsadiver:
I was wrong...must have been an old edit of mine....it booted up. What it changed was from percent to "time remaining" in the QS pulldown.
[Android Themes] DaOldMan:
That's more like it. Try the second smali please.
[Android Themes] Tulsadiver:
Give me a bit. I'm taking care of the granddaughter (1 1/2) and the basement where my pc is, isn't baby proofed, lol!

Edit: The second one would not boot up.
[Android Themes] Tulsadiver:
@DaOldMan, do you have a link I could donate to? I really appreciate your effort.
[Android Themes] DaOldMan:
I must see what's wrong with my smali. I must be a bit rusty :). The first one should have worked. Second one is faulty so yes, I understand why it doesn't work.

Please send me public xml file with the ids as well. Tnx !

Also when the percentage text changed to "time remaining" was the order changed with the icon or just the text replaced ? Can you show me a screenshot please ?
[Android Themes] Tulsadiver:
Regular status bar didn't change...

QS changed. Battery stayed the same but 95% example changed to "7 days"

Edit: here is entire framework-res.apk and SystemUIGoogle.apk, decompiled. Also just the framework public/ID and SystemUIGoogle public/id
[Android Themes] DaOldMan:
Ok, this is not the right place then. Please send the public.xml as well so I can see what is what :). I will see more later this week I hope unless someone helps you before me :)
[Android Themes] Tulsadiver:
I edited post above with files. I'm working on two different phones.
[Android Themes] DaOldMan:
Got a tip from a good friend. Try the smali two posts later mate and report. Good luck !
[Android Themes] Tulsadiver:
Will do sir! I'll try it as soon as I get back home!
[Android Themes] DaOldMan:
Ok, as the smali on Pixel is not the same like on Samsung we remoded the smali. Don't use the previous one, use this one mate to test. Cheers !
[Android Themes] Tulsadiver:
I appreciate your hard work. It booted up but the percentage is still in the same place.
[Android Themes] Tulsadiver:
Holy cow! I changed it from forced right to left 0x1 to force left to right 0x0 and it worked!! It's a little close to the battery but maybe with some padding added to the battery_percentage_view.xml it will scoot over! You and your friend are just great. No way I could ever have come up with anything like you two did! I can't thank you enough.

Edit: I took the % off....

Edit2: Yes, a little padding made the difference....

I knew that the best on xda use ticklemyandroid and would visit @Ticklefish 's thread.
[Android Themes] DaOldMan:
I am happy that is works. Most of the heavy lifting was done my dear friend @Grouxho . It seems original Android doesn't add this group with a positioning argument in the method for this layout. So this is why you would never be able to change the groups position. But in Samsung they do use the method with positioning possibility. @Grouxho has changed this part of the code to add the view with positioning argument. Now we can make a switch for it in Rom Settings as well. A observer is on the way too !

Cheers mate, enjoy !
[Android Themes] Ticklefish:
There's something about this post that I really like. Can't think what though..
[Android Themes] Ticklefish:
​

And so it has come...

I started this thread 10 years ago today (depending on your timezone). XDA had been so helpful to me that I wanted to give something back. So I wrote a quick batch file that sped up the decompiling and recompiling process as well as doing a few other nifty things.

A decade later people are still using it! Which is amazing and very, very humbling.

Unfortunately the modding scene has changed and these sort of tools aren't as in demand as they used to be. And my personal life has taken an unpleasant turn so I can't write code as much as I used to.

So there hasn't been a new version of TMA for a long time, and I don't have any planned.

But this thread is still alive, the download link still works, I still check in from time to time and...every single person reading this is still one of the greatest people on the planet.

Thank you all for using my little program over the past 10 years. It means more than you will ever know.
[Android Themes] Tulsadiver:
Thank you for all your time and effort. And for answering all questions, regardless if it pertained to TMA or not. You've been a tremendous help to me personally, for years.
[Android Themes] Thebear j koss:
I'm with Tulsadiver, not only has Ticklefish always gone above and beyond but users of TMA have always been helpful and respectful. Almost every other thread on XDA I have been a part of has been derailed by entitled users, devs who never help others, or fanboy cliques. Although I rarely theme or mod anymore, every once in a while, I'll theme a simple app, and see if I can still pull it off. And of course I always use TMA. Amazing that this has been around for 10 years and it still can't be beat. @Ticklefish thanks for the tool, years of support, and having the best users available on XDA. Thanks to all the fellow users that never fail to help and taught a total newb the ins and outs of modding android. Keep the spirit of android alive by helping others, and keep on modding, theming, and sharing. 👍🐻
[Android Themes] Raiz:
I think that if I wrote the long version, it'd just ressemble what @Thebear j koss wrote, and if I wrote the short version, it'd ressemble what @Tulsadiver wrote.

Thank you @Ticklefish for TMA and all your other threads about theming modding, it really helped me, and I had fun learning !

Thank you people in this thread. This thread has one of the finest, polite and useful community, it embodies what XDA used to be : a bunch of knowledgable people learning from each other, and learning together, and, sometimes, helping newcomers learn too.

My best theming year are behind me I think, it's been very long since I've themed/modded anything.

Thanks you @Ticklefish, and I hope life will be nicer to you in the futur !
[Android Themes] IamTheBRAVE:
I've been following this thread for a long time and read all tips and tricks from @Ticklefish and other users. Very useful thread. Thanks you for it and happy 10th👍
[Android Themes] porkyhontas:
Yeah, Android has changed for the worst in my opinion. But, oh well, it was fun while it lasted. Thanks for the awesome tool that I've been using for the last 10 years! Though I don't theme as much, plus many recompiled apps won't even install anymore not to mention modding one's device in the States is nearly impossible.
[Android Themes] Ticklefish:
Oh? Why's that?

I haven't modded my phone in years. Partially because I don't have access to a computer I can use for it..but mainly because I don't really need to. The battery icon now displays a percentage, the notification shade has a brightness bar AND toggles, and the clock can display seconds all in stock. That's most of my usual mods right there.

I might mess about with the nav bar or the WiFi and signal icons at some point..but I don't really need to.
[Android Themes] porkyhontas:
I'm talking third party apps, should have been more specific. Haven't done much theming since Synergy doesn't really theme much anymore. And forget about the old school way of flashing themes.
[Android Themes] brapsniffr91:
Could thios be used to remove telemetry and other evil bull****
[Android Themes] Ticklefish:
Maybe. If you know how. This is for decompiling and recompiling APK's. Actual modding is down to you.
[Android Themes] sud.vastav:
Congratulations on the 10 year anniversary!

I have been away from Android and XDA for a while now but when I came across your post while casually surfing, it brought back a lot of memories.

Just wanted to thank Ticklefish for all his contributions. The way he patiently replies to everyone's questions both around modding and TMA is simply incredible! I have personally learnt a lot from him. One of the best guys that I have come across on the forum.

Thank you again!
[Android Themes] Ticklefish:
Oh.

Oh wow.

There..er..seems to be something in my eye...

Thank you for your very kind words!! I'm always happy to help if I can and I'm glad I was able to teach you something.
[Android Themes] tvladan:
if it's been answered already I apologize in advance.

I'm trying to mod SystemUI.apk form an android 9 build. I pulled and installed the res framework apk, than de-compiled the pulled SystemUI.apk.

Without modifying anything (after trying with modified xmls and failing) I recompiled, pushed back to system/priv-app, gave proper permissions, rebooted but the apk is not recognized by the system.

The navigation bar and the notification drawer are gone ... other than that all seems fine.

Logcat gives me this error:

"Failed to collect certificates from /system/priv-app/SystemUI/SystemUI.apk"

I used the standard settings, for both de-compile and recompile.

Can somebody point me in the right direction as to how to recompile and use the apk back in the system? My need here is to de-compile, modify the notification drawer background color or text color (cause it's black text on dark grey background, even in day/light mode) and push the modded recompiled apk back to system.

Thanks.
[Android Themes] Tulsadiver:
What phone do you have? Are you rooted with magisk? If so, have you tried applying as a module?

Try applying the mod manually....

1. unzip the original unmodified SystemUI.apk

2. Copy only modified portion of recompiled apk into the original unzipped apk.

3. Zip back up and push that back.
[Android Themes] tvladan:
Thanks for the reply. It's a Car HeadUnit (STM32 px6 Rk3399). Yes I have Magisk Canary latest. I'll try the unzip ideea first, see if it works. I never used Magisk as you suggested for SystemUI apks. but I'll research this variant also. I used TMA in the past to decompile - recompile without any problems, this device (build) seems rather special ... meaning a complete mess.
[Android Themes] Thebear j koss:
I agree try making a magisk module or some type of overlay like substratum
[Android Themes] Teracotta:
Does SystemUI.apk need to pass signature or else ROM will crash?

I am able to edit some assets in Wallpaper Selector, changes the md5 hash but doesn't cause rom to crash

Also, I believe things like lock screen animation is in framework.apk, possible to change framework.apk assets and not cause crash?
[Android Themes] Tulsadiver:
Depends on which version of android you are on. Stock android 13, yes, it will bootloop. SystemUI and framework-res
[Android Themes] Teracotta:
Android 7.0 or earlier
[Android Themes] Tulsadiver:
I always used the original apk, Meta-inf, and android manifest and never had problems. Unzip original apk, replace what you edited, zip back up and you should be good to go.
[Android Themes] Teracotta:
I open SysteUi it with apktool, edit dimen.xml, but attempting to recompile gives several reference errors, like:

'layout_marginBottom' with value @android:dimen/action_bar_button_margin

d SystemUI.apk and b SystemUi gives same errors without editing dimen.xml

What cause? Looks like eveything decompile fine. References need to be removed from xmls?
[Android Themes] Tulsadiver:
What kind of phone do you have?

There are usually some duplicate attributes that have to be removed from the styles.xml. also, did you install your framework first??
[Android Themes] Teracotta:
GSIII

did not install framework because those instructions were crossed out. will test with that

do I erase the references
[Android Themes] Tulsadiver:
Not sure what you mean by erase but install the framework, then decompile, edit, recompile the SystemUI. You still might have some duplicates in styles.xml but that is normal. Delete them and try to recompile again.
[Android Themes] Teracotta:
I copy all files in /system/framework, but did not deodex, and install them using TMA

When I click decompile in TMA the apk's are not listed, just .jar files and some .odex

the 3 apks are in Framework as 1.apk, 2.apk, and 127.apk for framework-res, systemui an twframework-res

I tried just use apktool d and b, but it has recompile errors. How do I decompile and recompile systemui.apk from here
[Android Themes] Thebear j koss:
Don't decompile them. Just install them into TMA. It installs resources needed for the tool to decode in other apps. Also if you are using an odex ROM, don't. Use a deodex version if you will be doing any modifying of apps.
[Android Themes] Teracotta:
I need to decompile systemui.apk to edit dimens.xml

I put all the files from GSIII system/framework + systemui.apk, twframework.apk and frame-res.apk in TMA's Frameworks and installed them

But when I click Decompile in TMA systemui.apk isn't listed

It was changed to 127.apk which is in Frameworks

Also the GUI is hard to read, how fix?
[Android Themes] Thebear j koss:
Almost every aspect of TMA can be changed to customize the theme for your needs, right from the opening page. 2nd you should read up a little before using things that may break your phone. TMA will pull and install all necessary files while phone is plugged in. App that is being decompiled can be pulled using TMA and will be in the IN folder. After decompile, the files that you can edit will be in WORKING folder. After finished with edits, recompiled app will be in OUT folder. As I stated above all of this should be done on a deodexed ROM. Anytime you are editing or modding system apps, you should deodex the files.
[Android Themes] Tulsadiver:
Zip up and upload your SystemUI and the apks from your framework folder (not the jars). I'll take a quick look at them if you like.
[Android Themes] Teracotta:
Deodexing the framework .jars causes them to not get recognized by TMA, the system apps themselves are not odex

ok
[Android Themes] Tulsadiver:
Your SystemUI is not deodexed....there are no smali files.

It decompiled and recompiled for me without issues with no editing.
[Android Themes] Thebear j koss:
I was speaking generally, if you are modifying your ROM it should be deodexed. If you are not modifying jar files don't worry about it. Deodex ROMs are just easier to work with. You shouldn't be doing anything with jar files really anyway. TMA should pull and install all relevant files needed. You do not need to do anything with those files. After installing, pull the app you want to modify, I guess in this case system ui. Decompile. Make changes. Recompile. Any issues, post full TMA log here so someone can look at it.
[Android Themes] Teracotta:
Are you sure? I do the same and TMA reports systemui.apk recompile success, but there is no apk in /out, and there are many errors in history
[Android Themes] Tulsadiver:
Maybe your apktool (2.4.1) should be updated.