yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] V@no:
Total newb here, trying learn how to modify .apk and such, so here is my first question I came up with:

LG Nitro HD has huge resolution 720x1280 and the icons inside framework-res.apk are placed in drawable-xhdpi directory (along with copies of lower resolution in drawable-hdpi)

After using Apk Manger (option 9) it decompiles the .apk but not every directory along with it's content are being extracted (no drawable-xhdpi). Is there something I'm missing?

Thank you.
[G1 Android Development] dully79:
What does the log say?

Do you have have your framework installed?
[G1 Android Development] V@no:
Nothing useful in logs, no errors:

What do you mean by installed framework? It's pulled directly from phone, unmodified stock framework-res.apk.
[G1 Android Development] dully79:
Have you read the the first post?

Have you had a search of the thread for installing framework?

To decompile apk's you need to install the appropriate framework so it can use it as a source for the process.
[G1 Android Development] V@no:
See, this is the problem, you guys are using word "install" with two completely different and unrelated instances.

The ApkManager has option to install, but it's not the "install" you are referring to, isn't it? It's the "if" command that "installs" the framework as %HOMEPATH%\apktool\framework\N.apk (where N is a number) There is no reference on first page, so it might be obvious for hardcore users, but for newbs it's very confusing.

This is why there are so many "newb" questions...:P

Anyway, I got little further with this project, so far no errors, but the result is not successful either...

I did:

pulled all .apk files from /system/framework/

"installed" them with:

Java -jar apktool.jar if framework-res.apk

Java -jar apktool.jar if RES_cappuccino.apk

Java -jar apktool.jar if RES_model.apk

Java -jar apktool.jar if RES_sui.apk

selected SystemUI.apk with option #22 in Apk Manager

decomilled with #9 (no errors)

edited projects\SystemUI.apk\res\layout\status_bar.xml (just changed two numbers to hide carrier name and remove spaces around clock)

selected #11 to compile

pressed "y" as it's system apk

pressed "y" to include originals

deleted keep\res\layout\status_bar.xml

deleted keep\resources.arsc

pushed place-apk-here-for-modding\unsignedSystemUI.apk to /system/app/SystemUI.apk

The result no status bar after reboot. Tried sign it - same result.

Did I do something wrong or missed something?

Log:

Thank you.

[EDIT]

My fault, edited one too many lines.

Now I see that apktool itself changes directories, it adds drawable-320dpi which didn't exist in original .apk and removes drawable-xhdpi, so pressing "y" for second prompt adds the xhdpi folder, but leaves useless drawable-320dpi making final .apk bigger.

With framework-res.apk, since it doesn't ask if we want include the originals, it adds *-320dpi and removes *-xhdpi folders.
[G1 Android Development] V@no:
Ok, it seems apktool is at fault here, it doesn't support ICS, and my phone has similar .apk structure.

Will have to wait for v1.4.4 to come out

[EDIT]

After replacing aapt.exe from this reply everything is working fine!

http://xdaforums.com/showpost.php?p=20633881&postcount=1502
[G1 Android Development] Daneshm90:
K so i posted the video cuz ppl kept saying its outdated. If someone on linux cud create one for the linux version that would be great :) Btw just uploaded give it some time, also i uploaded 4.7 with a small fix, if u notice it kept askin u to "press enter to continue" for every step. Its fixed.
[G1 Android Development] FrozenData:
Lol, that was stupid of me.. Thanks. :)

EDIT: Btw, thanks for making Apk Manager, its superb.
[G1 Android Development] bmfc187:
hey im still trying to get this to work on my ubuntu laptop...and i dunno what happened but it quit working for me on windows but id rather have it working on ubuntu since thats my main computer...anyway i decompiled Calendar.apk and made an edit but i cant get it to compile it back...i keep getting these errors, this time i can actually show you them tho...lol i have attached a log.txt...please take a look...

-BMFC
[G1 Android Development] Daneshm90:
K so it decompiles/compiles without change fine ? So what exactly did u edit ? Like wht file ?

K nvm, looks like u tried to edit values/styles.xml ??? did u add/remove/modify or insert a whole different file ?

Also for windows version, are u referring to 4.7 thats not working ? or previous version stopped working ?
[G1 Android Development] bmfc187:
It decompiles fine. i deleted my out folder and decompiled and tried to recompile without changing anything and it still wouldnt compile.

i didnt touch styles.xml...thats why i dont understand the errors im getting...i editted colors.xml and i only changed two values...

The previous version (4.6) i had JUST gotten it working with com.htc.resources.apk, and then it worked once with the Calendar.apk that im trying to edit now, i made a couple edits to the colors.xml file and compiled it and threw it into my update and flashed it fine...then i didnt really like a change i made so i went back to tweak it a bit and when i tried to recompile it again it freaked out on me...

i downloaded the new v4.7 and tried and it wont do it either...

-BMFC
[G1 Android Development] Daneshm90:
K 2 things.

1. Try removing the folder apktool creates with framework/1.apk. In windows its under c:\users\urusername\apktool. Then start from scratch.

2. Kill all instances of adb, download apk manager 4.7, extract, place Calendar.apk (unmodified) inside modding folder, run script, run decompile, run compile. If u get errors let me know, if u dont then try modifying and then recompile. Im doing this so i know its not something u did previously, easier to diagnose.
[G1 Android Development] bmfc187:
still same list of errors....

-BMFC
[G1 Android Development] Daneshm90:
K, can u upload the log that was created by apk manager 4.7 ?

Hmm that is just strange. Im just spitballing, but could it be you have an older version of java or something ?
[G1 Android Development] Brut.all:
bmfc, what is above these errors? If nothing... Daneshm90, are you sure Apk Manager doesn't eat anything, that apktool outputs? bmfc, try to use apktool directly.
[G1 Android Development] bmfc187:
@brut.all, ive tried, it gave me the same list of errors i posted above...im using it in ubuntu, im pretty sure i have everything setup right...i have com.htc.resources.apk renamed to 2.apk in ~/apktool/framework, i have the sdk tools dir. in my PATH, im using 1.6 jvm, i have deodexed the odex file and recompiled it without changes into a classes.dex file and then placed into the root of the .apk. it decompiles fine, but i cant put it back for sh*t...

-BMFC
[G1 Android Development] Brut.all:
Run "aapt d resources /home/bmfc/apktool/framework/1.apk" - you should get a lot of output, so better to pipeline it to "less" command or save to disk. Then check whether there is e.g. "layout_width" string in it.

And once again: are there anything above these errors? I ask because there should be some logs from apktool and they aren't in your log.txt file.
[G1 Android Development] bmfc187:
yeah im sure there was more but it ran out the top of the terminal and thats all i could get of it...

-BMFC
[G1 Android Development] Daneshm90:
@brut.all, well this is wht i have for decompiling

cd other
DEL /Q "../place-apk-here-for-modding/repackaged.apk"
DEL /Q "../place-apk-here-for-modding/repackaged-signed.apk"
DEL /Q "../place-apk-here-for-modding/repackaged-unsigned.apk"
rmdir /S /Q "../out"
echo Decompiling Apk
java -Xmx%heapy%m -jar apktool.jar d ../place-apk-here-for-modding/*.apk ../out
if errorlevel 1 (
echo "An Error Occured, Please Check The Log (option 20)"
PAUSE
)
cd ..
goto restart

For compiling i have

cd other
echo Building Apk
java -Xmx%heapy%m -jar apktool.jar b ../out "%~dp0place-apk-here-for-modding\repackaged-unsigned.apk"
if errorlevel 1 (
echo "An Error Occured, Please Check The Log (option 20)"
PAUSE
)
cd ..
goto restart

Plus i can decompile/compile apks such as Calendar.apk fine, whereas hes having issues.
[G1 Android Development] Brut.all:
So there wasn't too much sense in copying these above errors, because they were most probably caused by some other error.

Try "apktool b | less", "apktool b > log.txt", change settings of your terminal to display more lines or do something else to read first lines of output. We can't help you without most important error, which is nearly always the first one.
[G1 Android Development] Daneshm90:
Wait with apk M 4.7, does ur log.txt not show the full error from apktool ?
[G1 Android Development] bmfc187:
W/ResourceType( 4909): Bad string block: last string is not 0-terminated

-BMFC
[G1 Android Development] Brut.all:
Yeah, now I can help you ;-)

I think you are using older aapt tool - you should download newest apktool-install package. But... you said you have installed apktool recently and I think Daneshm90 embeds newest aapt so... maybe this is something else.
[G1 Android Development] bmfc187:
ok it made the bad string block error go away but all the others remain...

-BMFC
[G1 Android Development] Brut.all:
Ok, but what you exactly did? Did you got this above error when running "aapt d resources" or was it in first lines of errors? If "aapt d resources" and now you are using Apk Manager, then use apktool directly. Apk Manager has its own aapt tool, so even if you have updated one in your system, Apk Manager does not use it, but still this older one.
[G1 Android Development] Daneshm90:
Or just delete aapt from the other folder so apk manager picks it up from ur path.
[G1 Android Development] alejobog:
I have also done the same and I work with all ICS apk, the problem is in the framework-res.apk follows me out error, any solution, thanks
[G1 Android Development] ssconceptz:
Solved.....
[G1 Android Development] max-555:
Hi All,

I'm newman with apk job.

I have tried to change just icon image for this apk using 4.9 manager but don't have success. Error message with java :)

Could somebody assist and change icon in this app to attached png. It will be very helpfully.

Many thanks in advance

Regards

Max
[G1 Android Development] ssconceptz:
To change icons just extract the apk with 7zip, modify it and then open the apk with 7zip and drag the new icon in. No need to use apk manager for that.

But your problem is probably due to not decompiling with dependencies. In your case that's framework-res.apk.
[G1 Android Development] max-555:
I have tried again to change icon. but without success.

I can change it but apk don't let me install. Is that possible to change the icon for me please. It will be sehr great. Herewith I attach a new icon for this.

Thank you again for your help :)
[G1 Android Development] seimu:
Error compile whatsapp

Hi, I'm making themes for whatsapp, and using the apkmanager everything works fine when only change the png (options 1, 3 and 4). The problem comes when decompile with option 9 (to modify a xml file for the font color) and not even change any xml, compiled with option 11 and it gives me error. I leave the log. I need help. Thx!!

I: Baksmaling...
I: Loading resource table...
I: Decoding resources...
I: Loading resource table from file: C:\Users\SeRGi0\apktool\framework\1.apk
I: Copying assets and libs...
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" java.lang.NullPointerException
at org.jf.util.PathUtil.getRelativeFile(Unknown Source)
at org.jf.smali.smaliFlexLexer.getSourceName(Unknown Source)
at org.jf.smali.smaliFlexLexer.getErrorHeader(Unknown Source)
at org.jf.smali.smaliFlexLexer.nextToken(Unknown Source)
at org.antlr.runtime.CommonTokenStream.fillBuffer(Unknown Source)
at org.antlr.runtime.CommonTokenStream.LT(Unknown Source)
at org.jf.smali.smaliParser.smali_file(Unknown Source)
at brut.androlib.mod.SmaliMod.assembleSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.DexFileBuilder.addSmaliFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.buildFile(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.src.SmaliBuilder.build(Unknown Source)
at brut.androlib.Androlib.buildSourcesSmali(Unknown Source)
at brut.androlib.Androlib.buildSources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
[G1 Android Development] grotesque02:
I download all sdk, but I always have this error (choose apk, decompile, compile and say error), why?

C:\ApkManager4.9\other\..\projects\xyz.apk\AndroidManifest.xml:4: error: N
o resource identifier found for attribute 'xlargeScreens' in package

'android'
Exception in thread "main" brut.androlib.AndrolibException:

brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\userx\AppData\Local

\Temp\A
PKTOOL6014368078604776546.tmp, -I, C:\Users\userx\apktool\framework\1.apk,

-S, C
:\ApkManager4.9\other\..\projects\xyz.apk\res, -M, C:\ApkManager4.9\other\
..\projects\xyz.apk\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)
at brut.androlib.Androlib.buildResourcesFull(Unknown Source)
at brut.androlib.Androlib.buildResources(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.androlib.Androlib.build(Unknown Source)
at brut.apktool.Main.cmdBuild(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F,

C:\U
sers\userx\AppData\Local\Temp\APKTOOL6014368078604776546.tmp, -I, C:\Users

\userx
\apktool\framework\1.apk, -S, C:\ApkManager4.9\other\..\projects\xyz.apk\r
es, -M, C:\ApkManager4.9\other\..\projects\xyz.apk\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more
Premere un tasto per continuare . . .
[G1 Android Development] _Sparks:
I dont understand this. Can some one plz help me I get the following error when I try to decompile the apk:

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

|02/01/2012 -- 12:51:35.71|

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

'java' is not recognized as an internal or external command,

operable program or batch file.

Could Not Find C:\Users\All\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedsignedframework-res.apk

Could Not Find C:\Users\All\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedsignedframework-res.apk

'java' is not recognized as an internal or external command,

operable program or batch file.

Could Not Find C:\Users\All\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedsignedframework-res.apk

Could Not Find C:\Users\All\Downloads\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedsignedframework-res.apk

'java' is not recognized as an internal or external command,

operable program or batch file.

SOLVED: I HAD TO ADD JAVA TO SYSTEM PATH: link
[G1 Android Development] nikhilshivpuja:
help please

sorry it was the damned spaces in the name

this is the first time i am using this tool , i want ot edit the code of this apk , so i copied the apk into the apk to be modded folder , run the script choose option 9 , and the window closes

The log says the following :

java version "1.6.0_27"

Java(TM) SE Runtime Environment (build 1.6.0_27-b07)

Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)

2.2.3.apk==None was unexpected at this time.

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

|04-01-2012 -- 19:50:49.15|

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

java version "1.6.0_27"

Java(TM) SE Runtime Environment (build 1.6.0_27-b07)

Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)

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

|04-01-2012 -- 19:52:13.49|

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

please help
[G1 Android Development] jmbillings:
After some quick pointers here. I'm testing out a quick change to an image in SystemUI.apk. I got the file, dropped it in the modding folder, unzipped, edited a png, saved, optimized, zipped and zipaligned. All that worked well.

I then tried the adb push option (as I assume SystemUI.apk is a system file?) and it failed. Here is the screen output:

Please make your decision:8
Where do you want adb to push to and as what name
Example of input : /system/app/launcher.apk
Type input: /system/app/SystemUI.apk
Waiting for device
remount failed: Operation not permitted
Pushing apk
"An Error Occured, Please Check The Log (option 21)"
Press any key to continue . . .

but in the log, I see this:

--------------------------------------------------------------------------
|05/01/2012 -- 9:40:00.96|
--------------------------------------------------------------------------
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02, mixed mode)
cannot stat 'place-apk-here-for-modding\unsignedSystemUI.apk': No such file or directory

So it's looking for a file called "unsignedSystemUI.apk". That doesn't exist, the file is still called the same as the original.

I zipped a second time, and now it created the above file, but when I now do adb push it's looking for "signedSystemUI.apk" instead?!
[G1 Android Development] vali_ics:
Guys , i have a problem.

When i wanna extract an apk , that window close in the next moment.

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

|Sat 01/07/2012 -- 21:46:26.23|

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

java version "1.7.0_02"

Java(TM) SE Runtime Environment (build 1.7.0_02-b13)

Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)

Launcher_v0.5.1.apk==None was unexpected at this time.

But this problem is only for this apk, with others work flawless...

What i can do ?
[G1 Android Development] Ajthescot:
Guys with unknown source errors try installing a newer framework. one from ics. grab a g nexus rom and rip it from that.

I had the same error on Google plus app and the framework from that fixed it
[G1 Android Development] selaludiam:
when i compile SemcGenericUxpRes

aapt.exe crash

so compile failed

even i don't change anything on it

i've try to decompile and compile framework-res and success
[G1 Android Development] onasri15:
It can't find my systemui.apk in the place here for signing folder even though its there. What do I do?

---------- Post added at 10:04 PM ---------- Previous post was at 09:52 PM ----------

I renamed to signed.apk to fix the error and now whenever I try to sign it keeps disappearing. Nowhere to be found on my desktop. Someone please help?
[G1 Android Development] hackersdoom13:
currently using newest apktool and apk maanger. i decoded an apk and made a few changes but i cant seem to figure out the correct command to type in cmd for compiling. i cd'd to C:\apk manager\other

the directory of the revised/decoded apk is C:\apk manager\place-apk-here-for-modding\music.apk

what should i type in cuz it always says file could not be found
[G1 Android Development] chrisexv6:
Just starting with this so pardon the possible dumb question:

If I extract an APK, then immediately zip the APK....how come its ending up a different size than the original? Nothing changed obviously. Just trying to get a baseline of exactly how to extract, change some images, then rebuild the APK.

I havent tried installing it or running it on an emulator but I assume its NOT going to work.

Any ideas what I could be doing wrong?

Thanks.

-Chris
[G1 Android Development] dully79:
That's because your compressing the apk inside the zip.

You can't install the zip like an apk. You also can't extract the files from a market apk, re zip them and install it as it'll break the signature.
[G1 Android Development] _Sparks:
How do I sign an apk, I placed the apk in "Place here for signing" folder. And then when I open the script, and select sign apk, it doesnt work!
[G1 Android Development] xTremePower:
Hello, I decompiled an APK,

moded xml inside,

compiled

signed

when I try to install it on the phone, he try installing and " aplication not installed"

the original apk work good
[G1 Android Development] heart_crafter:
try this...

open compiled apk with winrar

extract out resources.arsc

insert it back in with no compression (store)

then sign and install...

i was having this problem on framwork-res.apk(no need to sign system apks)... for some reason my rom doesnt like compressed resources.arsc

let us know if it worked. or hit the thanks button.

---------- Post added at 11:08 PM ---------- Previous post was at 11:04 PM ----------

read my last post...
[G1 Android Development] draexo:
apk selected, will not decompile

When I select my APKs and decompile them they give these errors:

First it says "decompiling APK" Then it says ""The Error Occurred, Please Check The Log"

When I check the logged,I get this:

java version "1.7.0_02"

Java(TM) SE Runtime Environment (build 1.7.0_02-b13)

Java HotSpot(TM) 64-Bit Server VM (build 22.0-b10, mixed mode)

Could Not Find C:\android\place-apk-here-for-modding\../place-apk-here-for-modding/signedSystemUI.apk

Could Not Find C:\android\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedSystemUI.apk

I: Baksmaling...

I: Loading resource table...

I: Decoding resources...

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

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

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

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

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

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

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

at brut.androlib.res.data.ResPackage.getResSpec(Unknown Source)

at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)

at brut.androlib.res.data.ResTable.getResSpec(Unknown Source)

at brut.androlib.res.data.value.ResReferenceValue.getReferent(Unknown Source)

at brut.androlib.res.data.value.ResReferenceValue.toResXmlFormat(Unknown Source)

at brut.androlib.res.data.value.ResAttr.convertToResXmlFormat(Unknown Source)

at brut.androlib.res.decoder.ResAttrDecoder.decode(Unknown Source)

at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(Unknown Source)

at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValue(Unknown Source)

at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(Unknown Source)

at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Unknown Source)

at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(Unknown Source)

at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(Unknown Source)

at brut.androlib.res.decoder.ResFileDecoder.decode(Unknown Source)

at brut.androlib.res.AndrolibResources.decode(Unknown Source)

at brut.androlib.Androlib.decodeResourcesFull(Unknown Source)

at brut.androlib.ApkDecoder.decode(Unknown Source)

at brut.apktool.Main.cmdDecode(Unknown Source)

at brut.apktool.Main.main(Unknown Source)