yashsingh1/xdaforums huggingface dataset:
[Android Software Development] ag4751:
I tested various apktool, aapt versions and found that these appear to work if you want to give it a try, the apktool is version 1.5.2 and the aapt the latest version for apktool.

Run the if apktool commands for both frameworks, then decompile the LGSystemUI.apk.

This was the decompile result

C:\APK_Others>apktool d LGSystemUI.apk

I: Baksmaling...

I: Loading resource table...

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

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

I: Loaded.

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

I: Loaded.

I: Regular manifest package...

I: Decoding file-resources...

I: Decoding values */* XMLs...

I: Done.

I: Copying assets and libs...

This was the compiling result without making any changes, I only got translation warning which don't cause any problems

C:\APK_Others>apktool b LGSystemUI

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

warning: string 'compat_mode_help_body' has no default translation.

warning: string 'compat_mode_help_header' has no default translation.

warning: string 'jelly_bean_dream_name' has no default translation.

warning: string 'miniview_exception_msg' has no default translation.

warning: string 'quick_settings_wifi_display_label' has no default translation.

warning: string 'quick_settings_wifi_display_no_connection_label' has no default translation.

warning: string 'sp_quicksettings_volume' has no default translation.

warning: string 'status_bar_help_text' has no default translation.

warning: string 'status_bar_help_title' has no default translation.

I: Building apk file...

C:\APK_Others>

I can’t test it fully as I don’t have an LG but thought you may want to give it a try, I don’t use apkmultitool either

Download file

[MENTION=3924617]iBotPeaches[/MENTION]

Just for your info Connor.
[Android Software Development] Ticklefish:
Most likely. This commit won't be in the latest public version of apktool yet. Not until Beta 10 comes out.

Or you could always build a copy of apktool yourself..
[Android Software Development] Lgrootnoob:
Yea, I hit Ibot up on irc and he told me to compile from git source.

---------- Post added at 12:28 PM ---------- Previous post was at 12:28 PM ----------

Thanx man!

Why is the file malicious though?
[Android Software Development] ag4751:
Which file
[Android Software Development] ag4751:
Must be something in the settings in your version of Chrome, I use both Chrome and IE and neither gave me a warning.

Can't help you with the other issue though, sorry. Unless you have made a lot of changes have you tried putting them into a copy of your unmodified apk and installing that one.
[Android Software Development] Lgrootnoob:
I have tried putting the xmls into the unmodified copy. it doesnt work.

I think I need to copy the new resources.arsc thing into the unmodified apk also.

I'll have to fiddle with this later.
[Android Software Development] Ticklefish:
Okay, this is a bit of an odd problem. In my defence, I have spent hours trying to sort this out myself before posting here.

My apktool 1.5.2 isn't decompiling the files it used to anymore. I've redownloaded the jar file, redownloaded the aapt file and still get the same error.

These files used to decompile with 1.5.2 and I haven't changed them..so something else must have changed. I just can't think what.

Here's the error I'm getting on KK files and on JB files:

I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\me\apktool\framework\1.apk
W: Config flags size > 36. Exceeding bytes: 0xFFFF.
W: Invalid config flags detected: style-v17-ERR0
W: Could not decode attr value, using undecoded value instead: ns=android, name=sharedUserId, value=0x00000026
Exception in thread "main" java.lang.NullPointerException
at java.io.Writer.write(Unknown Source)
at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSerializer.java:38)
at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:673)
at org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSerializerDelegate.java:106)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamDecoder.java:80)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:130)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:144)
at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:131)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:218)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)

If the apk is fine and the apktool is fine and the aapt is fine....what else could be causing this?
[Android Software Development] iBotPeaches:
There was a bug that had this same issue. https://code.google.com/p/android-apktool/issues/detail?id=538 , I sat down to investigate / fix it and I could no longer duplicate, but I never would of marked the bug as confirmed if I hadn't duplicated it. So like yourself, its off/on whether I reproduce this problem.

Seeing how you've found a reproducible set of apks, send em on. I need to peek at this while I can duplicate it.
[Android Software Development] Ticklefish:
These are the files I was using. Installed with 1.5.2., but no luck with decompiling.

I've been able to decompile these before with 1.5.2.

Normally I'd use apktool 2 but I need to insert some old-format files so I'm back on 1.5.2..

http://www.mediafire.com/?ic2k43lejk5r6wg

It's possible it's something to do with my PC at work. That's where I do most of my modding but it's not unlikely that my IT department have created a setup that isn't entirely friendly to non-work related activities...
[Android Software Development] Ticklefish:
Here's another LG issue, this time with an 'invalid magic value':

Files are here: http://www.kontaktlencsebolt.hu/in.zip

And this is the error:

I: Using Apktool 2.0.0-RC1-848f0d6b5f on LGWeather.apk
I: Loading resource table...
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\rbert\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Loading resource table from file: C:\Users\rbert\apktool\framework\2.apk
Cleaning up unclosed ZipFile for archive C:\Users\rbert\apktool\framework\1.apk
I: Baksmaling...
Exception in thread "main" org.jf.dexlib2.dexbacked.DexBackedDexFile$NotADexFile: Invalid magic value: 01 18 24 61 70 70 6c 69
at org.jf.dexlib2.dexbacked.DexBackedDexFile.verifyMagicAndByteOrder(DexBackedDexFile.java:151)
at org.jf.dexlib2.dexbacked.DexBackedDexFile.<init>(DexBackedDexFile.java:70)
at org.jf.dexlib2.dexbacked.DexBackedDexFile.<init>(D exBackedDexFile.java:96)
at org.jf.dexlib2.DexFileFactory.loadDexFile(DexFileFactory.java:79)
at org.jf.dexlib2.DexFileFactory.loadDexFile(DexFileFactory.java:54)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder .java:93)
at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder .java:46)
at brut.androlib.Androlib.decodeSourcesSmali(Androlib .java:78)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:14 0)
at brut.apktool.Main.cmdDecode(Main.java:169)
at brut.apktool.Main.main(Main.java:85)

Similar error with apktool 1.5.2. and 2.0.0b9. Both framework-res.apk and lge-res.apk have been installed.

Oh, and is it possible to make a feature request? I keep finding a lot of people on xda having trouble because they're using apktool 2 for a mod that uses old-style smali files. Not everyone knows that apktool 2 uses a newer version of smali/baksmali and that they have to use apktool 1.5.2.

If there was an option to use apktool 2 with smali/baksmali 1, that could be really handy. Something like 'apktool d whatever.apk -s1 -o wherever'.
[Android Software Development] mnemonyc:
Anyone can help me to decompile Android L system apks? Thanks in advance.
[Android Software Development] zelendel:
There really is no point yet as it is only a preview and not complete yet.
[Android Software Development] claytonjn:
Actually this would be quite helpful for me as I am developing an app which will default to the Material theme on devices with API 21 and higher, but I can't for the life of me figure out how to add the new floating action button. If I could decompile something like GoogleDialer.apk then it would be really easy to reverse engineer.
[Android Software Development] iBotPeaches:
The downloadable Android L docs show no information about configuration changes, yet they are obviously broken. I have 2 options, reverse engineer open tools because their source isn't public yet or wait till its public. As of right now after a few hours of investigation, I'm waiting. You shouldn't have to decompile anything, the docs for Material are public.

This might change, but I don't know yet.
[Android Software Development] zelendel:
But your missing the preview part. Anything you may find will most likely change up at least a bit before the full release in 3 months or so. And without the source code there is not a lot anyone can do yet.
[Android Software Development] claytonjn:
The documents for Material are public (I spent three hours reading everything) but there's no reference to actually implementing anything that I could find. I'm mostly just interested in knowing if they implemented it using the regular button element with that specific drawable, or if there's a specific element that isn't showing up in the design pallet in Android Studio.

Yes but is not the point of a preview so that not only can people test the ROM itself but also so that application developers can have theirs apps updated and compatible BEFORE it is released to the public? I wouldn't think something like one specific layout element would change that much, and even if it did it should be quite easy to update in the app. That being said, there may be things that will change that would nullify any work going into getting Apktool working, so I completely understand if it's too much work to be worth it or if it's impossible at this point.

Anyways, I don't want to derail the thread. I merely wanted to express that I would also find it useful. I appreciate all the work that goes into a tool like this, so thank you.
[Android Software Development] :
Why dont you decompile the latest G+ app - it has the floating action button included that may help you for now?!
[Android Software Development] claytonjn:
When I was trying to figure it out previously I don't think G+ was updated to include that. For now I just used the library here which was very easy and simulates it good enough for now. I'm fairly certain that the FAB is not included in the Android L preview SDK, at least I've found no documentation indicating that it is.
[Android Software Development] nnm79:
I try it , I build apk ok but when i put it on my phone it say SystemUI error
[Android Software Development] djdarkknight96:
Looks like new playstore needs some new apktool love, hopefully they release something soon. This is crazy!

Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:491)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:74)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:66)
at brut.androlib.Androlib.getResTable(Androlib.java:50)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:189)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:44)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:102)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:83)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
... 8 more
[Android Software Development] Phone_Guru:
For anyone wanting to decompile the new play store see the below post. Looks like we will have to wait for the release of Android L.

http://xdaforums.com/showpost.php?p=54355312&postcount=2293
[Android Software Development] Ticklefish:
I've got trouble with yet another LG apk...

Trying to decompile LGContacts.apk with all frameworks installed gives a lot of 'Could not decode file, replacing by FALSE value'' errors.

Doing a bit of research it looks like this is a feature to cope with bad image files. Could it be caused by anything else though?

I only ask because there seems to be an error for every image file in the apk. Surely even LG can't have screwed up the entire apk...can they?
[Android Software Development] iBotPeaches:
Apktool does that when it cannot complete the 9patch decoding. So assuming all the images that failed are 9patch would point towards maybe a broken 9patch decoder.
[Android Software Development] Ticklefish:
It's not just the 9patch files though. It seems to be every image file in the entire apk.

Here's the error log (it's a bit too big to quote in a post): http://dl-1.va.us.xda-developers.com/2/8/7/1/4/3/3/dec_WorkArea1_LGContacts.apk_Sat-07-26_1345.txt?key=YN3teDBo1AhiWnoRDMUNEg&ts=1406468058
[Android Software Development] Mendim.M:
framework!

Okay I sarched a bit but couldn't find a solution!

I can't install framework-res.apk.

I want to edit something in SystemUI.apk but when try to install framework I get this error:

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

W: Config flags size > 36. Exceeding bytes: 0xFFFF.

W: Invalid config flags detected: style-v17-ERR0

Exception in thread "main" brut.androlib.AndrolibException: Could not decode ars

c file

at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:56)

......

I want to install 3mint battery (http://xdaforums.com/showthread.php?t=2799958&page=2)

and I am NEW to apktool

samsung galaxy s3 i9300 temasek cm11 4.4.4

windows xp

apktool 1.5.2

java runtime 7

thanks :)
[Android Software Development] Spannaa:
Try using APK tool 2.0.0 beta9 instead of 1.5.2

Sent from my GT-I9300...
[Android Software Development] DSA:
If temasek is using trds you will need to use slims tool
[Android Software Development] sambastrakan:
You mean that it's not an apktool problem but a bad implementation in the app itself ?

Envoyé depuis mon MB860 avec Tapatalk
[Android Software Development] pele78:
1.5.9?
[Android Software Development] Epic.:
And after I have deleted the standard pngs how would i go about repairing faulty .9pngs?
[Android Software Development] alteredlikeness:
You need to redraw the patches. You probably should have kept the .pngs that were made and just converted them with draw9patch (located in the Android SDK) to .9.pngs (the original .9.pngs were broken into two files, right? A dummy .9.png and a normal .png?)

You might need to edit the images with GIMP/Photoshop first if the patches are not on the 1 pixel border. And resize the image down two pixels (width and height) because draw9patch will add one pixel to each side..

Sent from my phone's mind
[Android Software Development] TMFGO45:
Quick question. I am working on a theme, probably usable with cm based ROM's like AOKP, so what framework should I install? Just use the AOKP JB framework, or is there a master JB framework I should use? I assume that whatever I'm making the theme for, that's the framework I should use....

Sent from my Galaxy Nexus! (CNA 3.0 , Popcorn 11.6, TWRP 2.2)
[Android Software Development] :
Hey, guys.

I'm searching for a long time now, but i can't get APKTOOL get working with ICS 4.0.4 :crying:

I'm always trying to mod the SystemUI.apk

I can decompile the apps, edit them, but when i try to compile them, i get this error:

C:\Users\Glenn\apktool>apktool b SystemUI

I: Checking whether sources has changed...

I: Checking whether resources has changed...

I: Building resources...

C:\Users\Glenn\apktool\SystemUI\res\layout\status_bar.xml:21: error: Error parsi

ng XML: mismatched tag

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce

ption: could not exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-ver

sion, 15, -F, C:\Users\Glenn\AppData\Local\Temp\APKTOOL4269571554157638800.tmp,

-I, C:\Users\Glenn\apktool\framework\1.apk, -S, C:\Users\Glenn\apktool\SystemUI\

res, -M, C:\Users\Glenn\apktool\SystemUI\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:251)

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

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

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

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

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, --min-sd

k-version, 15, --target-sdk-version, 15, -F, C:\Users\Glenn\AppData\Local\Temp\A

PKTOOL4269571554157638800.tmp, -I, C:\Users\Glenn\apktool\framework\1.apk, -S, C

:\Users\Glenn\apktool\SystemUI\res, -M, C:\Users\Glenn\apktool\SystemUI\AndroidM

anifest.xml]

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

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:249)

... 6 more

I settet up the correct framework-res.apk...

Can you help me?

OS:

Android 4.0.4 Ice Cream Sandwich CyanogenMod9 by Maclaw
[Android Software Development] :
you messed your status_bar.xml up.

look in the line 21. seems you have forgot to close the tag somwhere.
[Android Software Development] :
ouh... thank YOU!!!! works now, but now one more probleem, systemui.apk won't start.... is there something i must copy to modded systemui from standart systemui? i've got no meta-inf folder in modded systemui.apk
[Android Software Development] :
keep the original systemui.apk as is.

apktool b SystemUI sysNew.apk

then open both apks, the original and new compiled one with a zip manager (winzip/winrar/7zip...)

if you made chnages to in the values folder:

- drag & drop & repalce the ressources.asrc from the sysNew to the original systemui.

if you made changes in smali:

- drag & drop & repalce the classes.dex from the sysNew to the original systemui.

In your case you edited a layout file...so navigate in you zip manager to that file and drag and drop teh edited one to the same location of the original systemui.
[Android Software Development] maskerwsk:
Does this apply to the framework-res.apk aswell?

I can decompile and recompile with no changes and it works fine. Changing values/strings.xml and recompile applys the changes but causes force closes. So should i just copy new compiled resources.asrc to original framework-res.apk?

Thanks.
[Android Software Development] djdarkknight96:
I put together some tools that work on ICS and jellybean to decompile apps and framework then compile and sign with another. http://d-h.st/kdw I labeled them to help understand how to use them...hope that helps!

DarkJelly Gnex on JellyBean sent this using the app
[Android Software Development] maskerwsk:
Thanks. Ill give them a try.

I have managed to edit a few system apps with this tool but just falling over on framework :mad:
[Android Software Development] djdarkknight96:
I've only had one system app give me problems on CM9 and that's the contacts apk crashing..It's due to the t9 hack won't compile correctly unless done from source. Otherwise they have been working flawless. The zip includes this apk tool already but the modified apk tool for frameworks has never let me down yet.

DarkJelly Gnex on JellyBean sent this using the app
[Android Software Development] maskerwsk:
I probly should have mentioned its a touchwiz rom. Will that make a difference?
[Android Software Development] amidabuddha:
Since the last discussion is about copying modified files to the original apk I will share my problem too. I hope you guys can help.

I am working on Sense 4 dialer app. Changes are done both in smali code and xml files. The modified apk compiles fine and works on the device (big thanks to iBotPeaches for making this possible!)

But the background images are stretched.

I have tried to copy the resources.arsc and classes.dex to the original apk. Tried also to copy the affected 9.png files to the modified apk with store compression. Both cases cause a FC. Is there any solution?

Sent from my HTC Desire S
[Android Software Development] :
always check the logcat when something force closes.

check your all the .9 pngs.

i bet some were renamned ot r.9.png. remove the r and it should work
[Android Software Development] amidabuddha:
@j4n87

Thank you very much!

The r.9.png extentions were in the original apk. After renaming to 9.png and copying to the modified one it is all good now.

Never heard of this issue before and I did quite some searching before asking here. Thanks again!

Sent from my HTC Desire S
[Android Software Development] djdarkknight96:
nope, just make sure you install the twframework.

DarkJelly Gnex on JellyBean sent this using the app
[Android Software Development] maskerwsk:
Nice work mate!!

Managed to get it working with your apktool and copying resources.arsc from modded version to original.

Thanks for the help
[Android Software Development] djdarkknight96:
Awesome, glad to help. :)

DarkJelly Gnex on JellyBean sent this using the app
[Android Software Development] Mendim.M:
Yeah thanks, this was my problem :)

I'm gonna try this too just to find out if it will work but as [MENTION=4619873]gharrington[/MENTION] said 'Use apktool v1.5.2 or you may get recompile errors'

so I didn't try it but I will later ;)

Thank you boys :D
[Android Software Development] hello00:
ticklefish is right..it gives an error for every single image..i tried using this modded apktool that is supposed to work on lg apks and i still have problems
[Android Software Development] iBotPeaches:
https://github.com/android/platform_frameworks_base/commit/6381dd4ff212a95be30d2b445d40ff419ab076b4

It seems 9patches have changed. Will have to build a decoder that works with old and new 9patches.
[Android Software Development] hello00:
yeah but that is only for 32 and 64 bit platforms..
[Android Software Development] Phone_Guru:
Can someone please build me an Apktool with the latest changes?
[Android Software Development] exodius48:
[MENTION=3924617]iBotPeaches[/MENTION]

I got an error message using apktool 2.0.0b9 while compiling an apk:

How to make resource be public?
[Android Software Development] iBotPeaches:
This is a bug with the application developer. They relied on an internal SDK resource. It should of been copied to their APK and then used locally. You can see this via many and many google searches.

So the correct method is too copy that tree of resources to your application, so they will always be there. The other option is very very hacky. At one point I even used it in Apktool to prevent these errors, but removed it due to potential problems it causes.

When you have a resource like

@android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar.Fixed Size

Its referencing android, which now on this version of AAPT / Build Tools is a private resource. Hence why the OG developer messed up and didn't read proper developer docs. You can cheat it with this change:

@*android:style/Theme.DeviceDefault.Light.Dialog.NoActionBar.Fixed Size

This basically says, "I don't care if its private, try and find me this resource and I don't care if I hit errors".

Dianne Hackborn says about this
[Android Software Development] exodius48:
Woow,,wow,,working fine now.. :)