yashsingh1/xdaforums huggingface dataset:
[Android Software Development] jcejohnson:
Nope, didn't sign it. Was trying to do a simple round-trip. Dropping my decompiled/recompiled content into the original apk did the trick.

cp SystemUI-original.apk SystemUI-final.apk
apktool d SystemUI-original.apk
# modify the content in SystemUI.apk-original.out
apktool b SystemUI.apk-original.out SystemUI-intermediate.apk
mkdir SystemUI-intermediate.apk.d
cd SystemUI-intermediate.apk.d
unzip -q ../SystemUI-intermediate.apk classes.dex resources.arsc res/*
zip -qr ../SystemUI-final.apk classes.dex resources.arsc res
cd ..
adb push SystemUI-final.apk /mnt/sdcard

I'll try j4n87's trick with services.jar when I get a chance.
[Android Software Development] SunnyOK:
Look forward to seeing your new release by adding T9Map.

I would like to edit Contacts.apk.

---------- Post added at 02:58 PM ---------- Previous post was at 02:56 PM ----------

By the way, I can test your new code and see if your change works.
[Android Software Development] sn0b0ard:
Temporary Fix for Malformed XML

I made a simple Bash script that parses all the XML files from the res folder and fixes malformed XML that is being outputted by Apktool. This only fixes formatting issues such as too many blank spaces, or hard to read syntax. It does NOT fix issues where the tags and values are swapped around. Script is attached. For Linux users only.

Usage:

put script in res folder

chmod a+x xmlparse.sh

cd apkfolder/res

./xmlparse.sh

XML is now fixed. Remove script from res folder before building APK.
[Android Software Development] lichti1901:
Yeah, i was talking about framework-res and SystemUi.apk :)

Gesendet von meinem GT-I9300 mit Tapatalk 2
[Android Software Development] djdarkknight96:
Me too, been signing them without any issues.

DarkJelly Gnex on JellyBean sent this using the app
[Android Software Development] _alex74_:
Posted Issue 715.

Hope it is clear.

Good work and thanks
[Android Software Development] laura almeida:
When every time i tries to build an apk Avast will report it as Virus and Blocks it.

C:\Users\Laura\Desktop\Loli>apktool b Test
I: Using Apktool 2.0.0-RC3 on Test
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_9136682272798035481.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 19, --version-code, 450148,
--version-name, 2.11.432, -F, C:\Users\Laura\AppData\Local\Temp\APKTOOL332349704829646881.tmp, -I, C:\Users\Laura\apktool\framework\1.apk, -S, C:\Users\Laura\Desktop\Loli\Test\res, -M, C:\Users\Laura\Desktop\Loli\Test\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:437)
at brut.androlib.Androlib.buildResources(Androlib.java:374)
at brut.androlib.Androlib.build(Androlib.java:277)
at brut.androlib.Androlib.build(Androlib.java:250)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_9136682272798035481.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 19, --version-code, 450148, --version-name, 2.11.432, -F, C:\Users\Laura\AppData\Local\Temp\APKTOOL332349704829646881.tmp, -I, C:\Users\Laura\apktool\framework\1.apk, -S, C:\Users\Laura\Desktop\Loli\Test\res, -M, C:\Users\Laura\Desktop\Loli\Test\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:488)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:423)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_9136682272798035481.tmp, p, --forced-package-id, 127, --min-sdk-version, 7, --target-sdk-version, 19, --version-code, 450148, --version-name, 2.11.432, -F, C:\Users\Laura\AppData\Local\Temp\APKTOOL332349704829646881.tmp, -I, C:\Users\Laura\apktool\framework\1.apk, -S, C:\Users\Laura\Desktop\Loli\Test\res, -M, C:\Users\Laura\Desktop\Loli\Test\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:93)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:482)
... 6 more
Caused by: java.io.IOException: Cannot run program "C:\Users\Laura\AppData\Local\Temp\brut_util_Jar_9136682272798035481.tmp": CreateProcess error=5, Access is
denied
at java.lang.ProcessBuilder.start(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at java.lang.Runtime.exec(Unknown Source)
at brut.util.OS.exec(OS.java:84)
... 7 more
Caused by: java.io.IOException: CreateProcess error=5, Access is denied
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(Unknown Source)
at java.lang.ProcessImpl.start(Unknown Source)
... 11 more

C:\Users\Laura\Desktop\Loli>

This is driving me CRAZY !

I have to disable Avast! every time when i Build an APK
[Android Software Development] zelendel:
I'll be honest. That's why your told to shut it down anytime you mess with Android.

Anti-virus programs are useless and cause more issues then they are worth. Most modders I know have removed them all together.
[Android Software Development] laura almeida:
Hum...

That's true.

I didn't any problem with Avast! till the Apktool v2.0.0 RC2

I guess i will have to disable Avast! forever
[Android Software Development] anagramgenius:
I just switched to AVG. Was fed up with Avast.
[Android Software Development] gemini16:
Thank you for your info. When build apk, i've use -a option and everythings fine. i wonder why default aapt embedded in your apktool gave that error?
[Android Software Development] iBotPeaches:
aapt has like 200 more commits since RC2. No idea why it would detect as virus. Source can be found here: https://github.com/iBotPeaches/platform_frameworks_base

-a just uses whatever aapt you point it to. The embedded default aapt is the most up to date aapt in the AOSP frameworks/base. We have to continue to use the newest aapt to support the newest applications. If you choose the route of using your own aapt via -a. I assume you are aware that sometimes it might not work for newer apks.
[Android Software Development] laura almeida:
It is not your fault.

It is that stupid Avast! fault.

Its false positive.

I was also wondering that why its reporting as a false positive.
[Android Software Development] DSA:
Because avast is total crap

I use avira(when I need it) and it works fine with all apktools
[Android Software Development] gemini16:
I've know that your aapt is universal, and in ADT is separate for each SDK version. But i think this temporary solution for your aapt still add -v4, -v13,etc... with my Samsung Galaxy S5 Android 4.4.2
[Android Software Development] bovirus:
Trying to decompile this app

https://play.google.com/store/apps/details?id=cz.mtrakal.mtkepogpsfixer

I obtained this error

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

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

I: Decoding values */* XMLs...

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

at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:59)

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

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

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

at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:54)

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

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

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

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

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

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

How can fix it?
[Android Software Development] cbucz24:
Well it may not be possible for that one. There is an option to remove unused resources with proguard. Not sure if it was used in that or not, but being in the playstore it may have been.

Your error means it's missing resources. So either they removes them or you still need to install something
[Android Software Development] PerfectSlayer:
[MENTION=3924617]iBotPeaches[/MENTION] Do you already launch a .tmp in %temp% folderfile as executable ?

It seems to be the reason why Avast is raising an alert…

To Avast users, add the following exeception to get apktool work as before:

In Settings > Exclusions > File path, add %temp%\brut_util_Jar_* as ignored path.
[Android Software Development] laura almeida:
Thank You so much.

That seems to fix the problem
[Android Software Development] DeHAWK:
Regarding latest release.

I recommend not to update from RC2. I've discovered that's it not able to rebuild a working .apk file, at least not for me.

I used RC2 before to modify some apk's for the Samsung Galaxy S4+ and they worked without any issues. I then began using the latest RC3. First thing I noticed was the size, much smaller than RC2, but I didn't think more about this at that time.

Later, when working on an apk, I noticed that the folders/files under the 'unknown' folder wasn't put in the final apk. This caused errors while doing a zipalign. I therefore had to move the missing folder manually to the final apk, and then zipalign was successful.

The apk got installed, but issues came up, all the check boxes was missing. I just couldn't figure out what was wrong with my code.

Then today, I opened the apktool file and compared the aapt file against the previous version...

Well, in short; I replaced the RC3 aapt file with the RC2 aapt file.

Deleted the apk working folder, after coping my changed files. Made a new decompile, copied my files and made a new build.

Now the folder/files under 'unknown' was in the final apk file, zipalign was successful.

Installed the apk, and guess what...everything was working, no issues found at all.

Just to mention; I'm working in a 64-bit Linux environment and the apk file I was working on was 74MB in size for 4.4.2.

Hope this can help others with similar problems.

Regards.
[Android Software Development] lukasz050:
when type "apktool if framework-res.apk" it fialed

i have android 5.0

what should I do ?
[Android Software Development] iBotPeaches:
Yes, internal aapt is copied to /tmp and executed for building apks.

The difference from RC2 to RC3 is the new aapt. This would explain why using the RC2 aapt fixed the problem for you. What I find strange is why it fails. The change in the newest aapt adds version qualifiers to all resources. So if you have a folder that uses ldtrl or xxhdpi that requires at least API 17. Aapt then appends the version from a pool of (v4, v13, v17 and v21) depending on this.

Documentation on AOSP states

http://developer.android.com/guide/topics/resources/providing-resources.html

Obviously I cannot dismiss a bug that affects so far at least the SGS4 family, but since I sold my SGS3 I'm at quite a lose of testing these problems first hand. I will need some support from those who duplicate this problem in terms of logcats of the installation process. Since I cannot duplicate on AOSP, CM, stock Sony.

Use Apktool RC3 and delete the file at $HOME/apktool/framework/1.apk before trying again (after you install RC3)
[Android Software Development] Kickoff:
Do you need anything to solve the LG systemui problem? I would really appreciate any hint to that.
[Android Software Development] lukasz050:
ok this work for me but next when i want to build extractred app it says

and the apk was created but without "META-INF" folder so dont work
[Android Software Development] raziel23x:
well most cases the tool builds the apk without the signature file since most cases you need to resign if you edit the apk file especially if you edit the AndroidManifest.xml
[Android Software Development] lukasz050:
i only change 1 file in asset>CSV

so how can i resign apk ?

when i use "signapk" i have problem when i write in cmd

program create broken apk file. my file "namefile-signed.apk" include only META-INF ;<
[Android Software Development] PerfectSlayer:
[FONT=&quot][/FONT]

[FONT=&quot][/FONT]

[FONT=&quot][/FONT]

[FONT=&quot][/FONT]

I mean did you do it before RC3 ? Because that I saw that is the reason why Avast is scared…
[Android Software Development] iBotPeaches:
That process hasn't changed since 1.5.3 (which was quickly labeled as 2.0.0 Beta 1). The new aapt must just not like avast, and either do I at this point with all the regression and bugs it introduced. Still looking for the best solution to these problems.
[Android Software Development] PerfectSlayer:
[FONT=&quot][/FONT]

[FONT=&quot][/FONT]

[FONT=&quot][/FONT]

[FONT=&quot][/FONT]

So good luck with the new aapt… ;)

(may be it was Avast that changed but so many troubles with the new aapt to blame Avast)
[Android Software Development] laura almeida:
Yeah lets Blame Avast !
[Android Software Development] Mikanoshi:
HTC's Phone.apk still cannot be decompiled...

https://code.google.com/p/android-apktool/issues/detail?id=534#c14
[Android Software Development] fhem:
[MENTION=3924617]iBotPeaches[/MENTION] I am seeing the same thing very wierd. I am on N9 running stock LRX22C. I simply decompiled - recompiled the odexed sysui apk - touched nothing. I flashed to the tab and the status bar is stuck to the top left just as shown above.
[Android Software Development] iBotPeaches:
Haven't started looking, since I know it'll require some big changes. I believe its the same root problem just recently reported in bug 722. So watch Bug 713 and Bug 722 for changes.

Well yes, the bug report isn't fixed. I'll be honest. I've tried numerous on numerous times to fix that thing and never had success. You're welcome to poke around and attempt a fix.

Do this. Get a diff program MeldDiff, Beyond Compare, etc. Decode the application into "stock_app". Rebuild the application. Take the rebuilt application and decode it into folder "dirty_app". Take those two folders in the diff folder view and compare. Look for things that are different. This will help isolate where Apktool is making a mistake. Then from there we can proceed.

[MENTION=1007992]everyone[/MENTION]. I'm just one student working on this, entering final exams. I will work on things to the best of my ability, but things may be slow for the next 2 weeks.
[Android Software Development] PerfectSlayer:
I did it and here is the result :

AndroidManifest.xml is different (platforBuildVersionName changed)

original/META-INF is only in stock_app

original/AndroidManifest.xml is different (binary file)

(note: I exclude dist and build from stock_app, use RC3 and provided aapt. Just install framework-res.apk of stock 5.0 Lollipop of Nexus 7 2012)

I upload you the two decompiled app here : http://hardcoding.free.fr/forum/apktool.zip if you want to have a look at.
[Android Software Development] fhem:
working on it. thanks good luck :good:
[Android Software Development] iBotPeaches:
I took a look. The only true difference is that Apktool is rewriting the platformBuildVersionName to "APKTOOL". This was a change I made in aapt, because otherwise it would put Build Tools 22 or something like that, which I didn't feel correctly represent how that APK was rebuilt. I guess I should change the code to ONLY make the change if the value is absent/missing. In this case there was already a value present (5.0-1570855), which Apktool replaced with (APKTOOL).

This should not break anything. This value was just added in Build Tools 20+ so apks could be tagged with the build tools that created them. There should be no on device dependency for these values. I will work on a patch and rebuild all aapts to change this behavior and add unit-tests to prevent regression on this, but I honestly don't think it will change anything.
[Android Software Development] PerfectSlayer:
Ok, thanks you! If you would like I test a build of your fix before releasing it, fell free to PM me. So I could tell you if it fix the SystemUI issue.

Envoyé de mon Nexus 4 en utilisant Tapatalk
[Android Software Development] PerfectSlayer:
[MENTION=5526655]fhem[/MENTION] Yes, I also have two warnings that look similar. (from my memory, I will not reach my computer until Wednesday night..)

Envoyé de mon Nexus 4 en utilisant Tapatalk
[Android Software Development] raziel23x:
that is a normal error that can be ignored just means the original apk file just did not have a default translations for what ever string
[Android Software Development] raziel23x:
what is the proper way to rename the package name and recompile the apk to fully function with any apk
[Android Software Development] cbucz24:
Well a few things, not in front of a pc right now.

But from memory, there are strings to maybe change. Maybe the meta. And in the xml folder too. I've not done much yet cuz I'm waiting for my new phone...so I'm on a break. Lol

For it to function you will need to sign the app.

Keep in mind, remaking someone else's work and calling your own isn't cool...make sure you get permission for something like that.
[Android Software Development] raziel23x:
well the purpose is not to remake someone else work just that thinks like theming a app but want to keep the original apk file from the market so that it is up to date and easy to be there to pull to theme again.

and my APK Multi-Tool app I work on I was looking for allowing this to be a option to automate the process for my users because i am getting a recent days emails from many android themers and users who use my tool which is basically a wrapper that automates many of the built in command options of this tool with a bat file for windows users and a sh file for linux users.
[Android Software Development] JJSJJS:
how to rebuild apk for older sdk

Hello, i need to create an app for an older android device.

I'm using Livecode to create it but minimum is froyo 2.2.

I succeeded to extract it's contents using the apktool.

Is it possible to rebuild it again for android 1.5.1 ?

What exactly do i need to change?

Somewhere in the adroidmanifest.xml ?

I have the requirements installed in the android SDK for android 1.5.1. (yes it's old but the devices just have to display a few lines of text on a workbench and using the browser is no option, the app has to read a few txt files from local network containing one line of text each)

I'm testing now with just a simple app showing a simple line of text.

Any help on this will be appreciated.

Thanks a lot.
[Android Software Development] The Scientist95:
Hi, I am trying to add "Theme.AppCompat" to values/styles in an apk.

" error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.AppCompat'. "

My framework: framework-res.apk from stock Android 5.0 Nexus 4.

APKTOOL Version: APKTOOL RC3

I tried to decompile 'Google Keep 3.0.03' which has AppCompat_v7 support. It decompiled and recompiled correctly.

Any help will be appreciated. Thanks
[Android Software Development] claude96:
Error decopiling RC3

[MENTION=3924617]iBotPeaches[/MENTION] 1st thanks a million for your great work, keep it up plz, next I'm having a strange issue with the latest apktool_rc3 !, the issue is if I try to decompile an app ( secsettings.apk for example ) I get tons of errors !, although the app was compiled with the same apktool version ( in that case RC3), but if I do same thing only this time with an older apktool version ( wip version ), all goes well !, any ideas !

PS : I've attached a zip with the errors log, and both AndroidManifest.xml ( faulty & working ), thanks a mill.
[Android Software Development] fhem:
I would try using the manifest that was in the orig secsetting.apk. just push the orig manifest into the new recompiled apk before decompiling again. that worked for me.
[Android Software Development] claude96:
thanks a mill, but I already have another working apktool version ( wip ) with no problems, I was just curious why the rc3 version is causing errors.
[Android Software Development] iBotPeaches:
When you said a "WIP" version what commit are you referencing? I've already started work on porting all the needed changes to the old aapt, as I believe the new aapt is at fault for all these issues.
[Android Software Development] claude96:
[MENTION=3924617]iBotPeaches[/MENTION] you've removed the commit, the version is in the error text ( last part of it ), but here it is attached ( hope it helps you save some time ), and again thanks a mill for your great work.
[Android Software Development] Dauntless:
I was trying to do some research on the latest Facebook app (com.facebook.katana), and I successfully decompiled the apk, but some classes were missing. For example, some of the layout files reference a com.facebook.webview.FacebookWebView class, but that class is not in the /smali folder.

Where could these classes be situated?

./res/layout/app_feed_store_fragment.xml: <com.facebook.webview.FacebookWebView android:id="@id/authorisation_webview" android:focusable="true" android:visibility="gone" android:layout_width="fill_parent" android:layout_height="fill_parent" />

If I have to ask this somewhere else, please let me know :)
[Android Software Development] iBotPeaches:
Facebook is weird. They don't have the classes internally. They use some crazy reflection to merge dex files and stuff on runtime (after downloading them). https://www.facebook.com/notes/face...ch-for-facebook-for-android/10151345597798920

Apparently it was to get around the 65k method limit, but o well.
[Android Software Development] bovirus:
New version available on git source (new v.21 aapt for Linux/Windows ).
[Android Software Development] iBotPeaches:
Please remove that post. Via Google Translate it looks like you are releasing builds via the new commits to Apktool. I will release builds/snapshots when I'm ready to gather feedback. Thank you for trying to help, but this isn't the way.
[Android Software Development] Dauntless:
Thanks! I'll read that and it's also got this blog post linked, which seems interesting :)
[Android Software Development] chas123:
Any on else getting this:

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:696)

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:83)

at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:141)

at brut.androlib.res.decoder.XmlPullStreamDecoder.decodeManifest(XmlPullStreamDecoder.java:153)

at brut.androlib.res.decoder.ResFileDecoder.decodeManifest(ResFileDecoder.java:131)

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

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

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

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

at brut.apktool.Main.main(Main.java:86)
[Android Software Development] steal25:
All the source code for Facebook and a few other newer apks is located in assets/secondary-dex(?) /secondary-dex.jars. Can't remember the exact name of the folder I'm not home at the moment. But in each of those jars is another jar which is where the source is. It's a pain in the @$$ but manageable, I just got done themeing the latest Facebook and it took quite a while because of the 6 extra jars