Create "XML toggle" in decompiled .apk? - Android Q&A, Help & Troubleshooting

I'm starting to get a bit used to smali editing and making toggles for regular things. I was wondering, is it possible to create a Settings toggle to choose between the use of one of three XML lines? The reason why I'm asking is because I'd like to include the choice between the AOSP ICS lockscreen, the Honeycomb style one, or the Gingerbread Sliding Tab one. My ROM is an ICS one, and thus the lockscreen code from previous Android versions can be found and used in ICS. I have tested, and successfully changed the AOSP ICS lockscreen to the Honeycomb and the Gingerbread ones, via editing a single line in framework-res.apk/res/layout/keyguard_screen_tab_unlock.xml (thanks to this link, which was a reference). Anyways, does anyone know how I could easily implement a way to choose between one of the three, on the fly, without decompiling and editing xmls? Would I have to create 3 separate keyguard_screen_tab_unlock.xml files for each type of lockscreen and then add in the smali logic? Thank you to whoever actually bothers to help me out.

Related

[Q] harder questions on theming

Okay, so i've been playing around with theming for 2 months and i've just about figured it all out, except for one thing.... the VZW banner on the lock screen for the D2 doesnt seem to give two ****s what i put in any of the keyguard .xmls that is supposed to control the layout and keeps on just being white...
im running fission 2.5.7 and i've tried everything that is supposed to do the lockscreen on the xml side (as far as i know) including the colors.xml in the values folder(more on this issue later)... so i started poking around .jar files in the framework but unfortunately i have little understanding still of .smali files because im still on the baby steps side of coding beyond the beginners html stuff i learned in the 6th grade ('99) and i could use some help/pointers toward i should be looking for.
i noticed mentions of wakelock (or something like it, its 2am and im mentally fried right now) in one of the smali files in a telephony folder in framework.jar but im just not sure if it is even close to the right thing because it may just be the phone doing something to the cdma radio on wakeup....
I'm open to try any suggestion you guys are willing to throw at me because finishing this project is important to me.
every guide i have been able to find so far just mentions line 7 and 8 of the .xmls in layout, if you find another idea besides that already posted send those too...
ALSO, when i edit colors.xml and then compile and push framework-res.apk to the phone i get 2 results depending on what i do
1) move the file that values folders gets turned into into the original framework-res.apk and get a boot look
2) use the newly compiled framework-res.apk (in whole) and lose the functionality of lockscreen selection app...
any idea on how to make this work would also be awesome
may end up having to work with the devs in the chatroom on this issue (im sure) but its also somethign i want to do so i can change the text colors of sound on/off (along with a couple other default text colors)

gray background dialer

Hello all, I would like to ask a question on dialer streakdroid 1.9. are
managed to make my Contacts.apk transparent by simply adding
theme.wallpaper styles.xml in the background of my dialer but continues to be increasingly
gray. how can I do to make it transparent?. thanks
custom dialer background
Ive been searching everywhere building and testing contacts.apk, Can someone with some more code knowledge have a peek at this please?
Ive dug through all the .xml's, the Manifest .xml, the .smali (even though I dont understand very much at all), there are only a few .png's the rest are .9.png, so Im sure the grey comes from code. in colors .xml there are a couple which match this dark gray perfectly, I changed those to black as well as styles Theme to Theme.Black, and Theme.Wallpaper(which will change the other 3 backgrounds but not dialer), ive tried changing background only in styles, no luck.
I saw on Dell website where it says Streak has Customized Dialer, which obviously we know, but I think ours is a unique situation
chrisrotolo said:
Ive been searching everywhere building and testing contacts.apk, Can someone with some more code knowledge have a peek at this please?
Ive dug through all the .xml's, the Manifest .xml, the .smali (even though I dont understand very much at all), there are only a few .png's the rest are .9.png, so Im sure the grey comes from code. in colors .xml there are a couple which match this dark gray perfectly, I changed those to black as well as styles Theme to Theme.Black, and Theme.Wallpaper(which will change the other 3 backgrounds but not dialer), ive tried changing background only in styles, no luck.
I saw on Dell website where it says Streak has Customized Dialer, which obviously we know, but I think ours is a unique situation
Click to expand...
Click to collapse
"Customized" is not a word I'd choose to use when describing the horrible dialer. Hope someday we can improve it. I really think the dialer is the worst part of the UI.
if I find it I will gladly make a guide to theme it.
I may even send Dell developer an Email... oh yeah too late not supported..
chrisrotolo said:
if I find it I will gladly make a guide to theme it.
I may even send Dell developer an Email... oh yeah too late not supported..
Click to expand...
Click to collapse
+1
I think the EOL is only USA. But I don't think the dell dev team cares too much about us
Brainstorming: Reference for anyone else trying to find this..
the dialer background is not a .png, most images are .9's I pretty sure the background is not a .9.png. There is only one .png close to the color and Ive already tried changing that one.
It could be a color in color.xml, they could have coded it as android:color, but if they did that it would likely be a solid color such as black or transparent, and would have to rely on framework-res. More than likely they would have made their own color in colors.xml, since there is only a dozen or so, at least 2 of which are almost identical greys, I have tried changing these colors to black with no luck.
Ive tried changing almost every .xml refernce I could find to a drawable window/background, etc. to android:color"black" , Theme.Black or 000000,
It could be in .smali, Is where I will dig next, I have tried checking a few of the codes I found in there, they seem to be based on a deep purple?
this is just reference use to help others who may search, wish me luck!!
spelling error found DialtactsActivity.smali line 205 says: const-string v3, "Dailtacts" ,yeah wonder if this why dialtacts theme doesnt theme completly.
some progress!
I fixed the spelling mistake in DialtactsActivity.smali, though i dont /think/ this is what we see. I did change call_background.xml and secondary_call background.xml all parameters to android:color/black, I will keep experimenting, funny how in vertical only the right side of keypad is black,
Once we find the right string , we should then be able to create a custom style instead of just a solid color and use a custom background.png
edit: FOUND IT!, cant post screenie, out right now, should release something later and info. Sit tight everyone.
found it
right where its "should" be, contacts\res\layout-long-finger and res\layout-long-land-finger. the first is portrait, second is landscape. the file for both is twelve_key_dialer.xml. The first line:
LinearLayout androidrientation="vertical" android:id="@id/top" android:background="#ff000000"
just change the android:background="ffRRGGBB" to whatever 6 digit RGB/hex value you desire.
working on this now to call out a custom.png will likely get scaled like cr4p, but will give it a go.
If you dont have any .9.png errors decompiling, then you can recompile and flash it straight away.
If you use my phone&contacts theme, it wont compile because some of my .9.pngs must not be patched. So use stock to change, then after compiling extract the new .apk. If youre using my theme or whatever, then change my contacts.apk to contacts.zip, open my contacts.zip as an archive with 7zip, copy the 2 twelve_key_dialer.xml's, and close. Then in your stock framework where you changed the .xml's go to resources.arsc and right click use 7zip to add to archive... browse and select your contacts.zip with new .xml's. Its important that archive method is .zip and compression must be set to store. make sure update mode is: add and replace files. Then rename back to contacts.apk and place in your update.zip and flash!
I plan on making a guide and probably a stock framework with a custom.png for everyone to use.

[Q]Anybody know if it's possible to . . .

I have a very nice icon overlay I would like to use over all of the icons placed on home screens or in the app tray by Rosie.
I am assuming if I find the spot in Rosie where it places those icons after getting them from the apps, I could add this in.
I can add the overlay to each APK by hand, but this will only work for APKs included in the ROM, whereas putting it into Rosie would put it on all of them, even user installed ones.
Thoughts? Anybody done or seen anything like this?
D
.
dsb9938 said:
I have a very nice icon overlay I would like to use over all of the icons placed on home screens or in the app tray by Rosie.
I am assuming if I find the spot in Rosie where it places those icons after getting them from the apps, I could add this in.
I can add the overlay to each APK by hand, but this will only work for APKs included in the ROM, whereas putting it into Rosie would put it on all of them, even user installed ones.
Thoughts? Anybody done or seen anything like this?
D
.
Click to expand...
Click to collapse
That would need to be coded and supported into the launcher application. Stock aosp, and rosie I don't think support that, there are other launchers that do support it though with a theme apk. Like Go Launcher or ADW.
Unless you are asking something else?
lithid-cm said:
That would need to be coded and supported into the launcher application. Stock aosp, and rosie I don't think support that, there are other launchers that do support it though with a theme apk. Like Go Launcher or ADW.
Unless you are asking something else?
Click to expand...
Click to collapse
No, I was totally talking about hacking it into Rosie.
I know there are overlays used for other things, so I was just considering the idea of adding one for this.
Not as a user option, as something automatically done to all icons.
D
.
dsb9938 said:
No, I was totally talking about hacking it into Rosie.
I know there are overlays used for other things, so I was just considering the idea of adding one for this.
Not as a user option, as something automatically done to all icons.
D
.
Click to expand...
Click to collapse
I have no smali experience, and don't really have an interest. Hopefully someone else can help then.
lithid-cm said:
I have no smali experience, and don't really have an interest. Hopefully someone else can help then.
Click to expand...
Click to collapse
LOL, that's fine. I'm sure it's XML, not smali, but thanks for looking anyway.
D
.
dsb9938 said:
LOL, that's fine. I'm sure it's XML, not smali, but thanks for looking anyway.
D
.
Click to expand...
Click to collapse
Its most definitely not just xml edits. You will need to write code into the launcher to accept different icons based on package name. Currently the launcher uses a default api to retrieve the icon attached to the launcher intent. Be my guest to get it working with only xml edits though.
lithid-cm said:
Its most definitely not just xml edits. You will need to write code into the launcher to accept different icons based on package name. Currently the launcher uses a default api to retrieve the icon attached to the launcher intent. Be my guest to get it working with only xml edits though.
Click to expand...
Click to collapse
I don't want to change it pulling the icon from the app.
After it does that, when it renders it, I want to add the overlay on top. Which I am hoping I can do in the layout XML files.
Of course, I could be completely wrong, which is why I posted this.
D
.
dsb9938 said:
I don't want to change it pulling the icon from the app.
After it does that, when it renders it, I want to add the overlay on top. Which I am hoping I can do in the layout XML files.
Of course, I could be completely wrong, which is why I posted this.
D
.
Click to expand...
Click to collapse
Right, you need to code in the overlay. Overlay via xml that you are thinking of only works when building from source. An example is the amount of code needed to theme a rom like cm7, cm9, cm10. These all have that ability to theme the icons based on activity name in the framework, if that activity path and image exists, it displays a different image. This is done in code, not xml.
lithid-cm said:
Right, you need to code in the overlay. Overlay via xml that you are thinking of only works when building from source. An example is the amount of code needed to theme a rom like cm7, cm9, cm10. These all have that ability to theme the icons based on activity name in the framework, if that activity path and image exists, it displays a different image. This is done in code, not xml.
Click to expand...
Click to collapse
Guess it's a good thing I asked before diving in then.
Thanks for the info.
Being an HTC guy who only messes around with Sense, I have some smali under my belt, but I am by no means good at it. So I guess I will seek help from somebody who is.
Thanks a bunch!
D
.
Here is some code from ADW that enables the icons to be themed.
Part1
https://github.com/CyanogenMod/andr...mmit/84457c8837dfd62f11f616de50289860b8542887
Part2
https://github.com/CyanogenMod/andr...mmit/6c6ae4a8d5dc538b337e4d0206ac75358b31044c
This toggles on/off the icon themes:
https://github.com/CyanogenMod/andr...mmit/8236848db5c80e5cb8f2e1cbba74e7fa194dfb1f
In order for you to enable "icon" overlay support, you will need to add code in to support it. I am sorry.
lithid-cm said:
Here is some code from ADW that enables the icons to be themed.
Part1
https://github.com/CyanogenMod/andr...mmit/84457c8837dfd62f11f616de50289860b8542887
Part2
https://github.com/CyanogenMod/andr...mmit/6c6ae4a8d5dc538b337e4d0206ac75358b31044c
This toggles on/off the icon themes:
https://github.com/CyanogenMod/andr...mmit/8236848db5c80e5cb8f2e1cbba74e7fa194dfb1f
In order for you to enable "icon" overlay support, you will need to add code in to support it. I am sorry.
Click to expand...
Click to collapse
No worries, it's good to have input from people who know more than I do.
I was hoping it would be easier, just adding my overlay in the layout XML files over top of the app icons, but life is never easy.
D
.

"Newbie" looking to create a "standard" android theme. Some starter questions

"Newbie" looking to create a "standard" android theme. Some starter questions
Hello,
I am not new to Android but I have had a tough time finding a "native" way to create themes. I do not want to use a theme launcher or an alternative home app. I just want to use the standard android home app and create a theme for it. I took a brief look at the theme starting page above but none of the links I tried work. I just want to use the standard android theme (it fits my tastes closely enough) and change only a few things (for now). Here is what I want to change:
Wallpaper (so that it changes periodically through a "slide show"... only one shows currently... I have already some of these)
Lock out Wallpaper (so that a different one shows every time like it currently does... I have already created these)
Replace specific icons (I already have the icons I want to use)
Possibly replace colors of one or two apps (such as texting).
Is it possible to do this?
I have done some initial exploring on my own. My phone came with one theme (and the default theme) and that is it. I found it on my phone and decompiled it. It appears a bit more complex than I was hoping though I understand most of it. There are lots of extra icons I do not want to replace so I have a few questions which are number in parenthesis. First, there appears to be some sort of pseudo java code. I know both C++ and C# and have used them extensively. However Java isn't nearly as familiar. It does not however seem to quite fit the Java syntax I have seen and used in the past.
The files that contain this pseudo java code also seem to define the file names to use for each icon followed by a hex code which I am assuming is the activity that the file is associated with. However, I have not found where it defines the lock out wallpaper. (1) If I only specify specific icons, will the default android icon be used or do I need to identify them all? (2) If I need to do them all, is there a location to download the standard theme for Java 6.0.1 (the version on my phone?) (3) Is there a standard format for themes that can be used by the Android Home/Launcher? (4) Is someone going to update the sticky post above with more recent file links?
I found this icon pack generator tool. (5) Does it create "standard" icon packs that can be used without a third party launcher? I still would like to integrate my own wallpapers and lockout wallpapers though.
primem0er said:
Hello,
I am not new to Android but I have had a tough time finding a "native" way to create themes. I do not want to use a theme launcher or an alternative home app. I just want to use the standard android home app and create a theme for it. I took a brief look at the theme starting page above but none of the links I tried work. I just want to use the standard android theme (it fits my tastes closely enough) and change only a few things (for now). Here is what I want to change:
Wallpaper (so that it changes periodically through a "slide show"... only one shows currently... I have already some of these)
Lock out Wallpaper (so that a different one shows every time like it currently does... I have already created these)
Replace specific icons (I already have the icons I want to use)
Possibly replace colors of one or two apps (such as texting).
Is it possible to do this?
I have done some initial exploring on my own. My phone came with one theme (and the default theme) and that is it. I found it on my phone and decompiled it. It appears a bit more complex than I was hoping though I understand most of it. There are lots of extra icons I do not want to replace so I have a few questions which are number in parenthesis. First, there appears to be some sort of pseudo java code. I know both C++ and C# and have used them extensively. However Java isn't nearly as familiar. It does not however seem to quite fit the Java syntax I have seen and used in the past.
The files that contain this pseudo java code also seem to define the file names to use for each icon followed by a hex code which I am assuming is the activity that the file is associated with. However, I have not found where it defines the lock out wallpaper. (1) If I only specify specific icons, will the default android icon be used or do I need to identify them all? (2) If I need to do them all, is there a location to download the standard theme for Java 6.0.1 (the version on my phone?) (3) Is there a standard format for themes that can be used by the Android Home/Launcher? (4) Is someone going to update the sticky post above with more recent file links?
I found this icon pack generator tool. (5) Does it create "standard" icon packs that can be used without a third party launcher? I still would like to integrate my own wallpapers and lockout wallpapers though.
Click to expand...
Click to collapse
I've moved your thread to Q&A as I think it is more appropriate. So you want to keep the standard android launcher, depending on your device you could install a rom that has substratum support. This will allow you to keep your normal launcher but theme every aspect of your rom
sawdoctor said:
I've moved your thread to Q&A as I think it is more appropriate. So you want to keep the standard android launcher, depending on your device you could install a rom that has substratum support. This will allow you to keep your normal launcher but theme every aspect of your rom
Click to expand...
Click to collapse
What about my device would it depend on? If I even understand this question, my first guess would be my OEM. since...
I really don't know what you are talking about. Wouldn't the rom depend on the OEM? What if my OEM doesn't provide substratum report (not that I know what that is).

[Q]How to identify drawable name/id on running app?

Hi! I'm new into creating themes, and I'm looking for a tool that could make it easier. I know how to extract .apk, how to replace images, modify .xmls, but often I don't know what an image is for. Let's say im modding SystemUI and I want to change background of my notification bar. The only thing I know is that inside drawables folder I have to look for something named notification_bar.png, something like that. I was looking for an app that could tell me how an image inside an app is called in code ( example: I'm inside calculator app, I press on background and the app says that file is called background.png and is inside drawables-xxhdpi). I tried Android Studio --> Layout Inspector, but it didn't help me at all because, well, I just don't understand it.
Of course, while modifying SystemUI I can look for explaination of certain pngs on the internet, but
-not every SystemUI is the same
- if I want to change drawables of an app that doesn't have specific explaination I have to know how to identify drawables.
It must be possible somehow, because I've run into some themes that modify external apps (like WhatsApp, SuperSU etc.)
Those ppl had to know what certain .png is for, the question is: How?
I don't believe they just had to sit there and try every possible combination.
Also, inside SystemUI there's A LOT of files that are never used, and their names can be misleading.
Is there any way to identify drawable inside running app easily? Without digging in code and guessing?
Thanks in advance for any answer
I tried to analyze Mms.apk (it's system app). I was looking for a drawable representing default contact icon, here called ic_contact_picture.png .
I actually managed to find a proper layer in Layout Inspector(ConversationListItem.xml), analyzed it and found a code referring to table "id" in resources.arsc . The object the id referred to was called "avatar". And that's it. I couldn't find id(I got it from resources.arsc/drawables) of ic_contact_picture.png anywhere in that layout. There was only id referring to "id/avatar". It doesn't make any sense.
How do I find drawables using Layout Inspector or any other tool?
It was easier when it came to text. I also found an id referring to resources.arsc/id, but that id was included in the layer I was looking at (ConversationListItem.xml).
But I still wasn't able to perform any action on that text, because there wasn't any setting like text color or anything, there was just a line android:textAppearance="@attr/0x1010041"
It is an attrib from framework-res.apk, but when I opened framework-res.apk and found that attrib there was no reference to anything like color, font, so there was nothing I could really do.
Can someone help me with those 2 problems?

Categories

Resources