[Q][THEME] Replacing PNG in system file - HTC One X

Hello.
I am running this ROM, and my lockscreen looks like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I want to replace the white circle around the icon (displayed when hovering the icon, before releasing the finger from the screen). It just needs to be transparrent.
The developer of the ROM wrote this to me:
final Drawable activeBack = mResources.getDrawable(com.android.internal.R.draw able.ic_lockscreen_target_activated);
...
So change icon ic_lockscreen_target_activated.png
Click to expand...
Click to collapse
The commit to the Git is here: https://github.com/IceColdJelly42/frameworks_base/commit/f1971285b709593873bf8c3effd144087b710104
Question: So far, i understand that i must replace the PNG in the system, but where would it reside? I dont think its in an APK as such, as its the system itself (though that could be apk's aswell...?). I was pointed to this tutorial that should have info on how to do it, but the guide refers to APK-filenames, and again, whats the APK filename? I have no APK in data/app or in system/app that matches "com.android.internal" - so im quite out of luck....?
Any advice on how to proceed is welcome. I have downloaded the PNGs attatched in the ZIP, from the source (git), those are the ones i want to replace with (they are all transparrent as they should be, for my project).
Kind Regards
TwinAdk

The image that you're looking for, is in "framework-res.apk\res\drawable-xhdpi.
When you have changed the image, push framework or copy/paste it in system\framework and reboot!
For security, make a nandroid backup

Okay, so framework-res.apk, and then follow the guide i linked to, and just mirror the structure of the folders in the apk (\res\drawable-xhdpi) - correct?
Or should i unpack the apk, replace pics, resign the apk and push instead?
Also, xhdpi, hdpi, etc.. Whats the difference except the size of the images (resolution)? Is it if i have a phone with lower res, i will need the lower res images?
Thanks so far!
EDIT: You made me laugh there sir..! ALWAYS a nandroid backup! Rather 10 useless backups, than one missing..! :victory:

TwinAdk said:
Okay, so framework-res.apk, and then follow the guide i linked to, and just mirror the structure of the folders in the apk (\res\drawable-xhdpi) - correct?
Or should i unpack the apk, replace pics, resign the apk and push instead?
Also, xhdpi, hdpi, etc.. Whats the difference except the size of the images (resolution)? Is it if i have a phone with lower res, i will need the lower res images?
Thanks so far!
Click to expand...
Click to collapse
With winrar or similar, open the apk, go to res\drawable-xhdpi and change image.
Now, you can push framework in rom and see results
I know that change only resolution of icons in that folder

Here you go. Push to /system/framework/ and set permissions.
Don't know if it will work 'cause I don't have ICJ flashed at the moment. Make a backup before trying it.
I had to compress it before uploading because the limit was 8mb.

Sv: [Q][THEME] Replacing PNG in system file
TToivanen said:
Here you go. Push to /system/framework/ and set permissions.
Don't know if it will work 'cause I don't have ICJ flashed at the moment. Make a backup before trying it.
I had to compress it before uploading because the limit was 8mb.
Click to expand...
Click to collapse
Wow, will try that! If it fails ill investigate tomorrow.
Kind Regards
TwinAdk
- Via the XDA app

Hello.
How can i push it to system/framework? I tried adb shell when in recovery, but i cannot access the framework folder.. /system/ nothing (only bin?)
Also, adb push gave this:
C:\fastboot>adb push framework-res.apk system/framework/framework-res.apk
failed to copy 'framework-res.apk' to 'system/framework/framework-res.apk': No s
uch file or directory
Click to expand...
Click to collapse
Output from shell, while in recovery (only place adb shell works, except from when the phone is booted, but i tried renaming the apk via a file explorer, the system crashed, lol).
~ # whoami
whoami
root
~ # df -h
df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 488.2M 48.0K 488.1M 0% /dev
/dev/block/mmcblk0p13
315.0M 5.2M 309.7M 2% /cache
Click to expand...
Click to collapse
Any advice?

Put / in front of system. It should be /system/framework/
Sent from my One X

adb works in android, not in recovery

Guich said:
adb works in android, not in recovery
Click to expand...
Click to collapse
It does work in recovery too. You should try it.
Sent from my One X

TToivanen said:
It does work in recovery too. You should try it.
Sent from my One X
Click to expand...
Click to collapse
Ill try to add / in recovery. When i did so in android, i got an error that the filesystem was read only.. I am rooted.
Update: It pushed correctly, but i only see that one file..... After reboot the file was not modified.. Verified with solid explorer.
ls while in recovery:
/system/framework # ls -lah
ls -lah
drwxrwxr-x 2 root root 0 Jan 29 20:28 .
drwxr-xr-x 4 root root 0 Jan 29 20:28 ..
-rw-rw-rw- 1 root root 8.6M Jan 29 16:09 framework-res.apk

Oh well, moved the apk with solid explorer, from sd to system/framework (overwrite exsisting) - phone is rebooting now..
UPDATE: Didnt boot up.. Trying to clear cache and dalvik, then well se.. Think ill have to revert to my dear nandroid

Well, damn it. I replaced the pngs with the files you provided, built and signed without an error. It should be OK but as I said I don't have ICJ installed so troubleshooting is a bit difficult.
Try to do it yourself with apktool.
Sent from my One X

Sv: [Q][THEME] Replacing PNG in system file
Will do. Your apk was considerably smaller than my original, also it struck me that you cannot have guessed my version of the custom rom, and thus the correct apk to use as source. I guess it is modified on each version?
Kind Regards
TwinAdk
- Via the XDA app

Hello.
I tried recreating the APK, using my own framework-res.apk as source.
I also found out how to push to system from CWM - you need to mount /system - DOH!
But it fails.... The phone never boots, i even chmodded the apk with 644, so the permissions are the correct ones..
Back to nandroid backup, and drawing table....
Anyone have any clue as to why the new apk failed? Followed this guide, and loaded the sources to UIsystem,apk and framework-res.apk before editing the APK.
When building the APK i got this output, and it does however not match the output in the guide - the "Could not find sources" does worry me a bit, should it..?

Found the reason for the "could not find sources":
A framework-res.apk is itself the source of other apks( when you install it - apktool if...). So the message that you got is normal.
Click to expand...
Click to collapse
Ref: http://forum.xda-developers.com/showpost.php?p=31832660&postcount=12

The .apk I started with was from 1.5.9 and it was 12mb in size.
Apks tend to lose weight when they are de/recompiled and that's why the finished product was only 8mb.
If the apk method fails, you could build the whole ROM yourself on a linux PC.
Keep me posted!
Sent from my One X

Well, though i used unix before, i dont wish to put the effort into building from source It seems building in a VM fails for many, and it requires quite alot of space...
My apk also lost weight, 8 mb after rebuild.. If the image is there, it does not matter what bitdepth and other fancy settings it was saved with, right? Aslong as the apk was build correctly, and chmodded correctly, the phoen should boot, right (and display an ugly image, if it wants - but at least boot!)

Did you sign the package?
Sent from my One X

No, according to the guide i followed:
Now, final step is signing the apk file.
Remember don't sign the apk if it's a SYSTEM app, unless you have edited the AndroidManifest.xml.
Click to expand...
Click to collapse
I suppose its a system app, as it resides in /system/framework...?

Related

[MOD] 1% battery, no carrier, CRT off, no wasted space around clock

This mod will add the following features:
battery % numbers with step of 1 instead of 5 as by default
battery charging icon displays %
no carrier text
no wastes space around clock (especially noticeable with 24H clock)
CRT off effect (it's an animation when screen gets turned off)
The battery icons were taken from [KITCHEN][12/20] UOT Kitchen (Ultimate Online Theme Kitchen) version 4.0
Created from and tested on Nitro HD P930 (AT&T) with stock rom.
Disclamer: as usual you are the one who is responsible if you brick you phone
The attached files can be flashed with CWM. In my tests I had to install package twice without reboot, otherwise it would either get stuck at LG logo or boot loop.
Make sure create a backup with CWM before installing this!
If you don't want use CWM you can install it manually:
backup /system/framework/framework-res.apk and /system/app/SystemUI.apk
copy framework\framework-res.apk and app\SystemUI.apk from package to sd card on your phone
a) using Root Explorer (DO NOT USE ES FILE EXPLORER OR YOU'LL BRICK YOUR PHONE!) copy framework-res.apk and SystemUI.apk from sd card to /system/.
Change permissions to:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
move /system/framework-res.apk to /system/framework/
and /system/SystemUI.apk to /system/app/
reboot (don't worry about force closes, it's normal)
b) using adb from your computer, make sure phone is set to debug mode.
open cmd window on your computer and type (each line is separate command):
Code:
adb shell
su
mount -oremount,rw /dev/block/mtdblock3 /system
cp /sdcard/framework-res.apk /system/
chmod 0644 /system/framework-res.apk
chown root.root /system/framework-res.apk
cp /sdcard/SystemUI.apk /system/
chmod 0644 /system/SystemUI.apk
chown root.root /system/SystemUI.apk
mv /system/framework-res.apk /system/framework/
mv /system/SystemUI.apk /system/app/
mount -oremount,ro /dev/block/mtdblock3 /system
exit
exit
adb reboot
It'd be really cool to figure out how to manually cook an apk like itiskonrad did, but with percentage text in 1% increments on top of the blue battery he created.
Awesome! Thanks, [email protected]! Yeah, Malnilion, if it's okay with [email protected], maybe I can take a look at it and try to group it with the blue icons/blue battery/no carrier stuff if he's cool with that?
itiskonrad said:
Awesome! Thanks, [email protected]! Yeah, Malnilion, if it's okay with [email protected], maybe I can take a look at it and try to group it with the blue icons/blue battery/no carrier stuff if he's cool with that?
Click to expand...
Click to collapse
absolutely!
And by the way, after seeing the vertical icon I noticed that we have so much wasted space between battery icon and clock, never noticed it before, now it bothers me...do you think there is a way remove that space?
Hmm, one question though. If I apply the % to the stock battery, what color do I choose for the number? =) As the battery drains, it has a white background, so I guess no white. So just black?
Quick question for [email protected]! I decompiled the framework-res.apk that you got from UOT Kitchen, and noticed that all the battery icons normally used by the phone (typically stored in framework-res/res/drawable-xhdpi) are missing. The battery icons being used in this theme are being stored in framework-res/res/drawable-hdpi, the folder designated for lower-resolution icons for lower res phones. My question is did you delete the battery icons from xhdpi? Or did UOT kitchen do it automatically?
No, I did not touch the .apk files. Must be UOT kitchen itself...
I wonder when/where these xhdpi images are being used?
In the nitro, xhdpi images include pretty much all the icons, battery, buttons used. All modifications I made were to copies of the icons used in xhdpi. UOT kitchen can't handle xhdpi yet. It's only designed for phones up to qHD, which still use images in hdpi. So when UOT kitchen made the phone use 1% battery increments, the only way it knew how was to direct the framework to use hdpi images of the battery, since it doesn't understand how to modify xhdpi yet. This is fine, but I'm wondering if since it's directing the battery icons to hdpi (these are about half the resolution of the xhdpi icons) if it's also directing ALL the other icons to hdpi. Did you notice any drop in quality (or size) of the other icons unrelated to the battery when installing this apk, in particular the install icon (the arrow with the horizontal green line going through it that pops up when you're downloading/installing an app)? If nothing else changed, then it's good. Then the only things that have been modified are the battery icons, and I can see if I can just swap them out with higher res originals with added percent values....
looks cool, about to do this but re: step 3b
could you clarify what adb is?
thanks in advance!
scott0 said:
looks cool, about to do this but re: step 3b
could you clarify what adb is?
thanks in advance!
Click to expand...
Click to collapse
adb.exe is a command-line tool, part of a set of Android Developer tools. You usually have to download the Android Software Developer's kit to get...But since I know you recently used SuperOneClick to root your phone, you can just grab it from that install.
Be sure whatever directory you use, you copy over all the files inside the ADB directory from SuperOneClick
Namuna said:
adb.exe is a command-line tool, part of a set of Android Developer tools. You usually have to download the Android Software Developer's kit to get...But since I know you recently used SuperOneClick to root your phone, you can just grab it from that install.
Be sure whatever directory you use, you copy over all the files inside the ADB directory from SuperOneClick
Click to expand...
Click to collapse
hey cool, thanks! firing up the superoneclick here in a bit.
You know, now I do see the battery icon is a bit fuzzy, but it really, really barely visible...we are talking about 24% difference, 38x38 vs 50x50
if others are afraid of bricking their phone.
i can confirm that this mod DOES WORK! (i use the 1%_battery_horizontal.zip)
thanks [email protected] !
Added CRT off effect
I am running Domination HD rom, flashed with CMW, boots fine but i have no notification bar at all.
Any ideas or is it maybe only compatible with stock roms?
Sent from my LG-P930 using XDA App
blaineball said:
I am running Domination HD rom, flashed with CMW, boots fine but i have no notification bar at all.
Any ideas or is it maybe only compatible with stock roms?
Sent from my LG-P930 using XDA App
Click to expand...
Click to collapse
I think it's due to Domination is deodexed rom, this mod is not dedexed.
I don't know if there is a way use dedexed SystemUI.apk on stock rom or not...
I'm in process of testing phone with no CWM installed, so I don't want risk it soft brick
I've attached SystemUI.odex file, try put it in /system/app/ using the manual method above.
If it works, perhaps deodex version could possibly make it work on stock rom as well.
Deodexed SystemUI.apk works fine on non-deodexed stock rom. I'm using it now in order to get the transparent notification bar on my otherwise stock rom.
Did you have to delete SystemUI.odex ?
Yup, deleted the odex after putting in the deodexed apk. Works fine as far as I can tell. Been using it this way for a month or so and no signs of anything weird. And I think since only SystemUI.apk is deodexed, it didn't seem to change my boot time when turning on my phone. Still right around 55 seconds.
How would I add just the CRT effect?

[MOD]/[HOWTO] Make E4GT ROMs show 1X/3G instead of just 3G! (FF18/ICS)

For the Gingerbread version of this fix, click here!
Greetings and Salutations, Epic 4G Touch Owners and other curious parties!
Disclaimer: Just reading this may cause your head to burst, your phone to catch fire, dogs and cats may do the tango! I am not responsible for any bad stuff that happens from you reading or acting on the information in this thread.
If any ROM authors want to use this fix in their ROMs, I'm completely cool with that. A quick kudos in your credits section would be nice, though.
Background: One of the things that really peeves me off about Sprint is that they want us to think we always have 3G service. I know that I don't have 3G in all of the areas I travel, and I also don't when I am roaming.
Thankfully, the fix is quite simple! It was a bit more difficult than the fix for HTC Sense ROMs as the smali edit was not quite as simple.
This was my primary reason for rooting my phone, that's how aggravating it is for me.
Let's change this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
To this:
Credits
Calkulin, sextape, sfhub, Other brave folks - For providing the leaked ROMs for me to fiddle with.
Calkulin - (indirectly) helped me find how to fix this for Sense ROMs which I wrote up here.
Samsung - for a relatively good phone. Hopefully the weird auto-brightness and battery life will be fixed next update.
The brave XDA members who try these instructions and report their success or failure!!!
XDA for being a great source of information!!!
XDA members for thinking outside of the box!!!
The fix:
This fix requires editing your SystemUI.apk file. If you are using one of the fine custom ROMs on XDA, be aware that the you or the author may have already made changes to the SystemUI.apk file, so using my file IS NOT RECOMMENDED.
If you are using Calk's E4GT 2 v1.6 ROM, you can safely use my attached SystemUI.apk file. It may work with other "stock-ish" ROMs, but this is the one I based it on. The attachment will NOT work on stock FF18.
This mod relies on the assumption that your ROM developer has not deleted any of the 1x graphic files in the ROM. The developer CAN theme or otherwise change the images as long as the file names remain the same.
What you need to perform this mod:
1. An Epic 4G Touch ROM ZIP file, or a phone running a Epic 4G Touch ROM -- AOSP ROMs already have the correct indicators.
2. The Java SDK -- So you can run Smali.
3. Smali/Baksmali -- So you can decompile/compile the classes.dex file.
4. Android SDK -- To push/pull files from your phone (adb only).
5. Some sort of archive tool (such as WinRAR, 7zip, etc).
5. A text editor capable of editing UNIX-formatted files. I recommend Notepad++, personally.
Ease Of Use Tips: Install Java SDK first, then Android SDK (if you need adb). Download the smali files (smali-1.3.2.jar and baksmali-1.3.2.jar at the time of this writing) to a new "working" folder where we can do our magic.
KEEP A COPY OF YOUR PRE-EDITED SYSTEMUI.APK FILE, just in case!
Instructions:
1a. [If you are using a ROM ZIP File]: Use 7zip/WinRAR/WinZip to open the ROM ZIP file. Navigate to system\app and extract SystemUI.apk to your "working" folder.
1b. [If you want to grab SystemUI.apk from your running phone]: Use adb to pull SystemUI.apk to your working folder. Example: adb pull /system/app/SystemUI.apk C:\Working\SystemUI.apk
To avoid problems, ONLY USE adb to pull/push SystemUI.apk. Phone apps may cause unknown issues.
2. Go to a command prompt in your "working" folder and run the following command: java -jar baksmali-1.3.2.jar -o SystemUI/ SystemUI.apk
3. Browse to your "working" folder and see that there is now an SystemUI folder inside, with other subfolders. Browse to SystemUI\com\android\systemui\statusbar\policy.
4. Edit the file called NetworkController.smali with your favorite UNIX-format compatible text editor and look for the following text. The key is to search for .line 751. Edit the line below that is in BOLD.
Code:
.line 751
:pswitch_e8
iget-boolean v3, p0, Lcom/android/systemui/statusbar/policy/NetworkController;->mShowAtLeastThreeGees:Z
[B]if-nez v3, :cond_103[/B]
5. Change that line to say #if-nez v3, :cond_103 (add the # at the beginning to comment it out)
6. Save NetworkController.smali
7. Go back to your command prompt, change to your "working" folder and issue the following command: java -jar smali-1.3.2.jar SystemUI/ -o newclasses.dex
8. If there weren't any errors, go ahead and rename the original classes.dex to classes.old and rename newclasses.dex to classes.dex.
9. Open SystemUI.apk in your favorite archiver (if you closed it earlier).
10. Drag the file called classes.dex from your "working" folder into SystemUI.apk and replace the one already in there.
11. Run the following commands to get the file on your phone:
Code:
adb remount
adb push SystemUI.apk /system/app/SystemUI.apk
adb shell stop
adb shell start
You should hear your bootup sound and then the changes should be instantly applied.
To Test:
1. Dial ##DATA# (##3282#) on your phone.
2. Enter your MSL (can be found by typing getprop ril.MSL from Terminal Emulator or adb shell).
3. Scroll to Others at the bottom of the list.
4. Click on HDR/1X Selection
5. Change from Hybrid Mode to CDMA Only Mode. This puts your phone in 1X only mode.
6. Press OK.
7. Verify 1X icon comes within 30 seconds, if you have service.
8. Repeat steps 4-7, substituting Hybrid Mode for CDMA Only Mode to switch back.
How I found this: The files in ICS are different than Gingerbread. Looking for 1x led me to NetworkController.smali. There is a lookup called mShowAtLeastThreeGees (which I thought was hilarious). There are 6 locations that reference this boolean value. The correct one is the a couple of lines before a reference to DATA_1X. I wish I noticed that earlier as I was commenting out each one at a time until I found the last one, which coincidentally was right before DATA_1X. That's what happens when you've got too many things going on at once.
Please let me know whether or not this worked for you. I'd like to make a list of ROMs (with applicable mods) this works for or doesn't work for.
I will do whatever I can to help if you are struggling. If there's something you don't understand, please let me know. I can update the instructions if I accidentally wrote something wrong.
Great work once again
Sent from my SPH-D710 using Tapatalk 2
Finally!!! I will give it a go right now... mShowAtLeastThreeGees - that IS pretty funny. I guess Google programmers do have a sense of humor.
EDIT: Works like a charm. Here's modded SystemUI.apk from Calkuin's newest FE22 ROM, for those who don't want to mess with SMALI edits.
Awesome work! Now help us find where they've buried the lines to hide AM/PM in there
datajosh said:
Awesome work! Now help us find where they've buried the lines to hide AM/PM in there
Click to expand...
Click to collapse
i'll +1 that. Its one of the main reasons I can't stand TW.
nice work
Thanks Nivron. Here is the systemUI.apk for the stock deodexed rom.
Nice work.
Haven't tested it just yet but it looks like they changed it from line 752 to 751 in FF02 for anyone wanting to make the change in the latest build.
Is it possible for someone to update this for the new FF02 build?
DevalB said:
Is it possible for someone to update this for the new FF02 build?
Click to expand...
Click to collapse
Here it is for stock FF02.
dtm_stretch said:
Here it is for stock FF02.
Click to expand...
Click to collapse
To install, I just ADB push?
DevalB said:
To install, I just ADB push?
Click to expand...
Click to collapse
Yeah, or you can use a file explorer and drop it in system/app, then reboot.
dtm_stretch said:
Yeah, or you can use a file explorer and drop it in system/app, then reboot.
Click to expand...
Click to collapse
I tried dropping it into system/app, which caused the device to lock up and FC systemui. I did a battery pull, and now I'm left with no UI icons, etc.
I think it's due to no space left in my /system/ folder. I deleted the failed install of S-voice, which cleared up 20MB, and now it works!
---------- Post added at 04:59 PM ---------- Previous post was at 04:46 PM ----------
So I tried changing my mode from Hybrid to CDMA only, and waited about a minute, and my device stayed on 3G. I even rebooted just to be sure.
Thoughts?
I downloaded the modified FF02 systemui.apk file, and used ES File Explorer to paste it into /systemUI/app/, after backing up (adb pull) the stock systemUI.apk
DevalB said:
I tried dropping it into system/app, which caused the device to lock up and FC systemui. I did a battery pull, and now I'm left with no UI icons, etc.
I think it's due to no space left in my /system/ folder. I deleted the failed install of S-voice, which cleared up 20MB, and now it works!
---------- Post added at 04:59 PM ---------- Previous post was at 04:46 PM ----------
So I tried changing my mode from Hybrid to CDMA only, and waited about a minute, and my device stayed on 3G. I even rebooted just to be sure.
Thoughts?
I downloaded the modified FF02 systemui.apk file, and used ES File Explorer to paste it into /systemUI/app/, after backing up (adb pull) the stock systemUI.apk
Click to expand...
Click to collapse
Are you stock and deodexed? Also have you tried changing the permissions of systemUI.apk to match the other apks in system/app?
dtm_stretch said:
Are you stock and deodexed? Also have you tried changing the permissions of systemUI.apk to match the other apks in system/app?
Click to expand...
Click to collapse
Stock FF02, rooted: http://forum.xda-developers.com/showthread.php?t=1694695
Let me try the permissions, see what it does.
DevalB said:
Stock FF02, rooted: http://forum.xda-developers.com/showthread.php?t=1694695
Let me try the permissions, see what it does.
Click to expand...
Click to collapse
That isn't deodexed and this is a smali edit, so I don't think it will work.
Sent from my SPH-D710 using Tapatalk 2
dtm_stretch said:
That isn't deodexed and this is a smali edit, so I don't think it will work.
Sent from my SPH-D710 using Tapatalk 2
Click to expand...
Click to collapse
You can use a odex rom and with root explorer delete both SystemUI files and replace it with the SyetemUI.apk posted in this thread, it will work I have tried it.
now I'm assuming that you can do the same thing if you know how to take out the systemUI from your odex rom and deodex it and then do the mod.
OP updated for FF18, small change (.line 752 to .line 751). Note that the attachment is still for Calk's E4GT 2 v1.6 ROM and won't work right with FF18.
Deodexed FH13
Here it is for FH13 Deodexed

[Tutorial] Decompiling-Compiling-Editing APKs

Hello guys. I'm creating a thread with a simple tutorial of how to decompile, compile, edit apks. I've seen some threads about it, but all of them were very complicated to understand. It's a simple tutorial, not designed to really mess with apks, just to edit a bit, like swapping icons, images, etc. When I get some more time, I will also teach how to mess with some CM9 Theme Chooser APKs
First of all, what you are going to get with this?
1. Decompile APKs
2. Decompiling all files, so you will only get XML [easy to edit], images and SMALI files [in most cases]
You need to know...
1. Works only Windows [x86 or x64] [You can try on linux, but you will need to download other files of apktool. But the steps are almost the same]
2. Choose the .bat of your version. [x86 = 32 bits] [x64= 64 bits]
3. You need JRE
4. Attached, the most updated apktool.
Let's go...
STEP 1 - preparing
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
1. I've optimized the files to run at D:\apktool [Another partition]. So, extract the .7z, and make sure that there's a apktool folder at the ROOT of D:\ drive. If you want to put this folder at other place, please pay attention: open the Run [x??].bat on the notepad. If you want the folder at the C:\ drive, delete the "D:" line, and swap the directory to the one you choose. [Example: "C:\Users\....user name....\Desktop"] Just make sure you included the cd before the path. If you want the folder at other place on D:\ drive, just change the directory [Example: "D:\Desktop"], and again, with the "cd" command before the path.
STEP 2 - still preparing...
1. Get framework-res.apk from your ROM [if you are on a Samsung ROM, also get twframework]
2. Extract framework-res.apk here
3. Open the correct .bat of your Windows version
4. Run this command: "apktool if framework-res.apk" [if you are on a Samsung ROM, also do with the other framework]
STEP 3 - now decompiling
1. Now, put the apk you want to edit on your apktool folder.
2. Run this command: "apktool d APK-NAME.apk
3. You may get NO errors when it's done.
4. The out put folder is the folder of the decompiled apk.
STEP 4 - now compiling
1. Run this command: "apktool b APK-NAME" [without the .apk]
2. You may get NO errors when it's done.
3. The output APK is located on \[apktoolfolder]\APK-NAME\dist
STEP 5 - optimizing
1. Sign your APK with this
2. Zipalign your APK with this. You can also use zipalign scripts on your ROM to zipalign.
3. Now you may install your apk normally. [user app or system app]
__________________________________________________ __________________________________________________ ___________________________________________
TIPS
1. You can edit .smali files with Notepad ++
2. You can also edit XML files on the Notepad [Windows notepad. I think that with Notepad ++ also works]
3. Soon, I'm going to teach how to edit CM9 Theme Choose APKs. You will be able to: theme non-themed apps, and replace images.
4. I tried to be the most clear and direct as possible. If something is unclear, tell me now. If you have any suggestions to make the tutorial better, please tell me...
reserved...
reserved too...
i reserved it, becouse i was trying it out, and i wanted to be one of the first post here, great tut, lika charm
android_isda_**** said:
RESERVED
Click to expand...
Click to collapse
??
Hi can you help me with this apk? http://forum.xda-developers.com/showthread.php?t=1738252
VasyleTheBest said:
Hi can you help me with this apk? http://forum.xda-developers.com/showthread.php?t=1738252
Click to expand...
Click to collapse
This is a lot harder. Can't do this for you. This isn't playstation2 with it's football games. Sorry. If you still want to try, decompile and search for images to replace.
Hi,
a question here:
I was succefull to theme system apps, but when I try to theme a normal, it never works. all the processes goes fine, but when i eant to install modified apk it gives error. and even when I copy it to /data/app/ it disappear from app drawer.(after restart of course)
sam5154 said:
Hi,
a question here:
I was succefull to theme system apps, but when I try to theme a normal, it never works. all the processes goes fine, but when i eant to install modified apk it gives error. and even when I copy it to /data/app/ it disappear from app drawer.(after restart of course)
Click to expand...
Click to collapse
I think you forgot to sign. Sign, and after you do, go back here and tell what error are you getting
i always got an error compiling systemui, can you help me?
edit:
found a solution using ics apktool here
http://forum.xda-developers.com/showthread.php?t=1558171
marcellocord said:
I think you forgot to sign. Sign, and after you do, go back here and tell what error are you getting
Click to expand...
Click to collapse
Wow, thanks it worked. But why system apps don't need to be signed?
Sent from my GT-I9100 using Tapatalk 2
First: Great Job
Second 2 Questions.
Is it not easyer to editing in .java (with dex2jar tool) then in smali?
For beginners is it not a little bit easyer to use "Apk One Click" for de- and recompile .apk (include the dex2jar Tool) ?
sam5154 said:
Wow, thanks it worked. But why system apps don't need to be signed?
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
They can still work.
$wissdroid said:
First: Great Job
Second 2 Questions.
Is it not easyer to editing in .java (with dex2jar tool) then in smali?
For beginners is it not a little bit easyer to use "Apk One Click" for de- and recompile .apk (include the dex2jar Tool) ?
Click to expand...
Click to collapse
Thanks. When you decompile, it will turn a lot of files into .smali files. Those smali files are very easy to modify on Notepad++. But I'm going to study more about dex2jar.
I had write before a Month or Two, A decompile Tutorial for German Users:
When you need some Pictures for your Tutorial, you Can find it: Here
thank you marcellocord
it works very well.
good job

[PC-APP] GalaxyS3 Mod Tool

I made this tool originally for SonyEricsson Xperia X10, but have now modified it to work for our Samsung Galaxy S3. I hope it will make life a little easier when modifying files on the device. It uses ADB to pull and push files, change file permissions and much more - so users don't need to remember long command prompt/terminal emulator commands! It also has a nifty little application manager, which allows for quick installation, backup, and removal of both pre and self -installed software. It has a LogCat function to read and save logs on the go when investigating errors, as well as functionality to decompile/recompile APK, JAR and ODEX files, sign and zipalign APKs, and decompile System images. ADB Shell will be released in v0.6.2.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Instructions:
1. Extract archive.
2. Install LinuxReader to GalaxyS3ModTool\tools\LinuxReader.*
3. Run GalaxyS3ModTool.jar
*This step is only needed for the Decompile System function in the ROM Manager.
Note: Make sure your phone is connected in debug mode, you have root privileges, and unsecured your device's shell. The application will try to unsecure your shell if you haven't already, but worst case scenario you might have to do this manually.
Also, the manage ROMs functionality is still experimental, and the Recompile System function is disabled. If you know how these processes can be automated, let me know and I will incorporate the functionality.
If you have problems, let me know and I will try to sort them out with you. Keep in mind that often when a modification goes wrong, you can simply push back the original files and reboot. So keep backups handy!
Reserved in case of future expansions.
Reserved in case of future expansions.
Thank you!
I'll finally be able to modify the ODEX files :victory:
Is it possible to recompile an ODEX file to .odex (not .jar)?
Great tool
Thanks!!!
Great tool. Looks very promising
Sent from my GT-I9300 using Tapatalk 2
Saleen NS said:
Thank you!
I'll finally be able to modify the ODEX files :victory:
Is it possible to recompile an ODEX file to .odex (not .jar)?
Click to expand...
Click to collapse
Yes modifying ODEX:ed filesystems has become a breeze Just remember to remove the original *.ODEX file from your system if you incorporate it into its associated APK or JAR.
As ODEX is a device-specific format, compiled to be most effective on specific hardware, recompiling with baksmali to *.DEX and renaming to *.ODEX is not enough. I don't know of any way to recompile to proper *.ODEX, but I mean it has to be possible, and if anyone knows how - please drop a line here or PM me. However the rule of thumb is to not decompile and incorporate the *.ODEX unless smali-code is being edited. This will allow you to keep the efficiency of the original *.ODEX file, and just replace the APK or JAR - i.e. having no negative effect on performance.
EDIT: Realized there is a way to recompile to *.ODEX on the device via the dexopt binary. Working on implementing the functionality.
Thanks for your work!
Warren87 said:
Thanks for your work!
Click to expand...
Click to collapse
shahed26 said:
Great tool. Looks very promising
Sent from my GT-I9300 using Tapatalk 2
Click to expand...
Click to collapse
SETdown said:
Great tool
Thanks!!!
Click to expand...
Click to collapse
Great to hear you guys like it!
I've got version 0.6.1 in testing now, with proper ODEX recompilation functionality incorporated. Will upload it soon.
Unable to run d App!
I downloaded d files & followed above instructions...but clicking on GalaxyS3ModTool.jar opens the archive! What am i doing wrong?
Very promising tool! I will test in weekend and give a feedback!:good:
Mr.Mefisto said:
Very promising tool! I will test in weekend and give a feedback!:good:
Click to expand...
Click to collapse
Good stuff! Looking forward to that.
harryS2 said:
I downloaded d files & followed above instructions...but clicking on GalaxyS3ModTool.jar opens the archive! What am i doing wrong?
Click to expand...
Click to collapse
Do you have Java installed?
harryS2 said:
I downloaded d files & followed above instructions...but clicking on GalaxyS3ModTool.jar opens the archive! What am i doing wrong?
Click to expand...
Click to collapse
Java must be installed on your PC and .jar files associated with java.
Sent from my GT-I9300 using xda premium
Thnx this is what i need.
Works great.
Version 0.6.1 is now uploaded in first post!
Updates:
I have implemented proper ODEX recompilation functionality. However, it requires the device to be connected as the operation has to be performed from within the system and then pulled back out. The tool will let you know when to connect your phone. For the process to be possible, a wrapper for the binary dexopt needs to be pushed to /system/bin - so this is also done programatically.
Some user prompts have been added to make human mistakes less likely. For example if you say you want to decompile an associated ODEX file, you must also specify the framework directory - or nothing will happen.
A fancy automagic script has been added for JAR-decompilation. It turns out since the dex-optimizing of ROMs, some JAR-files don't include a classes.dex file anymore, which makes baksmali.jar cough up errors. But recompiling the ODEX file as classes.dex and inserting it into the JAR makes it decompile properly - so this is what the script has automated when it recognizes the situation.
I have actually rewritten most of the decompilation/recompilation code to execute more efficiently. When time flies and inspiration runs amok, this sadly results in djungle-code. So I had to clear everything up into reusable functions so that nothing is repeated or unnecessary slow.
Happy modding folks!
ADB Shell has been implemented in the coming version. Screenshots updated in first post.
Wow, what a quite bunch
Version 0.6.2 is uploaded in first post.
Changelog:
ADB Shell functionality implemented
Some bug fixes
Fantastic work!
If anyone notices this tool working on another device - please post the device name here with any related problems. I'm looking into extending the device support for this tool.
This tool is very convenient .. I used it for the nexus 7 with firmware 4.1.2
too bad that does not work with 4.2, we look forward to updates
still great

FMRadio FM2 Lineage-16/AOSP themed

Since we don't have the newer FM Radio App in lineage-16 and because I don't like the "old" FM2, I recolored it for my needs
I made two flashable packages, one is the new themed FM2 and the other is the Stock FM2, if You don't like it.
INSTALLATION:
Reboot to installed TWRP
Mount ---> Select System
Install package
Reboot
Tested on my lineage-16 (20190530), might work on other AOSP Pie Roms with FM2.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
zitronenmelissa said:
Since we don't have the newer FM Radio App in lineage-16 and because I don't like the "old" FM2, I recolored it for my needs
I made two flashable packages, one is the new themed FM2 and the other is the Stock FM2, if You don't like it.
INSTALLATION:
Reboot to installed TWRP
Mount ---> Select System
Install package
Reboot
Tested on my lineage-16 (20190530), might work on other AOSP Pie Roms with FM2.
Click to expand...
Click to collapse
does it have RDS info ??
boe323 said:
does it have RDS info ??
Click to expand...
Click to collapse
It's the older FM Radio APP used in CM11/CM12 too, I never had RDS with it.
I guess the newer lineage/CyanogenMod FMRadio APP since CM13 has RDS?
Is it works with stock oreo?
I have TWRP installed on my phone...
No, I don't think so. These is for Pie Roms and fmradio lib should be enabled in kernel and "libqcomfm_jni.so" should be in /system/lib64. But it's always worth a try remember to backup files, that will be overwritten, "libqcomfm_jni.so" is attached, extract from zip file (rw-r-r in /system/lib64)
zitronenmelissa said:
Since we don't have the newer FM Radio App in lineage-16 and because I don't like the "old" FM2, I recolored it for my needs
I made two flashable packages, one is the new themed FM2 and the other is the Stock FM2, if You don't like it.
Click to expand...
Click to collapse
Hi, do you have a version Black themed? or can you tell me how did you themed it? did you used android studio or others way? Thanks
simone81 said:
Hi, do you have a version Black themed? or can you tell me how did you themed it? did you used android studio or others way? Thanks
Click to expand...
Click to collapse
I use apktool:
extract FM2 and framework-res.apk from Your rom
apktool if framework-res.apk
apktool d FM2.apk
Important files are /res/values/color.xml and some in /res/drawable
Color is written in hex color code with transparency ahead: #ff000000 is black #ffffffff is white for example.
You can decompile my file and for Your needs it will be enough to edit /res/values/color.xml
Recompile: apktool b FM2 and don't forget to put Original META-INF folder and AndroidManifest.xml back in new compiled FM2.apk in /dist folder (I use 7zip Archive Manager to do that)
I'm actually on latest Stock Rom, but I can try later to make a dark version.
simone81 said:
Hi, do you have a version Black themed? or can you tell me how did you themed it? did you used android studio or others way? Thanks
Click to expand...
Click to collapse
zitronenmelissa said:
I use apktool:
extract FM2 and framework-res.apk from Your rom
apktool if framework-res.apk
apktool d FM2.apk
Important files are /res/values/color.xml and some in /res/drawable
Color is written in hex color code with transparency ahead: #ff000000 is black #ffffffff is white for example.
You can decompile my file and for Your needs it will be enough to edit /res/values/color.xml
Recompile: apktool b FM2 and don't forget to put Original META-INF folder and AndroidManifest.xml back in new compiled FM2.apk in /dist folder (I use 7zip Archive Manager to do that)
I'm actually on latest Stock Rom, but I can try later to make a dark version.
Click to expand...
Click to collapse
Thanks so much for the explanation!!! i can try following your guide..... but im not sure to be able to modify color because im not good with the steps you wrote... By the way, if you can make a black version i would be very happy :fingers-crossed:
simone81 said:
Thanks so much for the explanation!!! i can try following your guide..... but im not sure to be able to modify color because im not good with the steps you wrote... By the way, if you can make a black version i would be very happy :fingers-crossed:
Click to expand...
Click to collapse
I can try. What about ... whats blue will be grey, whats grey will be black?
zitronenmelissa said:
I can try. What about ... whats blue will be grey, whats grey will be black?
Click to expand...
Click to collapse
Wow, It is perfect!! I like your color idea!!
I did try to follow your way to change the color file with notepad .... but i think i did a mistake when i have to zip together with Androidmanifest and the folder META-INF ( which have inside 3 files: CERT.RSA , CERT.FS, MANIFEST.MF) instead of your version That have a folder META-INF --> com-->google-->android-->and here 2 files : updater-script and update-binary).
Then i miss also the folder named system--> app -->FM2 with apk inside. <--- But i think this folders i have to create.
I made a try but doesnt work.... and i see my radio.zip ( i made so many try) is too small compared with yours.... ( more than 1mb, mine about 650kb)
So im sure i did miss some step or i did something wrong....
Thanks again to helping me :fingers-crossed:
View attachment RadioFm.zip
simone81 said:
Wow, It is perfect!! I like your color idea!!
I did try to follow your way to change the color file with notepad .... but i think i did a mistake when i have to zip together with Androidmanifest and the folder META-INF ( which have inside 3 files: CERT.RSA , CERT.FS, MANIFEST.MF) instead of your version That have a folder META-INF --> com-->google-->android-->and here 2 files : updater-script and update-binary).
Then i miss also the folder named system--> app -->FM2 with apk inside. <--- But i think this folders i have to create.
I made a try but doesnt work.... and i see my radio.zip ( i made so many try) is too small compared with yours.... ( more than 1mb, mine about 650kb)
So im sure i did miss some step or i did something wrong....
Thanks again to helping me :fingers-crossed:
View attachment 4779785
View attachment 4779786
Click to expand...
Click to collapse
The files from /original in decompiled FM2 folder have to be added to the new FM2.apk in /dist folder. You can open .apk files with 7zip too, because it's an advanced .zip file. The META-INF folder and the AndroidManifest.xml are necessary files in .apks.
The META-INF folder in flashing .zip files contains flashing script and binary to flash to correct directory for example.
You can use my FMRadio-themed.zip file as a template, if You want to. Just replace the FM2.apk in /system/FM2 folder.
I made a dark version, but it's a blind edition, could not test it on stock ROM, but it should work.
Structure of the .zip file for flashing:
/META-INF/com/google/android/update-binary
/META-INF/com/google/android/updater-script
/system/app/FM2/FM2.apk
Structure of FM2.apk:
/META-INF/CERT.RSA
/META-INF/CERT.SF
/META-INF/MANIFEST.MF
/res/...
AndroidManifest.xml
classes.dex
resources.arsc
Good luck
zitronenmelissa said:
The files from /original in decompiled FM2 folder have to be added to the new FM2.apk in /dist folder. You can open .apk files with 7zip too, because it's an advanced .zip file. The META-INF folder and the AndroidManifest.xml are necessary files in .apks.
The META-INF folder in flashing .zip files contains flashing script and binary to flash to correct directory for example.
You can use my FMRadio-themed.zip file as a template, if You want to. Just replace the FM2.apk in /system/FM2 folder.
I made a dark version, but it's a blind edition, could not test it on stock ROM, but it should work.
Structure of the .zip file for flashing:
/META-INF/com/google/android/update-binary
/META-INF/com/google/android/updater-script
/system/app/FM2/FM2.apk
Structure of FM2.apk:
/META-INF/CERT.RSA
/META-INF/CERT.SF
/META-INF/MANIFEST.MF
/res/...
AndroidManifest.xml
classes.dex
resources.arsc
Good luck
Click to expand...
Click to collapse
Thanks so much zitronenmelissa, i really appreciate your time for helping me, even if i could not see any changes. I tryed to flash using twrp, with original app, but no luck, then i tried hibernate ( deactivating) the original radio app and installing the zip, but nothing changed. In the end i uninstalled the original radio app and flash again your .zip but once again no luck.
Its strange, because im on Pixel experience now but before i was on RR Rom....
At least you helped me learning a little more about this apktool.
Thanks
simone81 said:
Thanks so much zitronenmelissa, i really appreciate your time for helping me, even if i could not see any changes. I tryed to flash using twrp, with original app, but no luck, then i tried hibernate ( deactivating) the original radio app and installing the zip, but nothing changed. In the end i uninstalled the original radio app and flash again your .zip but once again no luck.
Its strange, because im on Pixel experience now but before i was on RR Rom....
At least you helped me learning a little more about this apktool.
Thanks
Click to expand...
Click to collapse
Did You mount System first via twrp? In twrp ---> Mount ---> check on System? Otherwise it won't install to system ....
zitronenmelissa said:
Did You mount System first via twrp? In twrp ---> Mount ---> check on System? Otherwise it won't install to system ....
Click to expand...
Click to collapse
No, i didnt know. Thats why it does not work. But now IT WORKS :victory::victory::victory:
Thanks really so much, i like the color :good:
Would You please make screenshots for the thread how it looks? I couldn't test it on stock Rom ...
zitronenmelissa said:
Would You please make screenshots for the thread how it looks? I couldn't test it on stock Rom ...
Click to expand...
Click to collapse
Sure, I can also post "my version" where i inverted your color theme.... the rds info are pretty easy to be readed . ( if you want i can post my .zip file)
This is your version:
This is my version:
I was wondering if were possible to change the white text radio info, into for example green.... I coded the color.xml and the station_info.xml, but i got an error if i only change the string white into green :
TextView android:textSize="16.0sp" android:textStyle="bold" android:textColor="@android:color/green" <-- instead of white
simone81 said:
Sure, I can also post "my version" where i inverted your color theme.... the rds info are pretty easy to be readed . ( if you want i can post my .zip file)
This is your version:
This is my version:
I was wondering if were possible to change the white text radio info, into for example green.... I coded the color.xml and the station_info.xml, but i got an error if i only change the string white into green :
TextView android:textSize="16.0sp" android:textStyle="bold" android:textColor="@android:color/green" <-- instead of white
Click to expand...
Click to collapse
WOW :good: I like Your ideas, very good. Thank You for the screenshots
You can also use every hex8 color:
android:textColor="#ff00ff00" is green
Here You can generate Your color codes:
http://www.colorscodes.com/color-code-hex/00ff00
Works on LG G2 D802 with LineageOS 18.1? Thk
When I installed it through TWRP on my Samsung Galaxy S N7000 with Lineage OS 16 - there is no any icon for this radio, but in system\system I see FM2.apk
Why?

Categories

Resources