Decompiling 2.2 files - Galaxy S I9000 Q&A, Help & Troubleshooting

Hello,
I am trying to edit settings.apk and some of the library files such as libskia.so for the new firmware in order to localize them. apktool isn't succeeding decoding the settings.apk file for 2.2 even though it was fine with 2.1 firmware. Does anyone know how I can decode the 2.2 files by using windows or cygwin? Thanks...

Do you have add Froyo's framework-res to the apktool?
apktools if system/framework/framework-res.apk
Click to expand...
Click to collapse

Ask again here ==> forum.xda-developers.com/forumdisplay.php?f=565
or here ==> forum.xda-developers.com/forumdisplay.php?f=456

supirman said:
Do you have add Froyo's framework-res to the apktool?
Click to expand...
Click to collapse
I did that but I still get errors such as:
Code:
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColorHint, value=0x02050001
Can't find framework resources for package of id: 2. You must install proper fra
mework files, see project website for more info.
Here is another question, how can I find samsung galaxy s 2.2 resources? I believe that's what I am missing to get it working. I think it might be a file like this com.samsung.resources.apk or similar.
EDIT: I managed to decode settings.apk successfully by adding twframework-res.apk to apktool. Now I just need to figure out how to edit libskia.so for 2.2.

Powerhuman said:
I did that but I still get errors such as:
Code:
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColorHint, value=0x02050001
Can't find framework resources for package of id: 2. You must install proper fra
mework files, see project website for more info.
Here is another question, how can I find samsung galaxy s 2.2 resources? I believe that's what I am missing to get it working. I think it might be a file like this com.samsung.resources.apk or similar.
EDIT: I managed to decode settings.apk successfully by adding twframework-res.apk to apktool. Now I just need to figure out how to edit libskia.so for 2.2.
Click to expand...
Click to collapse
Have you edited it in firmware 2.1?

Powerhuman said:
Now I just need to figure out how to edit libskia.so for 2.2.
Click to expand...
Click to collapse
Nearly impossible: it's native code, you know. Even worst: ARMs aren't so popular as PC, so there aren't too many ARM disassemblers/decompilers for them.
But I think it's just a image processing library, so... what to localize in it?

zygame said:
Have you edited it in firmware 2.1?
Click to expand...
Click to collapse
it has been done using linux. however, I am trying to use cygwin to do it but I can't seem to have the dpkg command installed in cygwin.
Brut.all said:
Nearly impossible: it's native code, you know. Even worst: ARMs aren't so popular as PC, so there aren't too many ARM disassemblers/decompilers for them.
But I think it's just a image processing library, so... what to localize in it?
Click to expand...
Click to collapse
I am trying to add another language to 2.2. We managed to add it to 2.1 but 2.2 seems to use different encryption method which we haven't managed to successfully decode.

Powerhuman said:
I am trying to add another language to 2.2. We managed to add it to 2.1 but 2.2 seems to use different encryption method which we haven't managed to successfully decode.
Click to expand...
Click to collapse
Encryption? It's a library file, like .dll on Windows. It's not encrypted, it's just compiled, like any .dll, .exe, etc. on your PC.
Did you succeed in "decrypting" libskia.so from 2.1?

Brut.all said:
Encryption? It's a library file, like .dll on Windows. It's not encrypted, it's just compiled, like any .dll, .exe, etc. on your PC.
Did you succeed in "decrypting" libskia.so from 2.1?
Click to expand...
Click to collapse
Encryption might not be the correct word. When you "compile" these files, sometimes there are headers associated with them, without them, it would be very difficult to "decompile" them in order to edit it.

Powerhuman said:
Encryption might not be the correct word. When you "compile" these files, sometimes there are headers associated with them, without them, it would be very difficult to "decompile" them in order to edit it.
Click to expand...
Click to collapse
Ok, but Skia is an open source project, it's a part of AOSP Of course Samsung may modified something in it, but I doubt it.
EDIT:
And still it's illogical to me, that there is something to localize in image processing library.

Brut.all said:
Ok, but Skia is an open source project, it's a part of AOSP Of course Samsung may modified something in it, but I doubt it.
EDIT:
And still it's illogical to me, that there is something to localize in image processing library.
Click to expand...
Click to collapse
I am trying to localize it to arabic, if you know the language you would know that its letters are connected in certain situations. Currently, these files do not connect them correctly and even more, it inverts the letter positions. In order to fix this issue, these library files have to be modified. This has been done in 2.1 and I heard someone did it for Nexus1 2.2. We are trying to get a hold of him to understand how did he modify them in 2.2.

Here is something i just noticed.
Even though I have successfully decoded and built Settings.apk using pktool. I have notice a difference in the size of the file (the newer file is much smaller). So I tried to decode and build the same exact file without any modifications and it still does the same thing (original Settings.apk is 3.4MB while the rebuilt unmodified file is 2.1MB)
Using winrar to check the new file I have noticed missing files namely the META-INF folder. Is this normal with apktool?
I used the following to decode and build the file
> apktool d settings.apk
> apktool b settings settings.apk
There are no errors in decoding or building the file.
EDIT: Nevermind, I forgot to sign the file which corresponds to the same missing files.

Powerhuman said:
Here is something i just noticed.
Even though I have successfully decoded and built Settings.apk using pktool. I have notice a difference in the size of the file (the newer file is much smaller). So I tried to decode and build the same exact file without any modifications and it still does the same thing (original Settings.apk is 3.4MB while the rebuilt unmodified file is 2.1MB)
Using winrar to check the new file I have noticed missing files namely the META-INF folder. Is this normal with apktool?
I used the following to decode and build the file
> apktool d settings.apk
> apktool b settings settings.apk
There are no errors in decoding or building the file.
EDIT: Nevermind, I forgot to sign the file which corresponds to the same missing files.
Click to expand...
Click to collapse
Ye,you have to sign the file by yourself,and with samsung's private key to works with other samsung's files

Powerhuman said:
I did that but I still get errors such as:
Code:
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColorHint, value=0x02050001
Can't find framework resources for package of id: 2. You must install proper fra
mework files, see project website for more info.
Here is another question, how can I find samsung galaxy s 2.2 resources? I believe that's what I am missing to get it working. I think it might be a file like this com.samsung.resources.apk or similar.
EDIT: I managed to decode settings.apk successfully by adding twframework-res.apk to apktool. Now I just need to figure out how to edit libskia.so for 2.2.
Click to expand...
Click to collapse
if ur using mediatek then
use
apktool if mediatek-res.apk

Related

Which xml file has the color for the default status bar notification text?

Which xml file has the color for the default status bar notification text?
Examples: the "usb connected", "application installed successfully" messages on the status bar.
I have tried all 9 options available in colorchangev3.jar and none of them change the color from back.
[ticker] - ARGB color for ticker notifications on the status bar
[clock] - ARGB color for the clock text
[date] - ARGB color for the date
[ongoing] - ARGB color for "Ongoing" Label
[latest] - ARGB color for "Notifications" Label
[none] - ARGB color for "No Notifications" Label
[clear] - ARGB color for text on Clear Notifications button
[network] - ARGB color for network name (T-Mobile usually)
[roam] - Not sure where this color shows up, possibly network name when roaming
Click to expand...
Click to collapse
edit: I suspect its in another jar/apk other than framework* OR services.jar.... (for example the music notification text color is in Music.apk)
lol, well I found it last night but couldn't install the apk after changing it... now interestingly I knew you posted to the thread here about resigning framework-res and I was looking through your posts to find that thread when I found this question.
So, I'll share with you if you can collaborate with me and between us we can get a modded one completed (I want ffd3d3d3 for most of my colours).
Indeed, the notification ticker, last and ongoing are all in the same xml so it's real easy.
BUT - I followed your steps in the other thread (to sign update.zip) and I got a boot loop...
Here's what I did:
using this framework
move classes.dex from framework.jar to framework-res.apk
apktool -d framework-res.apk - success
change xml
apktool -b framework-res.apk - success
move classes.dex from framework-res.apk to framework.jar
sign neither files
make update.zip
sign update.zip
install update.zip
boot loop - it's not because of the xml changes, they were small.
Note how in all of that I didn't tell you what xml... I'm not being mean I just need to trade... can we collaborate to get this thing working? I need it for Kang-o-rama...
OR - should we just create a Morph for the xml, would that work?
I dont get this step: framework-res.apk does not have a classes.dex right?
move classes.dex from framework-res.apk to framework.jar
Click to expand...
Click to collapse
britoso said:
I dont get this step: framework-res.apk does not have a classes.dex right?
Click to expand...
Click to collapse
No... but it wont backsmali (apktool decode) without the java classes which are in framework.jar (at least they are in the one linked above) so I took that out of that file and dumped it in framework-res.apk (.jar and .apk are only containers). Perhaps with apktool there's a command line to point to an external class file but I'm not aware of it.
I don't actually know if the other dependencies will work with classes.dex contained in framework-res.apk so I moved it back to framework.jar after rebuilding the apk.
But now I don't know (trial and all error so far) if I need to sign all of the dependencies with the same sig, the zip file or what.
I'm confused by the advice in the other thread (if I understood it correctly) to not sign the framework-res.apk and only the .zip - because an unsigned manifest will get rejected by the system at boot (even if not at installation). lol - I have boot loop logs to prove it...
Code:
E/ActivityThread( 526): Failed to find provider info for settings
W/dalvikvm( 526): threadid=31: thread exiting with uncaught exception (group=0x4001b1d0)
E/AndroidRuntime( 526): Uncaught handler: thread PowerManagerService exiting due to uncaught exception
E/AndroidRuntime( 526): *** EXCEPTION IN SYSTEM PROCESS. System will crash.
java -jar apktool.jar b framework-res.apk-decoded
where framework-res.apk-decoded is a folder, works fine for me.
are you referring to the instructions at http://forum.xda-developers.com/showpost.php?p=6334671&postcount=11 ?
britoso said:
java -jar apktool.jar b framework-res.apk-decoded
where framework-res.apk-decoded is a folder, works fine for me.
are you referring to the instructions at http://forum.xda-developers.com/showpost.php?p=6334671&postcount=11 ?
Click to expand...
Click to collapse
Different thread, same instructions... using those instructions the AndroidManifest.xml file in framework-res.apk doesn't get signed so I can't see how it's ever loaded by the system...
Oh, I can build the file okay... but apktool can't decode the one I'm using properly unless I add the classes.dex file to it...
INFO: Baksmaling...
Exception in thread "main" org.jf.dexlib.DexFile$NoClassesDexException: zip file framework-res.apk does not contain a classes.dex file
Click to expand...
Click to collapse
Oh, and the file you're looking for is status_bar.xml in /res/layout/ <- this is only for the main notification ticker (in the status bar).
Although, I've just hex edited the colours and flashed a new rom with it and it did nothing at all. I'll verify my work but this leads me to suspect that the new spare parts is overwriting these defaults with it's own defaults... which could make this a painful tracing exercise. I might need to try and trace the source code which I'd like to avoid.
djmcnz said:
apktool can't decode the one I'm using properly unless I add the classes.dex file to it...
Click to expand...
Click to collapse
use the -s option, it will work
d[ecode] [-s|--no-src] [-r|--no-res] <file.apk> <dir>
Decode <file.apk> to <dir>.
-s, --no-src
Do not decode sources.
-r, --no-res
Do not decode resources.
Click to expand...
Click to collapse
Thanks for the tip, will be interested to see it working.
britoso said:
use the -s option, it will work
Thanks for the tip, will be interested to see it working.
Click to expand...
Click to collapse
lol, so simple.
Okay, I've verified that I did patch the file correctly (I pulled it from my phone, decoded it and checked the xml). My hex edits were made correctly to the xml but they had no effect whatsoever. This, I assume, means that the way the new Spare Parts (with the colour picker) works is different and status_bar.xml is no longer the primary source of the default colours. This means existing morphs, hex edits, colorchange.jar and themes may apply but have no effect. Since there's a track record of Wysie's Spare Parts code being rolled into Cyanogen's source it seems that this might be a long term consideration.
So, I'm going to try and trace the replacement defaults (and I don't think it will simply be in spareparts.apk)... I might ping Wysie...
If you're using an older framework then I imagine you'll have more positive results.
In some respects this may be good because the date is set to:
Code:
android:textColor="?textColorPrimaryInverse"
Which would be impossible to hex edit.
Thanks for the tip on apktool!
britoso said:
Which xml file has the color for the default status bar notification text?
Examples: the "usb connected", "application installed successfully" messages on the status bar.
Click to expand...
Click to collapse
Okay mate, I've got it working thanks to some pointers from wysie.
It's all changed, the xml is no longer used. No more simple morphs but I expect that this will just mean two version float around in the wild.
Key defaults are now in the code, services.jar - specifically StatusBarService.java. Two constants are established "blackcolor" and "whitecolor" and simply inserted where needed. You can change the value of the constants or simply change how they're inserted (which is the approach I took).
For a "complete" change, you need to also modify the Spare Parts app so that the "Reset UI Tweaks" defaults to the new order of things as implemented in services.jar.
Hopefully I'll be releasing a version of Kang-o-rama today that will include these mods, feel free to kang them if you want to save some effort!
cool, will be nice to finally have this missing piece

[Q] How to edit framework-res.apk?

I'm trying to edit framework-res.apk so I can theme my rom. Are these the correct steps?
pull framework-res.apk from my phone
decompile the apk
make the changes
rebuild the apk
sign
zipalign
push apk back to device
I'm not too sure on this method as after I pushed back my modified apk, I get a load of force close errors
Any advice would be welcome
don't sign and don't zipalign and all are fine
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
How is your process to decompile and recompile what tools do you use
vibez said:
I tried without sign and zipalign but the rom wouldnt boot. If I sign, I get force close errors
Does the rom need to be deoxed?
Click to expand...
Click to collapse
Sent from my GT-I9000 using XDA App
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
setenza01 said:
How is your process to decompile and recompile what tools do you use
Sent from my GT-I9000 using XDA App
Click to expand...
Click to collapse
I use apk manager to decompile and rebuild
Benjamin Dobell said:
Is this an ODEXed ROM or a deOXEDed ROM? You can't mix and match. If you're not ODEXing any APKs after you've modified them then you need to make sure all APKs are deOXEDed.
Click to expand...
Click to collapse
It is a stock rom but there is no framework-res.odex does that mean it doesn't need deodexing even though there are odex files for every other apk in my system folder?
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
FadeFx said:
maybe this little monster is some help to you:
http://forum.xda-developers.com/showthread.php?p=7377678#post7377678
Click to expand...
Click to collapse
Nice app but this theme also needs .xml changes which this app doesnt support
ok, i put him a note in his thread about the xml changing issue, we will see what hes answer will be...
edit:
also this software could do the trick: http://android.modaco.com/content/t-mobile-pulse-pulse-modaco-com/302404/ande-android-design-editor/
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
vibez said:
I've been playing around a little more today and it seems the issue is that no tool can rebuild the xml files correctly, they seem to be compressed/encoded.
Has anyone been able to edit an xml file in framework-res.apk and have the phone read it properly?
Click to expand...
Click to collapse
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
So here are the rules u must follow :
If u've modified the manifest.xml, u must stop core, push the apk, start core or push the apk while in recovery.
If u've modified anything else, a simple push / reboot will do the trick.
Note, u cannot flash a modified system apk the first time (as in on a clean boot), u must flash the original rom, let it build the dex's and then flash ur modified apk.
Daneshm90 said:
Refer to my signature. Apk manager.
Edit : just read ur op.
Never sign the system apk's. Simply keep the original signatures intact and after recompiling them, re-include them.
Click to expand...
Click to collapse
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
vibez said:
Hi, I am already using apk manager but the xml files it creates do not seem to work.
To prove this, I have done a test. See the attached xml files,
original_stat_sys_battery.xml was extracted from the original framework-res.apk
I then used apk manager to decompile and then recompile the same apk without making any changes.
recompiled_stat_sys_battery.xml is this recompiled file
I then opened up both files and they look different to me
Click to expand...
Click to collapse
That shouldn't concern u. Apktool's method of rebuilding the apk/arsc file is slightly different than how android originally builds an apk. What should concern u is if the apk simply works. Now when u decompile the apk, can u check the log to see if it reports of any missing resources, if it doesn't ur fine. So decompile the apk, make ur changes, recompile the apk, move the original meta-inf folder into ur new apk and push it to ur phone following the guidelines in my previous post. if it causes problems, post ur log and i'll take a look.
Ok this time I have added meta-inf to the new apk, pushed it to my phone and the phone hangs on boot.
Here is my log
--------------------------------------------------------------------------
|08/08/2010 -- 18:36:30.87|
--------------------------------------------------------------------------
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the file specified.
The system cannot find the path specified.
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk
Could Not Find C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk
The system cannot find the file specified.
I: Loading resource table...
I: Decoding resources...
I: Copying assets and libs...
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
aapt: warning: string 'keyguard_password_attempts_count_pin_code' has no default translation in C:\Documents and Settings\Lee\Desktop\Apk_Manager_4.8\other\..\out\res; found: fr ko
I: Building apk file...
Click to expand...
Click to collapse
Oh lol i meant the log of ur phone.
Use adb logcat
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
vibez said:
lol ok, at which point should I run logcat - after the hang or as soon as I switch the phone on?
Click to expand...
Click to collapse
When u switch phone On.
Ok here you are
vibez said:
Ok here you are
Click to expand...
Click to collapse
Heres ur culprit
Code:
java.lang.SecurityException: META-INF/MANIFEST.MF has invalid digest for AndroidManifest.xml
Now seems u modified the androidmanifest.xml ? If u didn't then heres my recommendation, copy over the original androidmanifest.xml from the original apk.

[Q] HELP - how to edit (modify) themes (mixing images)

Hello,
little background. i know my way around ROM installation (changing Kernels,modems, installing themes etc.) and read about how to use apk manager.
one of the things i still can't figure out, and seems to me like the next step is modifiyng themes.
i am currently using Perception 10.2, with stock theme. i really like the paragon basic theme + few more icons and items from phoneix and other themes.
i wend ahead and decompiled framework-res.apk from all the themes, and tried to copy over the images from the paragon drawable-hdpi folder to the same folder in Perception.
importent note, i know that there might be an issue with editing a .9.png file, but i assumed copying over a file that works in another rom is acceptable.
hope some of you are still with me.. here is the catch... tried to Compile the apk... and errors...
here is a parital log:
--------
|Sat 01/22/2011 -- 17:23:37.28|
--------------------------------------------------------------------------
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_disabled.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_disabled_focused.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_normal.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_pressed.9.png
libpng error: Read Error
ERROR: Failure processing PNG image Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\btn_zoom_down_selected.9.png
libpng error: Read Error
Click to expand...
Click to collapse
different error:
Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\values\public.xml:3756: error: Public symbol drawable/zzzzz_tw_quickcontact_slider_grip_left declared here is not defined.
Z:\F\kombinator work\android hack and hebrew\Developer\Tools\apk_manager_4.9\other\..\projects\framework-res.apk\res\values\public.xml:3757: error: Public symbol drawable/zzzzz_tw_quickcontact_slider_grip_right declared here is not defined.
Click to expand...
Click to collapse
i hope someone can make sense out of this... i thought it would be a simple proccess, hope i did something wrong and it will be an easy fix...
Thank you so much for reading this far, your help will be appreciated!
Yossi
The problem you're having is with semi-transparent .9 files. The Android SDK png handler can't decompile them, so when you look at them in explorer they'll have a default image meaning they're corrupt.
The easiest way to deal with them is to not decompile and recompile.
PNG Only: With apk manager, take the original framework files from the ROM (or phone if stock) and drop them into place-apk-here-for-modding, then take the themed frameworks, rename them (something like framework-resParagon.apk) and drop those into place-apk-here-for-modding.
Select each one and extract (not decompile).
Open the drawable-hdpi folders side-by-side of the original and the theme, and drag (Copy) the ones you want to the original.
Then Zip the original and select System APK, and you're done. The reason this work is because the .9 files are still in their compiled state.
If you need to copy xml files, do this first, then the first step for png files: Decompile the two, copy the XML files, and recompile. Compiled XML files convert the png names to IDs which may be different between two roms. If you already have .9.png files that don't decompile, here's the fun part and I guess I'm doing all of this out of order, sorry...
Have an orginal apk decompiled with a different name, extract your modded apk, drag the drawable-hdpi out to say desktop, delete that project, decompile, drag the original decompiled drawable-hdpi into your modded one, and now you can edit/copy XML files and recompile. Then delete the project, extract, delete drawable-hdpi and drag the desktop drawable-hdpi to the project and zip it up. Done.
Or quick version.. 7zip helps.
right click the apk you want the images from, extract it.
right click open archive the apk you want the images in.
navage down to the folder that the images are stored in while in 7zip.
go back to the extracted folder and navagate down to the folder the images you want are in.
drag and drop them into the open archive 7zip window.
close archive
push
whiteguypl said:
Or quick version.. 7zip helps.
right click the apk you want the images from, extract it.
right click open archive the apk you want the images in.
navage down to the folder that the images are stored in while in 7zip.
go back to the extracted folder and navagate down to the folder the images you want are in.
drag and drop them into the open archive 7zip window.
close archive
push
Click to expand...
Click to collapse
CuriousTech said:
The problem you're having is with semi-transparent .9 files. The Android SDK png handler can't decompile them, so when you look at them in explorer they'll have a default image meaning they're corrupt.
The easiest way to deal with them is to not decompile and recompile.
PNG Only: With apk manager, take the original framework files from the ROM (or phone if stock) and drop them into place-apk-here-for-modding, then take the themed frameworks, rename them (something like framework-resParagon.apk) and drop those into place-apk-here-for-modding.
Select each one and extract (not decompile).
Open the drawable-hdpi folders side-by-side of the original and the theme, and drag (Copy) the ones you want to the original.
Then Zip the original and select System APK, and you're done. The reason this work is because the .9 files are still in their compiled state.
If you need to copy xml files, do this first, then the first step for png files: Decompile the two, copy the XML files, and recompile. Compiled XML files convert the png names to IDs which may be different between two roms. If you already have .9.png files that don't decompile, here's the fun part and I guess I'm doing all of this out of order, sorry...
Have an orginal apk decompiled with a different name, extract your modded apk, drag the drawable-hdpi out to say desktop, delete that project, decompile, drag the original decompiled drawable-hdpi into your modded one, and now you can edit/copy XML files and recompile. Then delete the project, extract, delete drawable-hdpi and drag the desktop drawable-hdpi to the project and zip it up. Done.
Click to expand...
Click to collapse
Thanks guys! i knew there should be a simple solution!
will try this soon. and post results!
Yossi
Also make sure to double check the sizes, the height and width my be different and give you issues if you copy and past the pngs
Sent from my SGH-I897 using XDA App
Also with 2.2.1 there's a problem with compressed apk files, so in apk manager, you need to set compression to 0. It's not a problem when dropping them into an apk with 7zip.
Different sized png files are usually the expanded notification bar switches. The darkness theme for example uses smaller ones. The size change is in twframework-res.apk/res/layout/status_bar_expanded.xml so those should be copied together (decompiled).
Another way to customize just 1 or a few .xml or .9.png files is to decompile the original, edit the xml or .9.png (with your modified one in mind), then compile. Then rip the compiled files from it and drop them into the themed one, assuming you already used the original the first time.
CuriousTech said:
Also with 2.2.1 there's a problem with compressed apk files, so in apk manager, you need to set compression to 0. It's not a problem when dropping them into an apk with 7zip.
Different sized png files are usually the expanded notification bar switches. The darkness theme for example uses smaller ones. The size change is in twframework-res.apk/res/layout/status_bar_expanded.xml so those should be copied together (decompiled).
Another way to customize just 1 or a few .xml or .9.png files is to decompile the original, edit the xml or .9.png (with your modified one in mind), then compile. Then rip the compiled files from it and drop them into the themed one, assuming you already used the original the first time.
Click to expand...
Click to collapse
so, double - checking that i understood...
method1: replacing images (same size) using copmpiled source and destination.
if i want to copy iver png's from one theme to another, i only decompress (or 7ZIP - open) the apk's - Replace the pics, and compress bacl (with compression set to 0).
method 2 : replacing images of different sizes
if the images are of different sizes, i should decompile both apk's, than i should copy the corrosponding XML from the new image's source, and drop in the original drawable directory, compile the apk, than copy over the image using method 1.
am i correct?
Thank you all for your help!!!
Yossi
In method 1, don't decompress it when using 7zip (or any other), just open the apk, drop the files in where they go, leaving the apk (zip) intact. If you extract the full apk, modify the files, and compress it back to a new apk it will lose the signature. That's what apk manager does when you zip it and select "system APK". It copies the signature from the original to the new one. Think of it like a zip comment. It's not a file, but a chunk of data attached to the zip that can't be copied from one zip to another.
Method 2: Too complicated. Just use method 1 to do as much as you can.
Whoever put the theme together originally did it incorrectly/lazily.
If you want to spend the time fixing it, then you need to decompile the same version of the .apk (the Samsung stock version, for example) and copypasta the themed one on top of it, while keeping the 1 pixel border.
One more question...or maybe two
when i decompile a framework-res.apk, i only get one drawable-hdpi folder.
if i open the apk using 7zip...i have a 2 folders: one is the same... and and another one that have this name: drawable-hdpi-v4
i replaced all the items i wanted in the drawable-hdpi folder..uploaded to the phone...and nothing happend... than i tried copying over some items to the drawable-hdpi-v4 foder..than i saw the changes.... the question is... do i have to copy the files to both follders? or just the drawable-hdpi-v4 folder?
another question tha poped into my mind right now, is it common that after i replace the framework-res.apk, my accounts data gets erased? (gmail account, facebook, etc)?
Thanks!
Yossi
Get the apktool in this thread and rename your old one just in case:
http://forum.xda-developers.com/showthread.php?t=864424&page=5
Oh, read the thread too. Good info!
The -v4 folders are higher resolution, or supposed to be. They take priority over the others, so if the image is only in drawable-hdpi it will be used, if it's in both the -v4 is used, or if it's only in -v4 it's used. I just leave the non-v4 alone, but it might save space to empty it, just scared to try.
You shouldn't lose account data though. That might indicate a problem. Not sure?
MikeyMike01 said:
Whoever put the theme together originally did it incorrectly/lazily.
Click to expand...
Click to collapse
I don't think the theme makers are to blame. Try decompiling a stock apk, then set the opacity of any .9.png to anything but 100%, draw9patch it again, then compile, then decompile and try to view that png. It's going to be damaged.
Well, it's actually easier to photoshop a compiled one, then remove the .9 and drop in draw9patch but you know what I mean.
I just don't think apktool can handle the extra info in a png.

Assistance is NEEDED - Editing APK

I'm having the most difficult time editing apks. I've followed this tutorial: http://forum.xda-developers.com/showthread.php?t=1365810
and I can't even setup a simple middle clock centered mod or custom carrier logo. I decompile the systemUI settings after installing framework-res. I edit the xml EXACTLY how the tutorial says to. I have the png made and put it in /res/drawable-hdpi/
I recompile the systemUI and sign it, zipit, flash it - it flashes.
Now the following has happened to me, I either get stuck on a boot loop or I try the tutorial all over again without signing the apk, flash it, boots up fine but NO MODS HELP!!!!
i don't edit the center clock on some ROMs anymore b/c they come with an option to center it in the settings... if the ROM you are using has this option, following the directions in that thread might not work or mess something up!
-=NMV4G[03.15B]=- does not unfortunately have this feature, it does have the pm/am clock mods but not the color selector or center mod feature
read this guide first : http://forum.xda-developers.com/showpost.php?p=9126643#post9126643
i think your problem is in this part :
Rebuild the apk using the following command:
Code:
java -jar apktool.jar b framework-res out\framework-res.apk
This will create a new framework-res.apk in a subfolder out.
IMPORTANT: Do not push this apk to your phone unless you want to reflash
Extract the xml files and images from the newly generated apk (you can use the original images, but the xml files must be the newly compiled ones from the new apk). Add these files to the original framework-res.apk that you want to push to your phone (see the previous post).
Extract the resources.arsc from the root of the apk
Rename the original framework-res.apk from your theme to framework-res.zip
Right-click the extracted resources.arsc and choose the 7zip menu item ‘Add to archive’
In the dialog that appears set the achive field at the top to the framework-res.zip from step 7. And set the archive format to zip. Now set the Compression level to store and click OK(if you do not do this your phone will not boot). The settings are in the attached screenshot.
Rename framework-res.zip to framework-res.apk and double check that the compressed size or resources.arsc is the same as the original size (see screenshot)
Done. Push the new framework to your phone.
Click to expand...
Click to collapse
I tried the command you posted and it didnt work because it said it couldn't find the file specified: framework-res so I tried the command from the tutorial you (evilisto) posted, I got a framework-res folder that is empty, now I'm a bit confused, am I supposed to have xmls, in that folder or do I need to decompile the SystemUI.apk now?
ebs512 said:
I tried the command you posted and it didnt work because it said it couldn't find the file specified: framework-res so I tried the command from the tutorial you (evilisto) posted, I got a framework-res folder that is empty, now I'm a bit confused, am I supposed to have xmls, in that folder or do I need to decompile the SystemUI.apk now?
Click to expand...
Click to collapse
you have to use your folder name...
ok then here is simple guide about apk file modifying.
-------------------------------------------------------
1) decompile apk. for example...
Code:
java -jar apktool.jar d SystemUI.apk /(folder_name)
2) edit what you want.
3) recompile apk.
Code:
java -jar apktool.jar b /(folder_name) SystemUI.apk
4) copy what you modified from new SystemUI.apk to original SystemUI.apk
so if you changed something in /res/values, copy new resources.arsc to original SystemUI.apk. (using 7-zip or other program)
if you modified /res/layout or other resources files, copy those to original apk file too.
5) use modified original SystemUI.apk file.
-------------------------------------------------------
basically same to above guide that i quoted.
everytime I decompile the framework-res it puts a subdirectory out of framework-res with nothing in it, I decompile the systemui.apk and there is no res folder, just a bunch of smali code, even when I go back and try to install the framework-res before decompiling, I get:
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
Exception in thread "main" brut.androlib.AndrolibException: Multiple Resources
ebs512 said:
everytime I decompile the framework-res it puts a subdirectory out of framework-res with nothing in it, I decompile the systemui.apk and there is no res folder, just a bunch of smali code, even when I go back and try to install the framework-res before decompiling, I get:
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
W: Config size >32
Exception in thread "main" brut.androlib.AndrolibException: Multiple Resources
Click to expand...
Click to collapse
That's a bug with android 4.0.3. Use google, there is a bug report and an attached updated test apktool.jar for 4.0.3
Sent from my Nexus S 4G using xda premium

[Q]Apktool framework-res.apk

I have a C6943 and i want to change led notification frequency by changing the values in res/values/integer.xml in framework-res.apk.
But when i try to decompile framework with apktool (via pc, or via the phone app) i got a lot of errors like this:
Could not decode attr value, using undecoded value instead:ns=
I already installed the framework and in the apktool app i already set the apktool folder. Don't know what to do..
I can decompile other .apk just got this error in framework
ffp. said:
I have a C6943 and i want to change led notification frequency by changing the values in res/values/integer.xml in framework-res.apk.
But when i try to decompile framework with apktool (via pc, or via the phone app) i got a lot of errors like this:
Could not decode attr value, using undecoded value instead:ns=
I already installed the framework and in the apktool app i already set the apktool folder. Don't know what to do..
I can decompile other .apk just got this error in framework
Click to expand...
Click to collapse
Try with older framework (installed on PC) and install semcgeneric apk to PC as well.
So, install 4.2.2 framework and semcgeneric on PC and try to decompile 4.3 framework.
Sent from my C6903 using Tapatalk
I managed to decompile installing semc apk but now i can't recompile it. I'm getting W:aapt location could not be found and a lot more errors. I'm using apktool v4.4 app. Doing everything from phone
ffp. said:
I managed to decompile installing semc apk but now i can't recompile it. I'm getting W:aapt location could not be found and a lot more errors. I'm using apktool v4.4 app. Doing everything from phone
Click to expand...
Click to collapse
What do you mean - " Doing everything from phone"?
Sent from my C6903 using Tapatalk
I mean that i'm using this app here:
http://forum.xda-developers.com/showthread.php?t=2359240
I managed to decompile and recompile it with success, but i got bootloops even if i didn't changed anything. Already tried signing. What should i do?
ffp. said:
I managed to decompile and recompile it with success, but i got bootloops even if i didn't changed anything. Already tried signing. What should i do?
Click to expand...
Click to collapse
As I can see it needs busybox to be updated and we have informations not to update busybox because we could end up in bootloop or to lose root...
That's why I don't use ninjaMorph or this (great apps but for 535 or 257 firmware)
Sent from my C6903 using Tapatalk

Categories

Resources