[Q] Change Service Provider Name in Notification Bar - Motorola Triumph

I was wondering if anyone knew how to change the name of the service provider from "Virgin Mobile" to whatever i want. (Like my name for instance.) I have already tried changing the build.prop file and it didn't work. The app "Carrier Name" doesn't work. I tried extracting the framework.apk and going deeper to the eri.xml and changing the provider name to something else but "Virgin Mobile" wasn't even there. Also in cdma workshop changing the banner doesn't do anything and the banner isn't even "Virgin Mobile" which it should be. I have tried other forums with no success and i'm hoping a dev can help. Yes i am rooted.

x2 would also like to know how to change that name to something else..

Self-bump for hope

QPST didn't work.

Ya i forgot to mention I also tried QPST with no luck.

under CDMA carriers I believe if you edit the framework-res.apk/values/strings.xml you can change something like zz_nationalRoaming_Carrier=Virgin Mobile
i know it sounds weird, roaming, but check it out....
I've been trying to accomplish this on GSM phones but they pull the variable from the sim card.... if you can simply change the txt value in framework-res.apk/layout/keyguard_screen_lock.xml then maybe that would work?
You need to change it from something like android:id="@id/carrier" whatever it says;
to android:text="custom" or whatever that is... (Open up eclipse and check out a basic text fields layout.xml so that you can use that as a guide if you need to...)
I'll check it out soon; it's something I intended to do for a guy.. I just don't personally own the triumph this worked great on Samsung Moment... but it was android 2.1 ....

I was so excited when I saw your post! But then I became bummed again as I saw that I don't have a "values" folder on my triumph's framework-res.apk. The three folders that I have as I open the .apk are "assets", "META-INF",and "res." I have attached a picture to show you what I mean. Thanks for the effort. Keep me updated.

Don't extract it... use apktool,
it needs decompiled... (if you use root explorer or something you can't see the correct text either)
-- Please be ready to recover your rom before trying this you may have a bootloop if you forget to fix permissions etc... ---
Windows instructions
Place framework-res.apk in your c:\ in a new folder called frame (or wherever);
example will use c:\frame\
Put apktool and aapt in \frame; (I will try to find something to attatch sorry i'm on my lunch break @ work)
C:\frame\framework-res.apk
C:\frame\aapt.exe
C:\frame\apktool.bat
C:\frame\apktool.jar
Open command prompt as administrator (open start menu type cmd right click it hit run as administrator)
In this prompt type cd\frame (Or wherever you put those files)
Run this;
apktool d framework-res.apk
this will extract all files to C:\frame\framework-res\
Check then for your values folder, you should see tons... just worry about Values. the rest are locales... (languages,, if it fails maybe try values-EN?)
Once you're done you can run apktool b framework-res and it will build the contents of the c:\frame\framework-res\ folder into C:\framework-res\dist\framework-res.apk
now you have to put this file in your /system/
you can get it there via the phone if you have issues I will try to help for now here are adb instructions:
adb remount
adb push c:\frame\framework-res\dist\framework-res.apk /system/framework-res.apk
adb shell chmod 644 /system/framework-res.apk
This may or may not work again I'm on my lunch sorry...
report back i'll stay active here;
I don't own a triumph but my buddy does so I can't test much
I am learning this stuff too but I have spent some time with it so i'd be more than happy to share; likewise i'd love anyones help learning aswell.... that's actually what brought my attention to this triumph; =D
edit; btw i'll see if i can't test this realtime tonight I had heard that 7zip is fine for framework-res but I think that was for the GFX themeing not for the xml editing? I dont' know, I apologize if you got stuck on my guide however I will work with you to make it through it

Thanks man. I appreciate your write up. I will try it today after school and get back to you on the results.

You may have an issue in adb, i noticed that I was unable to get the device to pick up in ADB ... I rebooted the phone and noticed that the device manager picks up the Android ADB Interface for a minute, but as it finalizes boot it drops it...
Perhaps I just have driver issues but it seems like a start up script is runing the command stop adbd
Anyway if that's the case we need to remove the stop adbd command from the startup scripts;
Anyways; if you can't get ADB USB drivers maybe w/ your root access you can set it up on wifi? connect to wifi and run
(From phone terminal)
setprop service.adb.tcp.port 5555
stop adbd
start adbd
(From PC)
adb tcpip 5555
adb connect IPADDRESS:5555 -Note that i mean the ip address to the phone on wifi)
then if it's successful you should be able to adb remount adb push framework etc...
remember to chmod or you WILL bootloop.

I was able to successfully follow your guide up until when i (try to) compile with the apktool b framework-res command I get this:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
The new and improved .apk never gets made because of this error. I google searched and tried to find a solution for at least an hour with no luck. I would just like to thank you in advance for all of your help.

I was able to successfully follow your guide up until when i (try to) compile with the apktool b framework-res command I get this:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
The new and improved .apk never gets made because of this error. I google searched and tried to find a solution for at least an hour with no luck. I would just like to thank you in advance for all of your help.
EDIT: It posted twice for some reason!? Weird

i'll take a look i believe it it's entirely because of what version of APKtool I submitted (perhaps a bad one, sry...) I'll get the framework from the system dump in the other thread and try it out

Ok thanks a lot man.

Wow I joined in 2008 and got my first thanks; yet I went to reply and thanked you for saying thanks!
Hahahah, no but for real it's cool cause thanks for trying; fyi i was able to compile okay...
I found apktool.yml or whatever, but it's supposed to be in the decompiled folder... when you recompiled are you doing it like this?
apktool d framework-res.apk
apktool b framework-res (NO .apk it is the FOLDER you are targetting)
I will test my rebuilt framework, this is what I changed;
<string name="roamingText1">Virgin Mobile</string>
to
<string name="roamingText1">Ryan S.</string> (The guys name.)

You guys what you have to edit is the line "zz-roaming text 1" just editing this one will change them all. (Lockscreen and notification bar) as for the tool to decompile the framework-Res.apk I recommend apk manager. It is the easiest to use. (Note to newbs) with apk manager you don't have to remember command prompt codes
Sent from my MOTWX435KT using XDA App

I found no zz in it, was the problem... several zzz but no zz roaming
anyway i should forwarn that my framework-res.apk broke the guys phone i restored it and we're good but looking at the files they're 700kb differences so perhaps apk manager alone will recompile more successfully?
I appreciate the reocmmendation most of the tools I have found so far havn't allowed access to the xml files just the pngs, or not all of the contents of the apk (not decoding them)
I'll try apk manager and report back soon.

I've never tried apk tool, I may try this once someone does it successfully so I'll be watching. I don't know how to backup my phone so I'm wary of tinkering.

using apk tool
From my own experience I find that apk manager can sometimes be tricky to use. And sometimes when you recompile the first time it doesn't work properly. If it doesn't work the first time try it again. Ill try doing this when I can get to my computer. BTW make sure you import the old files and delete whichever one you changed. That's where it can get tricky

the current issue i'm having is that the apk file made is like 6-800kb smaller and all i didwas remove ascii,
i'll test it when i can though sorry

Related

[Guide] Hacks and mods: Three tutorials for modifying your x10 OS aesthetically

Updated: July 24/2010 Go to the X10 Theme repo for a listing of uploaded themes.
Thanks to everyone that is helping out and contributing. I also apologize if I rip anything off. If I do please post it and I will definitely correct it.
The usual disclaimer goes with this... Use at your own risk and backup your system before making any changes. You know what to do if you run into problems
I think this is important...
Links for various stuff:
framework-res.apk
/system/app/ folder
startup show (boot animation)
Mms.apk
Phonebook.apk
apps2sd-work in progress?
http://forum.xda-developers.com/showthread.php?p=7037044#post7037044
Many visual aspects of the os and system apps can be changed and surprisingly easily. By default when opening an apk you should look around the res-drawable folders for the pngs to edit. If you have noticed, there are some png's that look like xxx.9.png. To modify these files easily, remove the 9 from the filename and open with your preferred editor. When you are done editing the files save them, open the command prompt and type draw9patch. This should open a window with an arrow in it. Drag your file there and I'm pretty sure it goes into the same folder. That's it.
If you are using a mac use betterzip and take a look here.
You can also use root explorer (I havent tried this myself)
Step 1:
Connect phone to pc, enable usb debugging and open adb. Type:
adb pull /system/framework/framework-res.apk framework-res.apk
That will pull your framework-res.apk to whatever folder is displaying in your command line.
Step 2:
Find the framework-res.apk on your hard drive, right click and open with 7zip.
Step 3:
Use png's here or create your own and dump into the appropriate folder within framework-res.apk.
Step 4:
When you are done editing the files open up adb and type the following command:
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb push framework-res.apk /sdcard/framework-res.apk
adb shell dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
That will put the new framework-res.apk on your phone. It should automatically reboot (if not reboot it) and your changes should be applied!
When running the script above you can replace framework-res.apk with whatever you want. For example, Timescape.apk
Remember, it is CASE sensitive I made this problem many times)
If you would like to pull an entire folder put a slash at the end of the last word. For example, adb pull /system/etc /etc"/" (no " in actual script )
Courtesy of corruptfate is the steps to modify the startupshow (post #207)
step 1: open adb shell
step 2: type "adb shell"
step 3: type "su"
step 4: type "mount -o remount,rw -t yaffs2 /dev/block/mtdblock4 /system"
step 5: type "mkdir system/etc/semc/startupshow"
step 6: exit and redo step 1 - 4
step 7: type "mkdir system/etc/semc/startupshow/default"
step 8: exit and open command prompt again, this time type "ddms"
step 9: look for the default folder in system > etc > semc > startupshow > default
step 10: push the images into that folder
Possible reasons your phone won't boot after modifications:
images anren't stored properly, right format, right size etc.
unpacked apk improperly, use 7zip, it doesn't mess anything up
you signed the package before pushing it- unless you know what you're doing follow the directions to a tee and you should be fine
pushed the package to the wrong directory, /system/framework-res.apk XX, /system/framework/framework-res.apk
I'm sure many other reasons, these were the only ones I encountered
How to get past boot screen:
Use backup framework-res.apk and push that one to your phone. Remember to place that one where the modified one is.
To see if adb sees your phone type adb devices, if a serial number pops up try pushing your original, if not...
Flash your phone again from scratch . Sorry, I don't know any better way yet.
Please post your themes and download themes from the X10 theme repo
The basics:
http://forum.xda-developers.com/showthread.php?t=502010
http://developer.android.com/index.html
http://developer.android.com/guide/developing/device.html
Some Links:
Notification background color
Status bar clock color
Notification font color
Notification bar shortcuts
Edit 9.png's
Install mobile defense as system app through terminal (I haven't tried this yet)
Resigning apps
http://forum.xda-developers.com/showthread.php?t=549109
http://androidforums.com/developer-101/8665-how-signing-roms.html This is the one I have been using. I just noticed its for roms
http://code.google.com/p/android-apktool/ Figured it out but no need for it as of yet
How to modify notification background colors
Some of the files; not sure which is the top band displaying carrier(semc_avctivity_title.9.png??):
statusbar_background.png
status_bar_background.png
status_bar_close_on.9.png
status_bar_header_background.9.png
status_bar_item_background_normal.9.png
They should be in res/drawable-240dpi. Once you find them open them and modify as you wish. Once completed save your changes.
Getting FLAC working, I was wrong, mixed up file folders. Apparently meridian pioneer works. Havent gotten a chance to test for sure yet. I am now trying to manually add flac support to mediascape
Second tutorial: Busting open apks so you can edit xml's!!
So has anyone tried opening up an xml file on their phone to edit only to find incoherent coding. Well I have. So I have stumbled upon a tool called apktool. The tool somehow breaks down the apk into readable xml files. I haven't gotten so far as to test out an edited xml because I wanted to post this so I don't forget how to do it.
1. follow instructions on installing apktool. Unzip the files into your android-sdk-windows/tools folder
2. Put a copy of your framework-res.apk into the same tools folder
3. from command type: java -jar apktool.jar if framework-res.apk
4. Put whatever apk you want to edit into tools folder and type this: java -jar apktool.jar d xxx.apk
5. Look in your tools folder and voila there will be a folder named with whatever apk you worked with.
Third tutorial: Use smali/baksmali to edit services.jar and services.odex
1. follow instructions on downloading and installing smali/baksmali
2. pull these files from your phone and place them into the same folder as smali (should be android-sdk-windows\tools):
code.odex
ext.odex
framework.odex
android.policy.odex
There may be other ones needed that Im missing so if you find this out please let me know
3. place the odex you want to modify into the same folder (android-sdk-windows\tools)
4. from the command line type java -jar baksmali-1.2.3.jar -x services.odex
your pc will work a little bit and when its finished will just show your directory again.
5. minimize that screen and go into the folder you put everything in there should be an out folder. Open it up and all the files to edit will be there!
I haven't recompiled yet but when I do Ill finish this tutorial.
COMMON PROBLEMS:
These are some problems I ran into because I am a noob. I figure it may help a couple people out
1.unable to access apktool.jar/baksmali-1.2.3.jar
Im pretty sure you are in the wrong directory
from the command line type: cd C:\whatever\directory\leadsto\android-sdk-windows\tools\the.jarfileyouaretryingtoaccess
2....
Modification requests:
Custom boot screens-- find your startupshow folder=== SOLVED
custom response to invalid password
Ad hoc support
Disable slide lock
App drawer categorization=== THERE'S AN APP
map hardkeys
cool, gonna try and change the battery indicators
I was able to replace framework-res while the phone was running, but now the phone wont boot.. good thing I made a backup of the original one
xxsashixx said:
I was able to replace framework-res while the phone was running, but now the phone wont boot.. good thing I made a backup of the original one
Click to expand...
Click to collapse
Thats where I'm stuck too. Did you resign the package after modifying it? Im going to try that in a bit.
Does anyone know of a good n00b guide to emulating our phone in eclipse?
@microkiwi can you post how it went?
I did make some new icons in PS, but unfortunately I wasn't able to boot the phone after pushing my new files to it
I also tried to sign it with the autosign (testsign.java) application but no luck...
mikrokiwi said:
I did make some new icons in PS, but unfortunately I wasn't able to boot the phone after pushing my new files to it
I also tried to sign it with the autosign (testsign.java) application but no luck...
Click to expand...
Click to collapse
Cool thanks, hey have you seen an app called metamorph? I just noticed it right now but it seems like stericson automated and simplified the process. Heres a link
http://forum.xda-developers.com/showthread.php?t=591329
Have you tried that app yet?
Yes, I have made a metamorph theme now and everything seems fine, the theme shows up and I can apply it and everything.
But after reboot the phone is still using the old icons
Any other metamorph themes that we can install?
I think for 1.6 only
gavriel18 said:
http://code.google.com/p/android-apktool/ Looks cool I just wish I knew how to use it
Click to expand...
Click to collapse
Apktool is just for everything else but signing ;-)
mikrokiwi said:
Yes, I have made a metamorph theme now and everything seems fine, the theme shows up and I can apply it and everything.
But after reboot the phone is still using the old icons
Click to expand...
Click to collapse
Could you please upload the theme, I'd like to learn how theming works. In the AndroidThemes thread I found only themes for custom roms. THX !
mikrokiwi said:
Yes, I have made a metamorph theme now and everything seems fine, the theme shows up and I can apply it and everything.
But after reboot the phone is still using the old icons
Click to expand...
Click to collapse
Could you please post the .png files from the framework pull? I would like to change the colors and then try to replace them with files in a theme that I found that might work with our phone. The only issue is the resolution of the theme that I had in mind. If this works then we can all make custom themes for our X10 using that theme as a template. Not sure if it will work, but I would like to try.
pietropizzi said:
Could you please upload the theme, I'd like to learn how theming works. In the AndroidThemes thread I found only themes for custom roms. THX !
Click to expand...
Click to collapse
Unfortunately it does not work at the moment, but when I get it to work I will upload it for everyone to use
troyjamz said:
Could you please post the .png files from the framework pull? I would like to change the colors and then try to replace them with files in a theme that I found that might work with our phone. The only issue is the resolution of the theme that I had in mind. If this works then we can all make custom themes for our X10 using that theme as a template. Not sure if it will work, but I would like to try.
Click to expand...
Click to collapse
http://www.mediafire.com/file/kkmhmnyhgyw/framework-res.apk open it with 7zip
Thx man!
mikrokiwi said:
Unfortunately it does not work at the moment, but when I get it to work I will upload it for everyone to use
http://www.mediafire.com/file/kkmhmnyhgyw/framework-res.apk open it with 7zip
Click to expand...
Click to collapse
Tack så mycket!
@microkiwi Thanks for the upload, do you mind if I post that link in the first post?
@brut.all Does it work the same way as autosign? I followed the instructions properly on installing it but when I try to open it a command line pops up for a second (too fast for me to read) and then closes. Am I missing something?
Also do you know if framework-res.apk needs special signing? I'm just trying to figure out why the phone gets stuck at boot after pushing the modified apk.
@pietropizzi I have made one as well it doesn't work but I'll upload it right away. Check out the metamorph thread for some tutorials on theming. It is surprisingly easy.
On another note has anyone gotten to move their apps to the sdcard? I've tried but with no luck..
heres a post I made about it:
http://forum.xda-developers.com/showthread.php?p=7037044#post7037044
Cool ,I'm going to try it tonight. Mind if I add it to the list at the top?
BTW did anyone know mediascape supports wav audio Swwweeeeeetttt

[Q] Custom Phone APK on HERO (CDMA)

hi, this is my first post here on XDA. i've surfed this site for quite a while as an guest and i love the work that's been done here. I am not new to the field of reverse engineering but most of my time has been spent on the x86 world (Windbloze)
my curiosity grew in the reversing of android applications. I've modded a few apps from the Android Market but now i'm wanting to modify my Phone.apk to get rid of a feature i find 'stupid'
every time i make a call the phone vibrates when it connects, and for me that's annoying because i have all features of my phone set to vibrate and i find myself looking at the phone to see if it was a text or something lol.
I am not asking for someone to do this for me, i will post below what i have done and what i've tried to do to get it working and hope someone can guide me along my way.
Pulled Phone.apk from /system/app
Pulled HTC Framework (com.htc.resources.apk) from /system/resources
Installed framework with apktool
decompiled phone.apk
found offending code that causes the vibrate on connect, deleted it
recompiled APK with apktool
resigned it with testsign.jar
pushed to phone using
adb shell stop
adb push
adb shell start
Click to expand...
Click to collapse
Phone.apk crashes and i get no service
now as far as troubleshooting goes i've done a few logcats on startup to see where it's failing
this line appeared intersting to me:
Package com.android.phone has no signatures that match those in shared user android.uid.phone; ignoring!
Click to expand...
Click to collapse
as suggested by another thread (over on modaco) i removed the following bolded portions of the androidmanifest.xml file
android:sharedUserId="(Text removed to obey outside link filter)"
android:sharedUserLabel="(Text removed to obey outside link filter)"
Click to expand...
Click to collapse
trying yet again with the above pushing method i then shutdown the phone and started another logcat... this time i noticed that it changed the Phone.apk's UID from 1001 to some other number and later on in the logcat i see that the package manager is refusing to give the requested permissions to Phone.apk
so starting all over i tried again with the original AndroidManifest.xml I found a thread here on XDA that states that FieldTest.apk and Telephony.apk might need to be signed with the same cert as Phone.apk so I pulled and resigned with testsign (i'm assuming it uses the same key to sign all apks) the TelephonyProvider.apk and FieldTest.apk files along with Phone.apk, pushed them all to the phone and now i'm getting all kinds of FC's...
So here I am, after hours of fighting with my phone asking for some help... if anyone could guide me to the correct way of modifying my Phone.apk file and still maintain service i would be very appreciative.
EDIT: I've also read somewhere that the framework might need to be resigned, but frankly i'm not sure how that could fix the problem, sounds to me it would cause a lot more problems...also i'm aware that there is a cutom Phone.apk v30.x but it specifically states it's not compatible with the HTC Hero

Modifying .xml's that are encoded into resources.arsc

Ok this is a quick little guide. Decided not to put this in the notification text thread as that needs to be cleaned up anyway.
This is for modifying .xml's in say /values or wherever you want. This particular example is going to use /values/styles.xml
First up, decode your framework using apktool
** Make a backup! **
Code:
: adb pull /system/framework/framework-res.apk /sdcard/mytheme/backup.apk
: adb pull /system/framework/framework-res.apk C:\themes\mytheme.apk
: apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
Then open up the /res/values/styles.xml.
Find "<style name="Widget.Button" parent="@style/Widget">
Change the textcolor to #FFFF0000
This will make all buttons have a RED text color.
Click to expand...
Click to collapse
Now re-encode the file
Code:
:apktool b C:\themes\mytheme\decoded C:\themes\mytheme\encoded\mytheme-new.apk
Now, the simplest thing to do is to do the following:
- Open the original C:\themes\mytheme.apk with 7-zip
- Drag and drop the META-INF and AndroidManifest.xml File into a folder, like C:\themes\mytheme\signed
* Now you have a copy you can always use, and skip the above steps after doing it once *
- Open the new encoded mytheme-new.apk with 7-zip
- Drag and drop the META-INF and AndroidManifest.xml from the \signed directory
Click to expand...
Click to collapse
Code:
: adb push C:\themes\mytheme\encoded\mytheme-new.apk /sdcard/mytheme/framework-res.apk
: adb remount (if available for you!)
: adb shell
**Only if remount doesn't work.**
: mount -o rw,remount -t ext3 /dev/block/mmcblk1p21 /system
: cp /sdcard/mytheme/framework-res.apk /system/framework/framework-res.apk
**Wait for the theme to apply, no need to reboot**
**If you Bootloop and stay in shell (which you should if you don't reboot)**
Click to expand...
Click to collapse
Code:
: cp /sdcard/mytheme/backup.apk /system/framework/framework-res.apk
**After this the bootloops should stop as your last stable framework is loaded**
Click to expand...
Click to collapse
That's it!
Questions? Comments? Leave em!
So, for instance, in the Vanilla Froyo theme for 2.1, where all of the text elements that should be a dark grey or black are white, this would allow me to change them?
Yep. Just a matter of figuring out which style controls what...that's next on my list to document lol. It's a LOT easier than trying to Hex Edit everything.
I'm really surprised this thread isn't exploding with questions, but I have to say great work, man!
I'm gonna wait it out until I know my way around the SDK a little more, but I really wanna dig through this and finish the Vanilla theme I'm using.
Thanks! I should make one big guide get it stickied and be fine with it lol. You can check out my vanilla theme fire an idea of what I've done.
Sent from my DROIDX using XDA App
Great tutorial man. I especially appreciate the part about not having to reboot. I wonder why everyone always says to do that for installing themes.
If you use apkmanager (which is a frontend for apktool) -- it automates some of the steps mentioned here. Its in the G1 development section as well as apktool.
Not work...
Very sad
After complete all steps, device not boot after LG lable longer.
Any ideas?
log cmd in process:
Code:
D:\Android\SDKTools\tools>apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...
D:\Android\SDKTools\tools>apktool b C:\themes\mytheme\decoded C:\themes\mytheme\encoded\mytheme-new.apk
[B][COLOR="Red"]W: Could not find sources[/COLOR][/B]
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
phimuskapsi said:
Thanks! I should make one big guide get it stickied and be fine with it lol. You can check out my vanilla theme fire an idea of what I've done.
Sent from my DROIDX using XDA App
Click to expand...
Click to collapse
Phim, you're the best! I have been searching for a simple guide like this, as I found one a while ago when theming, but lost the link. Thanks for all your contributions on here, they are greatly appreciated! If I have some questions on editing some xml files, can I shoot you a PM or two?
Sent from my DROIDX using XDA App
I am trying to edit the color of the text in the drop down notification bar for the text such as USB Connection.
Can someone please tell me which xml file and which portion needs to be edited?
The font color would most likely be in the styles.xml file (in the values folder). I don't know which line exactly but you can take too different color versions and compare the decompiled xml files with word or online and look for differences.
yawdapaah said:
The font color would most likely be in the styles.xml file (in the values folder). I don't know which line exactly but you can take too different color versions and compare the decompiled xml files with word or online and look for differences.
Click to expand...
Click to collapse
Yae, thanks for the info. I found it shortly after posting through trial and error. I think it was in one of the status_bar_latest*.xml
For some reason when I made the esit and recompiled my famework-res.apk I lost adb capabilities and usb-mode and had to revert to a nandroid.
Any ideas on what may have caused this? Only edited an xml file...
Sent from my DROIDX using XDA App
.apk on desktop (adp pull C: [??])
phimuskapsi said:
Ok this is a quick little guide. Decided not to put this in the notification text thread as that needs to be cleaned up anyway.
This is for modifying .xml's in say /values or wherever you want. This particular example is going to use /values/styles.xml
First up, decode your framework using apktool
** Make a backup! **
Code:
: adb pull /system/framework/framework-res.apk /sdcard/mytheme/backup.apk
: adb pull /system/framework/framework-res.apk C:\themes\mytheme.apk
: apktool d -f C:\themes\mytheme.apk C:\themes\mytheme\decoded\
Click to expand...
Click to collapse
Hi there, newbie here (but I've managed to decode all the java and xml, which is fully readable). Only thing I have left is this pesky "resources.arsc" file. I tried using both the xml way and java way, but neither worked, that's when I found your posting. Thanks so much for sharing btw!!
I haven't tried this yet because I'm confused about why you did not put a "C:" in the beginning of the file address to route the command to the folder on your sdcard which contains your .apk.
My .apk will be on my desktop, so, how should my command line look???
Thanks again, hope to here from you.
Ok, I managed to decode everything except resources.arsc. I imported package successfully into eclipse but I have errors. I looked through all XML, which is in English and good, except for the resources.arsc, which is not decoding by methods I'm familiar with. Your method will probably work but I need command prompt spelled out for me (sorry about that).
So, resources.arsc is located: desktop/space/resources.arsc. I'll play around with it an see what happens...

Need someone to compile an APK for me

Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Thanks!!
Here's what I need compiled:
http://mikelierman.com/SystemUI.apk.zip
Click to expand...
Click to collapse
What did you use to decompile it? APK Manager from this thread?
http://forum.xda-developers.com/showthread.php?t=695701
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
0vermind said:
Alright, so I decompiled the apk, edited the XML files I needed to. And now it won't compile. Keeps throwing java errors. Would someone be so kind to compile this for me?
This is a System APK so it needs to be compiled and signed. If you're curious or it needs extra files pulled from somewhere, it's the SystemUI.apk in the CM7 Droid nightly build 88.
Click to expand...
Click to collapse
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
mazdarider23 said:
Oh and once you compile it, you don't have to sign it because is a system app and not a regular app.
Click to expand...
Click to collapse
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
MongooseHelix said:
What errors are you getting from apktool? It's going to be hard for someone else to compile an apk that has not been decoded by them and not knowing what files have been changed. Letting us know at least what .png or .xml files were modified would be a start but will work best if we could just figure out why you aren't able to build with your modifications.
The first thing I noticed from the zip you attached is that it's missing the apktool.yml file that should get created a package is decoded. Second, make sure to pull /system/framework/framework-res.apk so resources can be decoded/built properly. If you are using APK Manager, use option 10 to decode with framework-res.apk. If you are just using apktool run the command "apktool if framework-res.apk" before decoding.
SystemUI.apk actually does get signed using the platform key. The easiest way to do so in my opinion is to use ZipSigner 2 on your phone. Also, once you've placed the modified SystemUI.apk into /system/app make sure it's permissions are rw-r--r--(chmod 644 /system/app/SystemUI.apk) and it's owner:group is root:root(chown 0:0 /system/app/SystemUI.apk). Next reboot to recovery, wipe dalvik-cache and cache, then reboot.
Click to expand...
Click to collapse
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
mazdarider23 said:
Well I'm glad you told me because little old me has been modifying system apps since the days of the nexus one and I've yet to sign one....I think is all depends on who's doing the modification...hahahaha....Good luck 0vermind on finding someone to compiling your systemui.apk!
Click to expand...
Click to collapse
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
MongooseHelix said:
I'm not quite sure what to make of that comment...I certainly wasn't trying to step on your toes so I apologize if it came across that way. Just wanted to help avoid and rule out any issues that might come up. With APK Manager or by using 7zip, you can move the manifest and/or META-INF folder containing the signature from the original but to imply that system apps are not signed is incorrect.
I also think it is important that those messing with system apps understand that there are different keys used to sign apps. For anybody reading this that wants to figure out how certain packages are signed, here's a bit of an explanation. If we extract SystemUI.apk, we see a directory called META-INF. This holds the key/signature info. The key's serial number can be determined with the following command:
Code:
keytool -printcert -v -file SystemUI/META-INF/CERT.RSA | grep SerialNumber
You can check other apks/jars and noticing which have matching serial numbers, meaning they are signed with the same key...
platform key - SystemUI.apk, Settings.apk, Phone.apk, etc
shared key - Contacts.apk, UserDictionaryProvider.apk, etc
test key - Calendar.apk, DeskClock.apk, etc
google proprietary key - Vending.apk, Talk.apk, etc (including some market user apps like Maps, VoiceSearch, Docs)
Click to expand...
Click to collapse
Thanks, I didn't know this! I'm glad there's people like you and mazdarider23 on this forum that know **** like this!!!

Has anyone figured out Hotspot / tethering for sprint a9?

I've ran through default.xml and made some changes allowing me to access hotspot and turn it on but I cannot get any data to transfer.. anyone figure this out yet?
It should be the same as on previous devices - the APNs will need to be updated to add the dun profile and cust_cdmaconn.dat will probably need to be removed (in addition to the default.xml changes to which you refer).
Captain_Throwback said:
It should be the same as on previous devices - the APNs will need to be updated to add the dun profile and cust_cdmaconn.dat will probably need to be removed (in addition to the default.xml changes to which you refer).
Click to expand...
Click to collapse
Thanks capt'n! Where can I find information on how to update APN to add dun profile? I have the paid version of root explorer and nothing came up when I searched for cust_cdmaconn.dat
edit:
found cust_cdmaconn.dat manually in system>customize but still need to update apn to add dun profile, not familiar with that, any help would be appreciated, thanks!
Captain_Throwback said:
It should be the same as on previous devices - the APNs will need to be updated to add the dun profile and cust_cdmaconn.dat will probably need to be removed (in addition to the default.xml changes to which you refer).
Click to expand...
Click to collapse
When I goto network settings on my a9 Access point names is grey'd out :/ and i cannot access it. Im rooted lastest 1.57 stock rom s-off if that matters..
Ive searched far and wide, adding to the build.prop does not work anymore:
ril.sales_code=LOL
ro.csc.sales_code=LOL
Update:
got MSL from sprint, went into ##data# and scoped the settings. Theyre different with new update I guess. There's no APN settings or anything of the sort showing default,mms. EHRPD only shows enable or disable and LTE only shows the same, enable or disable.
Can anyone shine some light on this?
wholigan423 said:
When I goto network settings on my a9 Access point names is grey'd out :/ and i cannot access it. Im rooted lastest 1.57 stock rom s-off if that matters..
Ive searched far and wide, adding to the build.prop does not work anymore:
ril.sales_code=LOL
ro.csc.sales_code=LOL
Update:
got MSL from sprint, went into ##data# and scoped the settings. Theyre different with new update I guess. There's no APN settings or anything of the sort showing default,mms. EHRPD only shows enable or disable and LTE only shows the same, enable or disable.
Can anyone shine some light on this?
Click to expand...
Click to collapse
When I referred to editing the APN, I meant doing it in framework-res.apk, by decompiling it.
Obviously if you do that you'll need to have a stock system image backup made and dm-verity disabled otherwise your system won't boot.
Captain_Throwback said:
When I referred to editing the APN, I meant doing it in framework-res.apk, by decompiling it.
Obviously if you do that you'll need to have a stock system image backup made and dm-verity disabled otherwise your system won't boot.
Click to expand...
Click to collapse
... perhaps this is over my head but as im sure im not alone, if this could be explained in greater detail im sure more people would greatly appreciate and even maybe script into a easy program, other than myself
wholigan423 said:
... perhaps this is over my head but as im sure im not alone, if this could be explained in greater detail im sure more people would greatly appreciate and even maybe script into a easy program, other than myself
Click to expand...
Click to collapse
Not sure what else you want me to explain. Decompile the framework and add the dun profile to the standard CDMA (LTE and eHRPD) APNs. If there's a dun only APN, remove it. If you remove the read-only flag, you should be able to view the APNs in Settings.
As far as the dm-verity flag, that's explained a bit more in the TWRP thread, and I provided a boot image patches to take care of that already.
All of the tools you need can be found using search. Welcome to XDA-Developers .
Captain_Throwback said:
Not sure what else you want me to explain. Decompile the framework and add the dun profile to the standard CDMA (LTE and eHRPD) APNs. If there's a dun only APN, remove it. If you remove the read-only flag, you should be able to view the APNs in Settings.
As far as the dm-verity flag, that's explained a bit more in the TWRP thread, and I provided a boot image patches to take care of that already.
All of the tools you need can be found using search. Welcome to XDA-Developers .
Click to expand...
Click to collapse
Let me know if im on the right track..
So I've flashed the Dm verify via TWRP and Im viewing the androidmanifest.xml in the framework-res.apk-----about 2/3s the way down (viewing on phone root explorer) youll find
<permission>
name="android.permission.WRITE_APN_SETTINGS"
protectionlevel="18">
</permission>
It appears most of the items are regulated between 2 or 18. So would I be correct to assume that changing this 18 to a 2 would allow me access to the native APN settings in phone?
wholigan423 said:
Let me know if im on the right track..
So I've flashed the Dm verify via TWRP and Im viewing the androidmanifest.xml in the framework-res.apk-----about 2/3s the way down (viewing on phone root explorer) youll find
name="android.permission.WRITE_APN_SETTINGS"
protectionlevel="18">
It appears most of the items are regulated between 2 or 18. So would I be correct to assume that changing this 18 to a 2 would allow me access to the native APN settings in phone?
Click to expand...
Click to collapse
Nothing you need to edit is in the manifest. You need to edit the actual APNs, which are found in res/xml.
EDIT: Actually I don't know if changing that value will allow you to change the APN Settings. I've never figured out how to change the manifest successfully.
Captain_Throwback said:
Nothing you need to edit is in the manifest. You need to edit the actual APNs, which are found in res/xml.
EDIT: Actually I don't know if changing that value will allow you to change the APN Settings. I've never figured out how to change the manifest successfully.
Click to expand...
Click to collapse
OK so now im viewing the cdmaapn.xml and added dun to all the profiles, is that all? can I add it into the framework-res.apk directly overwriting on system?
also edited apns.xml and added dun to profiles
now how do i get them into the framework-res.apk? Can I use root explorer and copy/paste them directly in?
wholigan423 said:
OK so now im viewing the cdmaapn.xml and added dun to all the profiles, is that all? can I add it into the framework-res.apk directly overwriting on system?
Click to expand...
Click to collapse
Not sure I understand your last question. You should be able to recompile the apk, and then just drop the already compiled, modified apns into the original stock framework. That'll give you the updated APNs.
Then you'll have to delete the current telephony database in /data/data/com.android.providers.telephony/databases and possibly the shared_prefs folder if there are APNs in it.
im having an exceptionally difficult time re-compiling, most of the write ups seem out of date :/ uhg
Ive installed android sdk and latest java 64bit
heres the scirpt errors:
C:\Users\Mike\Downloads\adb-tools-1.0.31>apktool b frameworkzzz edited framework-res.apk
I: Using Apktool 2.0.0-RC2 on frameworkzzz
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.io.FileNotFoundException: frameworkzzz (The system cannot find the file specified)
at brut.androlib.Androlib.readMetaFile(Androlib.java:247)
at brut.androlib.Androlib.build(Androlib.java:266)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.directory.DirectoryException: java.io.FileNotFoundException: frameworkzzz (The system cannot find the file specified)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:54)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:37)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.Androlib.readMetaFile(Androlib.java:243)
... 4 more
Caused by: java.io.FileNotFoundException: frameworkzzz (The system cannot find the file specified)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(Unknown Source)
at java.io.RandomAccessFile.<init>(Unknown Source)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:203)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:182)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:143)
at brut.directory.ZipExtFile.<init>(ZipExtFile.java:28)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:52)
... 7 more
wholigan423 said:
im having an exceptionally difficult time re-compiling, most of the write ups seem out of date :/ uhg
Ive installed android sdk and latest java 64bit
heres the scirpt errors:
C:\Users\Mike\Downloads\adb-tools-1.0.31>apktool b frameworkzzz edited framework-res.apk
I: Using Apktool 2.0.0-RC2 on frameworkzzz
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.DirectoryException: java.io.FileNotFoundException: frameworkzzz (The system cannot find the file specified)
at brut.androlib.Androlib.readMetaFile(Androlib.java:247)
at brut.androlib.Androlib.build(Androlib.java:266)
at brut.androlib.Androlib.build(Androlib.java:258)
at brut.apktool.Main.cmdBuild(Main.java:240)
at brut.apktool.Main.main(Main.java:89)
Caused by: brut.directory.DirectoryException: java.io.FileNotFoundException: frameworkzzz (The system cannot find the file specified)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:54)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:37)
at brut.androlib.res.util.ExtFile.getDirectory(ExtFile.java:55)
at brut.androlib.Androlib.readMetaFile(Androlib.java:243)
... 4 more
Caused by: java.io.FileNotFoundException: frameworkzzz (The system cannot find the file specified)
at java.io.RandomAccessFile.open0(Native Method)
at java.io.RandomAccessFile.open(Unknown Source)
at java.io.RandomAccessFile.<init>(Unknown Source)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:203)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:182)
at org.apache.commons.compress.archivers.zip.ZipFile.<init>(ZipFile.java:143)
at brut.directory.ZipExtFile.<init>(ZipExtFile.java:28)
at brut.directory.ZipRODirectory.<init>(ZipRODirectory.java:52)
... 7 more
Click to expand...
Click to collapse
Update your apktool. You should be using the latest version to both decompile and recompile the APK for best results.
Captain_Throwback said:
Update your apktool. You should be using the latest version to both decompile and recompile the APK for best results.
Click to expand...
Click to collapse
Thanks, you've been a great deal of help. Now I just need to figure out how the hell to open this damn .jar file on windows 10 fml
I take it there isn't and won't be an easier way to do this.
Okay... So decompile framework-res.apk which is located in /system/framework. Navigate to res/xml. Edit apns.xml and add dun to the APNs and delete the dun APN if it is there. At this point do I have to sign the APK (it has been a long time since I've done any tinkering with APKs)? And then I push the APK back to /system/framework and chmod 644 it. Should I reboot into recovery at this point and wipe data? Or do I just have to reboot the phone and delete the current telephony database?
Or could I just recompile the APK, and then just extract the modified apns.xml from the recompiled APK and just insert the apns.xml into the stock APK?
truthfuldemise said:
Okay... So decompile framework-res.apk which is located in /system/framework. Navigate to res/xml. Edit apns.xml and add dun to the APNs and delete the dun APN if it is there. At this point do I have to sign the APK (it has been a long time since I've done any tinkering with APKs)? And then I push the APK back to /system/framework and chmod 644 it. Should I reboot into recovery at this point and wipe data? Or do I just have to reboot the phone and delete the current telephony database?
Or could I just recompile the APK, and then just extract the modified apns.xml from the recompiled APK and just insert the apns.xml into the stock APK?
Click to expand...
Click to collapse
good luck man i still havent got it 1 week in to tinkering, update us if you get plz thanks
I didn't have any trouble decompiling or recompiling the framework-res with the latest apktool, so I'm not sure why you were having issues.
I'm attaching a zip with the updated framework-res.apk in it, from the latest Sprint RUU that was available on HTC's website (1.57.651.1). While it is technically a flashable zip, I couldn't test it, so if it doesn't work, you might just be better off replacing the file manually and deleting the other files while in TWRP.
I have two asserts in the zip - one will confirm you're flashing the zip to a Sprint device, and the other will read your baseband to ensure you're on the latest firmware/software before allowing you to flash. The latter assert I'm not positive about, so if you're certain you're on the latest and the zip won't flash, I'll need a recovery log.
Additionally, I don't even know for sure whether these changes will allow tether to work on this device. So absolutely make sure you make a backup before flashing this!
Captain_Throwback said:
I didn't have any trouble decompiling or recompiling the framework-res with the latest apktool, so I'm not sure why you were having issues.
I'm attaching a zip with the updated framework-res.apk in it, from the latest Sprint RUU that was available on HTC's website (1.57.651.1). While it is technically a flashable zip, I couldn't test it, so if it doesn't work, you might just be better off replacing the file manually and deleting the other files while in TWRP.
I have two asserts in the zip - one will confirm you're flashing the zip to a Sprint device, and the other will read your baseband to ensure you're on the latest firmware/software before allowing you to flash. The latter assert I'm not positive about, so if you're certain you're on the latest and the zip won't flash, I'll need a recovery log.
Additionally, I don't even know for sure whether these changes will allow tether to work on this device. So absolutely make sure you make a backup before flashing this!
Click to expand...
Click to collapse
sweet, thanks, im testing now. and I already have the latest 1.57.651.1 RUU direct from htc website, but i ran it in twrp and attempted to flash the zip and "error: 7" came up something like your system is old and out of date, but I most definetly have the latest. So now I am extraction in root explorer and gonna over write framework-res.apk with new one...here it goes...lol. DONT do it while your phone is on. NEEDS to be done on computer. instant restart, hopefully not bricked. will update after im done panicking. (i have backed up system just incase but still...)
wholigan423 said:
sweet, thanks, im testing now. and I already have the latest 1.57.651.1 RUU direct from htc website, but i ran it in twrp and attempted to flash the zip and "error: 7" came up something like your system is old and out of date, but I most definetly have the latest. So now I am extraction in root explorer and gonna over write framework-res.apk with new one...here it goes...lol. DONT do it while your phone is on. NEEDS to be done on computer. instant restart, hopefully not bricked. will update after im done panicking. (i have backed up system just incase but still...)
Click to expand...
Click to collapse
I asked for a recovery log if the flash failed....
And flashing the zip assumes you've already removed encryption and patched your boot.img. I thought those were givens.
EDIT: I can incorporate the boot.img patches into the zip, but won't be able to delete the telephony database, since TWRP can't by default decrypt /data. So then you wouldn't be using the updated APNs, which would make the changes useless.
EDIT 2: And you can replace the framework-res directly on the phone - you just have to do it while in TWRP. That's how I make most edits to my devices.

Categories

Resources