yashsingh1/xdaforums huggingface dataset:
[Galaxy S II Themes and Apps] nomad_pl:
Decompile Phone.apk with Apk Manager ICS

I'm trying to decompile Phone.apk, but something is wrong.

Here my log.

What is wrong.

--------------------------------------------------------------------------

|2012-04-30 -- 22:22:29,34|

--------------------------------------------------------------------------

java version "1.6.0_31"

Java(TM) SE Runtime Environment (build 1.6.0_31-b05)

Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

Nie można odnaleźć D:\Samsung\I9100\Apk_Manager_ICS\place-apk-here-for-modding\../place-apk-here-for-modding/signedPhone.apk.

Nie można odnaleźć D:\Samsung\I9100\Apk_Manager_ICS\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedPhone.apk.

I: Loading resource table...

W: Skipping "android" package group

I: Loaded.

I: Loading resource table from file: C:\Users\Robert\apktool\framework\1.apk

I: Loaded.

I: Decoding file-resources...

I: Loading resource table from file: C:\Users\Robert\apktool\framework\2.apk

W: Could not decode attr value, using undecoded value instead: ns=android, name=textColor, value=0x0205009a

I: Loading resource table from file: C:\Users\Robert\apktool\framework\2.apk

W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x0207000f

I: Loading resource table from file: C:\Users\Robert\apktool\framework\2.apk

W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x0207000e

I: Loading resource table from file: C:\Users\Robert\apktool\framework\2.apk

W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x0207000f

I: Decoding values*/* XMLs...

I: Loading resource table from file: C:\Users\Robert\apktool\framework\2.apk

Exception in thread "main" brut.androlib.AndrolibException: Expected pkg of id: 2, got: 1

at brut.androlib.res.AndrolibResources.loadFrameworkPkg(AndrolibResources.java:91)

at brut.androlib.res.data.ResTable.getPackage(ResTable.java:72)

at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)

at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:51)

at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:59)

at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)

at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:54)

at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(ResScalarValue.java:71)

at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)

at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)

at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)

at brut.apktool.Main.cmdDecode(Main.java:128)

at brut.apktool.Main.main(Main.java:65)
[Galaxy S II Themes and Apps] xinfinityoO:
read previous page
[Galaxy S II Themes and Apps] m1keyb:
It looks like you've not got your framework setup correctly, it should look something like Users\Davide\apktool\framework\1.apk
[Galaxy S II Themes and Apps] shayne77:
apktool if framework-res.apk

then

apktool d Phone.apk
[Galaxy S II Themes and Apps] .malo2000:
It don't work for me :'(

I wanama and thanks for yours hard works ;)

I tried to decompiled my systemui.apk with your app, but it doesn't work for me :(

there are the logs of my errors http://db.tt/RwxsxyaN

Could you watch for them?

Thanks
[Galaxy S II Themes and Apps] Siberian Tiger:
I think you have some corrupted 9.png files(pull them out on your desctop and replace them with good ones and when you compile put them back in)

and I think you forgot to put the png files of the battery in drawable folder.

If this for deodexed I might can help you.I just need the systemUI and tell me what changes you want :)
[Galaxy S II Themes and Apps] Mr.Greg:
Anyone now how to recompile a phone apk to work on 160dpi? I'm on D4 rom tried a few phone apk found on xda forums but didn't work. Tried with ics and others apk tool, system ui, framework, but no succes. Apk was rebuild succeseful but when I copy in system app, won't work. I now I'm doing something wrong but dunno what. Any help much apreciate
[Galaxy S II Themes and Apps] Siberian Tiger:
I think but i don't know for sure phone.apk needs to decompile with dependencies .(selection 10 and tw-framework)
[Galaxy S II Themes and Apps] Mr.Greg:
I tried to find in many threads ho to do this but nobody want to share how to do. Sad... I don't have this skills. Thanks for reply mate.
[Galaxy S II Themes and Apps] .malo2000:
thanks

Thank you for the answer ;)

I'll try to do what you suggest and I'll tell you if it works :p

I'd like try to solve my problems by myself....if I don't solve I'll tell you

Thanks ;)

EDIT: I tried to put out from my systemui.apk the drawable-hdpi folder and the log is http://db.tt/Fv8sLPRE

I decompiled also with 9 command and with 10 ones.... I change smali and xml, when I compiled with 11 command it seems go well, I remove resources.arsc from keep folder and I found usignedSystemui.apk in the folder where I'd put the original apk. I rename this file with systemui.apk and I put it on my phone. I replace the original one in system/app, I reboot and...it don't work :'(

Any idea ?

Thanks for your time ;)
[Galaxy S II Themes and Apps] Siberian Tiger:
When you say don't work you mean bootloop or it just doesn't change anything?

What exactly you are trying to change?
[Galaxy S II Themes and Apps] .malo2000:
Sorry if I don't specify...in reboot I have a text message "systemui process has been locked..." I think for the english version it is like this :rolleyes: in italian it is "systemui è stato arrestato"

Thanks for the replay

I try to do trasparent statusbar bymyself ... o_O

I have work fine on phone.apk and mms.apk, but systemui.apk make me like a devil :o

Edit: I have change rom...it seems a little better ;) I don't modify thae status bar with the change of yhe guide http://xdaforums.com/showthread.php?t=1523703 :'( but systemui.apk now can be decompiled and compiled without errors :D
[Galaxy S II Themes and Apps] iBotPeaches:
Was this a source rebuild or just various hacked together fixes? If you build smali/baksmali 1.3.3 into apktool you can fix the magic errors.

As for the random other errors. Your XML is wrong, which apktool 1.4.6 fixes.
[Galaxy S II Themes and Apps] Kiwicrank:
You are the MAN!!!! Cannot believe how many versions I have tried and yours WORKED!!! framework-res.apk xwlp7...GOOD WORK!:)
[Galaxy S II Themes and Apps] myn:
Awesome :)

Was having issues with my framework-res.apk in 4.0.3.

Works perfectly now with your modded apktool.

Huge thanks.
[Galaxy S II Themes and Apps] toxicOne:
Great tool for themers ... I love it this &the xda auto apk tool ... Makes my themer live easier ...;)

Thanks mate

FFX-Crew GreyFoxV2 on GT-i9100 via Tapatalk ICS SkyBlue
[Galaxy S II Themes and Apps] rachelm920:
Thank you!! Worked like a charm!! Finally!!!!!!!!!!!
[Galaxy S II Themes and Apps] kramer04:
hi all

i try to compile Phone.apk with Wanam APk Manager but have many errors :

I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-de\strings.xml:197: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-de\strings.xml:198: error: Unexpected end tag string
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-es\strings.xml:201: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-es\strings.xml:202: error: Unexpected end tag string
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-es-rUS\strings.xml:197: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-es-rUS\strings.xml:198: error: Unexpected end tag string
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-it\strings.xml:201: error: Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res\values-it\strings.xml:202: error: Unexpected end tag string
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Liloo\AppData\Local\Temp\APKTOOL4367613267162488869.tmp, -I, C:\Users\Liloo\apktool\framework\1.apk, -S, E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res, -M, E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Liloo\AppData\Local\Temp\APKTOOL4367613267162488869.tmp, -I, C:\Users\Liloo\apktool\framework\1.apk, -S, E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\res, -M, E:\Program Files (x86)\Android\android-sdk\other\..\projects\Phone.apk\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more

any ideas of what happens and how to solve it ? :)
[Galaxy S II Themes and Apps] DROCSID:
Thanks mate!
[Galaxy S II Themes and Apps] .malo2000:
I have only one question about apktool (and also apkmanager), I don't have problem decompiling e compiling systemui.apk by wanam deodex stock roms. When I decompile other systemui (wanam themated rom or other costum rom) when I compiled them I have in the log some a brut.... error :'( I install framework-res twframework-res and lidroid-res in "other" folder with comand prompt... I have to install some other apk? I need other resources from the rom? Thanks for the reply

Inviato dal mio GT-I9100 usando Tapatalk
[Galaxy S II Themes and Apps] wanam:
What errors do you get?
[Galaxy S II Themes and Apps] .malo2000:
I wanam and thanks for the reply ;)

I have this error in the log

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Silvia\AppData\Local\Temp\APKTOOL851122294979822652.tmp, -I, C:\Users\Silvia\apktool\framework\1.apk, -S, C:\Users\Silvia\Desktop\Apk_Manager_ICS\other\..\projects\SystemUI.apk\res, -M, C:\Users\Silvia\Desktop\Apk_Manager_ICS\other\..\projects\SystemUI.apk\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)

at brut.androlib.Androlib.buildResources(Androlib.java:248)

at brut.androlib.Androlib.build(Androlib.java:171)

at brut.androlib.Androlib.build(Androlib.java:154)

at brut.apktool.Main.cmdBuild(Main.java:182)

at brut.apktool.Main.main(Main.java:67)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Silvia\AppData\Local\Temp\APKTOOL851122294979822652.tmp, -I, C:\Users\Silvia\apktool\framework\1.apk, -S, C:\Users\Silvia\Desktop\Apk_Manager_ICS\other\..\projects\SystemUI.apk\res, -M, C:\Users\Silvia\Desktop\Apk_Manager_ICS\other\..\projects\SystemUI.apk\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:83)

and if I try with a deodex stock I don't have it. Could it depend from the lidroid-res.apk? I have installed it in "others" folder with comand prompt.... I don't know :confused: but something in the two systemui (Stock and themed) is different and give me error :(
[Galaxy S II Themes and Apps] wanam:
I need the errors list before this exception.
[Galaxy S II Themes and Apps] .malo2000:
So...there is the complete log file ;)

http://db.tt/RwxsxyaN

I have take systemui.apk,framework-res.apk,twframework-res.apk and lidroid-res.apk from your GT-I9100_WanamLite.XWLP9.V11.3.NO-WIPE rom; I have copied them in "other" folder; I have installed them by command prompt in "other" folder; I have decompiled systemui and compiled without change (only for test) and it hasn't compiled :(

What is wrong? why I can decompile e compile without errors yours stock roms?

Thanks for the time you spent on me and for your fantastic job ;)
[Galaxy S II Themes and Apps] wanam:
You have to fix the 9patch files or just remove the zero size pngs (5 files on drawable-hdpi folder) and recompile.
[Galaxy S II Themes and Apps] .malo2000:
Thank you for the reply ;) I try to remove them (I don't know how to fix them :p )

EDIT: I love you <3 <3 <3 you are simply the best (like said Tina Turner)

THANK YOU
[Galaxy S II Themes and Apps] agat63:
Check the string values in specified xml files and lines.

For instance in lines 197 and 198 of values-de/string.xml.

Something wrong in line syntax.

Same happens in values-es (spanish) and values-it (italian).

If you have more values-xx like for english language compare the lines with it or any other string.xm from a different language pack in your phone.apk that did compile correctly and didn't trow an error.

Edit syntax to look same and leave the language as is.

Errors should go away and app will compile correctly.

---------- Post added at 02:38 PM ---------- Previous post was at 02:27 PM ----------

My apologies to xtremsv first.

If you thing it's out of line let me know and I'll delete this post.

I don't mean to hijack this thread but would like to offer to try AutoAPKtool made by xaveirjohn and modified by me.

Added menu items to decompile/recompile ICS apps and menu lines for backsmali/smali dex and jar files from this thread:

Universal Multipurpose APK Tool.

Has been tested on many E4GT ICS leaks.
[Galaxy S II Themes and Apps] agat63:
In public xml files for different languages change line 79 entry from %d.......%d to %1$d..........%2$d
[Galaxy S II Themes and Apps] KBizzle:
So every one of those language locations?
[Galaxy S II Themes and Apps] agat63:
In all listed in your error log
[Galaxy S II Themes and Apps] KBizzle:
Its weird how that happens on just a simple decompile/recompile without changes. You would think it would have never compiled the first time.

EDIT: I was dreading having to go through every one of those and making the change, so I just changed the values folder only and it compiled. Worked like a charm. Thank you guys.
[Galaxy S II Themes and Apps] shayne77:
Tip:

Decompile with APK Tool 1.4.2 and Recompile with APK Tool 1.4.3...

Bet you don't get the error

=]
[Galaxy S II Themes and Apps] eybee1970:
compiling ICS is really crap, especially with framework-res....I hope someone will find a solution without having to correct multiple strings after running in errors before it recompiles successfully :(
[Galaxy S II Themes and Apps] USMC retired:
apktool

Is there suppose to be a apktool here for ICS to download? Or am I blind and am just not seeing it.
[Galaxy S II Themes and Apps] DJBoxer:
first post there is 2 attachments or use this one by WANAM

which works perfect ;)
[Galaxy S II Themes and Apps] kyo_udon:
i'm new to theming and i'm trying to mod the phone.apk to show a bigger caller screen. can anyone guide me on how to do it?

been looking around but i just want the phone.apk themed and not other apps as well.
[Galaxy S II Themes and Apps] .malo2000:
log error wanam apk manager

Hi everyone ;) I'm another time in trouble recompiling with apkmanager by wanam :p

I have decompiled lidroid-res.apk and I have no apparent trouble recompilig it after xml modifications. But it don't work (systemui locked at reboot :( )

I read the log http://db.tt/RwxsxyaN it says "W: Could not find sources"....

Is it the problem? How can I solved it?

Thanks everyones ;)
[Galaxy S II Themes and Apps] KBizzle:
Try taking the meta-inf, androidhost.xml, classes.dex and resources out of the original apk using 7zip and replacing them back into your newly compiled apk.
[Galaxy S II Themes and Apps] .malo2000:
Thanks for the reply, but in lidroid-res (like framework-res and twframework-res) there isn't classes.dex and androidhost.xml...:( there is only resources.arsc and androidmanifest.xml (with res folder and meta-inf folder)

Any other idea???? :p

Thanks
[Galaxy S II Themes and Apps] wanam:
Did you set it as 2nd resources framework? take a look here.
[Galaxy S II Themes and Apps] .malo2000:
You are fantastic <3 Thanks for your works :-*
[Galaxy S II Themes and Apps] astoncheah:
hi all,

i tried to decompile camera.apk and i got this:

any idea?
[Galaxy S II Themes and Apps] sam1974:
I can decompile, but not recompile my framework-res, this is error log :

C:\apktool>apktool if framework-res.apk

I: Framework installed to: C:\Users\Black\apktool\framework\1.apk

C:\apktool>apktool d framework-res.apk

I: Loading resource table...

I: Loaded.

I: Decoding file-resources...

I: Decoding values*/* XMLs...

I: Done.

I: Copying assets and libs...

C:\apktool>apktool b framework-res

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

aapt: warning: string 'gps_assisted_data_download' has no default translation in

C:\apktool\framework-res\res; found: ko

aapt: warning: string 'policydesc_allow_htmlemail' has no default translation in

C:\apktool\framework-res\res; found: en_US

aapt: warning: string 'policylab_allow_htmlemail' has no default translation in

C:\apktool\framework-res\res; found: en_US

aapt: warning: string 'wifi_p2p_pbc_go_negotiation_request_message' has no defau

lt translation in C:\apktool\framework-res\res; found: en_GB es pt

aapt: warning: string 'wifi_p2p_pin_display_message' has no default translation

in C:\apktool\framework-res\res; found: en_GB es pt

aapt: warning: string 'wifi_p2p_pin_go_negotiation_request_message' has no defau

lt translation in C:\apktool\framework-res\res; found: en_GB es pt

I: Building apk file...

C:\apktool>

Someone can help me?
[Galaxy S II Themes and Apps] shayne77:
They are warnings not a failed recompile... look at the last line: "I: Building apk file..."

It successfully built an apk file.

Those warnings, you can ignore. They just mean some things are missing from those languages.
[Galaxy S II Themes and Apps] sam1974:
But, when i replace framework-res.apk in system/framework , with root explorer, i reboot my phone and stay on boot logo.
[Galaxy S II Themes and Apps] shayne77:
You never use the recompiled APK.

You always take the original APK and copy in only the changed xml's etc.

Try that and see how you go.
[Galaxy S II Themes and Apps] sam1974:
Its works !! thanks a lot my friend !!
[Galaxy S II Themes and Apps] shayne77:
You're welcome.
[Galaxy S II Themes and Apps] amidabuddha:
Weird error

Exception in thread "main" brut.androlib.AndrolibException: Arsc files with zero or multiple packages

Guys any ideas? I have turned Google upside down but cannot find a similar error, except one for GB where a guy says the apk is not deodexed. Well my is and got this. I am using Wanam's ApkManager but replaced the apktool.jar because of the bad magic value error. The other apk's seems to decompile fine...This is a file of Sense4a so there may be some unknown novelties there
[Galaxy S II Themes and Apps] agat63:
Can you post the full error?

What comes before this line?

Does it happen on decompile or recompile?

Did you try to use tool from this thread:

http://xdaforums.com/showthread.php?t=1577025

Little bit more info might help us to help you.
[Galaxy S II Themes and Apps] amidabuddha:
Thank you for this reply

The file is HtcDialer.apk from Sense4a - a HTC Primo port (probably this is the problem). I have loaded all the apk files that I found in the framework folder of my device. Here is a link of the apk and the framework files

The full error is not much (it was given with the ApkManager by wanam):

java version "1.7.0_03"
Java(TM) SE Runtime Environment (build 1.7.0_03-b05)
Java HotSpot(TM) Client VM (build 22.1-b02, mixed mode, sharing)
I: Framework installed to: C:\Users\Stefan\apktool\framework\1.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Arsc files with zero or multiple packages
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:67)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)

I have used the tool linked by you and got the bad magic value error. I have managed to get rid of it by removing classes dex from the apk and decompiling again but now it stucks at:

Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x020a0049

I have just noticed that in the log that only 2 of the 4 frameworks files are loaded. Is it possible to add an option to the apktool to use them all?
[Galaxy S II Themes and Apps] agat63:
Tool linked by me has a menu option "Decompile ICS app" and that option should not give you bad magic value error. You should use ICS option I guess.

You can add more framework file to apk tool with option 81 or somewhere around there in tool menu. "add additional framework"

Try both a let me know. Make sure you using version 2.0.4a of my modified tool.

It has been updated with aapt.exe from API-15 (ICS) from windows-sdk.
[Galaxy S II Themes and Apps] amidabuddha:
For my previous post I have used v 2.0.4a with option 14 Decompile ICS apk

by additional frameworks i mean this:

I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Stefan\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Loading resource table from file: C:\Users\Stefan\apktool\framework\2.apk
W: Config flags size > 36. Exceeding bytes: 0x2000000.

The apktool is using only 1 and 2 even when all 4 of them are loaded. I meant how to add the number of used framewroks in the apktool code...I remember there was a thread that someone pointed the need of the second framework in the past (the previous versions used only framework-res.apk) Now a time comes to use 4 of them... :)
[Galaxy S II Themes and Apps] agat63:
Never had an HTC device and kinda having hard time now to sort things out.

I read somewhere that HTC need a rosie (or something like that) to be installed as framewor to build up dependencies. I guess it should be somewhere in /system/framework folder.

By all means you should know more about HTC but concider this and act of desperation. Did you intall that as framework as well?

I'm dealing with apps on daily basis and don't have problems with tool but I'm on E4GT so I might be not much help here.

Sorry bro.

Edit: Would you please post full error message. May be something will hint to what's going on.
[Galaxy S II Themes and Apps] amidabuddha:
Here you go.

I hope there will be something
[Galaxy S II Themes and Apps] agat63:
I never saw a windows error before.

In general it looks like there is a missing framework that windows incompatibility error kinda confuses me.

I think you should try to consult another HTC dev/themer.

My read is missing framework and I don't know what files are needed for HTC.

For samsung we need framework-res.apk and twframework-res.apk.

Dunno what files are needed in your case.

Guess I wasn't of much help here.

Did you install that rosie.something.something app?