yashsingh1/xdaforums huggingface dataset:
[Android Software Development] bgcngm:
iBotPeaches, first of all congratulations for your amazing work. :fingers-crossed:

I'm having some difficulties recompiling an untouched framework-res.apk (link here) from Lenovo S880 ROM. Without doing any changes (just decompiling and recompiling) I'm getting the following error:

D:\S880\framework>apktool b framework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-version, 15, -F, C:\Users\BM\AppData\Local\Temp\APKTOOL6796104238788191333.tmp, -x, -S, D:\S880\framework\framework-res\res, -M, D:\S880\framework\framework-res\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:255)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 15, --target-sdk-version, 15, -F, C:\Users\BM\AppData\Local\Temp\APKTOOL6796104238788191333.tmp, -x, -S, D:\S880\framework\framework-res\res, -M, D:\S880\framework\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:253)
... 6 more

By the way, I'm using the latest apktool (1.5.0) along with the modified aapt. Also tried on Ubuntu and got the same error. :(
[Android Software Development] iBotPeaches:
If you delete /values/public.xml it builds correctly. This means that apktool doesn't re-create the public.xml correctly. Won't have time for a week though to look into anything. Pretty busy.
[Android Software Development] bgcngm:
Is there anything I can try to fix it? Of course rebuilding a new public.xml won't work because resource ID's will change...

Do you think you can fix this?
[Android Software Development] wanam:
No need to use Apktool! you just need Backsmali & Smali.
[Android Software Development] wanam:
I get the same issue with some GS3 Apks (SecPhone, framework-res, SecEmail), i found a workaround solution, by replacing "reference-array" tag with "string-array".

We still get a broken framework-res (for GS3 FWs) while rebuilding the resources, cuz of some String formatting issues (duplicate "1$1$" i guess), this brick Allshare, search on the browser page, Wifi-direct and maybe more, it was a known bug on Brut.all tool and it still here on iBotPeaches updates.

@iBotPeaches can you tag your upcoming releases? i want to try to fix this issue and i need your v1.5.0 sources.
[Android Software Development] rtfpessoa:
@iBotPeaches, can you check this http://xdaforums.com/showthread.php?t=1907281 ?

I think would be good if you patch this aapt.

Keep the good work,

Rodrigo
[Android Software Development] iBotPeaches:
It works good, I will await its inclusion in AOSP or at least so I can peak at the changes :)

From there we will decide what to do.
[Android Software Development] varun.chitre15:
@iBot

Any luck with Contacts.apk?

I actually need it :D
[Android Software Development] iBotPeaches:
I actually am a full time 20yr old student in school, with a part time job and a social life. Give me a break. I'll get to things, this my hobby it comes after everything else.

Someone has been helping me fix things. Basically down to 1 bug before v1.5.1

Sent from my SGS3 AT&T Variant
[Android Software Development] zelendel:
Take your time man. You are doing great things and without it people would be stuck.
[Android Software Development] kong:
Quick question: Are you going to apply Chainfire's Fast AAPT patch?

(Saw you in that thread so I hope the answer would be "yes", lol)
[Android Software Development] CosmicDan:
Dude, he already responded to that just a few posts up.

Sent from Xperia Play (R800a) with Tapatalk
[Android Software Development] fusionjack:
I made modification in MiuiSystemUI.apk and I still get FC no matter what I do. I modify it with the following steps:

Decompile the MiuiSystemUI.apk (GT-I9100 miuiandroid 2.9.21) with latest apktool (No errors, no warnings)

Make modification in res/layout/status_bar.xml

Recompile it again and there were some warnings:

aapt: warning: string 'APKTOOL_DUMMY_0116' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'APKTOOL_DUMMY_0117' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'accessibility_rotation_lock_off' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'accessibility_rotation_lock_on_landscape' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'accessibility_rotation_lock_on_portrait' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'description_direction_down' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'description_direction_left' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'description_direction_right' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'description_direction_up' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'description_target_search' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'dreams_dock_launcher' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'notifications_off_text' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'notifications_off_title' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'share' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'status_bar_notification_inspect_item_title' has no default translation in E:\apktools\MiuiSystemUI\res; found: en
aapt: warning: string 'status_bar_time_format_12_simple' has no default translation in E:\apktools\MiuiSystemUI\res; found: en

I read in some tutorials and I tried one of these following methods, but none of these are working:

Take the AndroidManifest.xml and META-INF from the original MiuiSystemUI.apk to dist/MiuiSystemUI.apk OR

Replace the res folder and resources.arsc of the original MiuiSystemUI.apk with the one from dist/MiuiSystemUI.apk OR

Sign dist/MiuiSystemUI.apk

Flash it through CWM. I made it CWM flashable.

Got System UI FC on the home screen and the status bar is gone.

Could someone enlighten me what did I wrong or how to make it right? Thanks. :)
[Android Software Development] iBotPeaches:
There are always warnings in miui roms. It doesn't matter. Ignore it. Some translators put all the string transitions in values-xx so it works on all miui devices, but then it throws warnings on some.

If miui was source built we could avoid these, but it's not. So we can't. Point being, it doesn't matter.

Sent from MIUIAndroid Phone.
[Android Software Development] fusionjack:
Yeah, that was I thought too, but the problem is I still cannot make the new recompiled MiuiSystemUI.apk to work. :(

What is the correct steps to do after recompiling the MiuiSystemUI.apk? I listed three methods above, but none of them are working.
[Android Software Development] iBotPeaches:
Just wait for v1.5.1 it has the option to inject into original apk.

If you can't wait

7za u - r - mx0 -tzip MiuiSystemUI.apk resources.arsc

Sent from MIUIAndroid Phone.
[Android Software Development] raziel23x:
cant wait to try 1.5.1
[Android Software Development] rtfpessoa:
Stay calm and wait for the news.

All the dev's are always pissed because of the people asking about ETA's.

They work hard to get it done, and they even get you updated about the status of the features, and you just keep asking and sayng stupid stuff.

Just sit down and for news don't always keep asking.
[Android Software Development] raziel23x:
LOL I am already using it testing not using it for my productions yet but I compiled the source already just cant wait until the official release is all I Am saying
[Android Software Development] fusionjack:
It works now. I suspect the tab stop in the xml file was causing the FC problem on the home screen or maybe an miui element was bad defined. Anyway it is working now. :D
[Android Software Development] iBotPeaches:
#1) https://github.com/iBotPeaches/Apktool/issues/39

#2) HTC APKs are magic. Haven't figured out their structure yet.
[Android Software Development] zozor:
Okay Thanks anyway .
[Android Software Development] fisha21:
I had this same issue when recompiling play. The log is telling you the error is in styles.xml, line 25. The line appears to be defining a size value (text underline thickness)using a font style, hence the mismatched string type. If you change 'sans-serif-light' to a whole number, eg '2.0', it will work. You will need to do this in a few places, so just keep recompiling after each edit and take note of which line the error is appearing in the log.

Not sure if this is an addressable issue with apktool itself but at least there's a simple workaround!
[Android Software Development] bgcngm:
I'm sure this is not a problem of apktool, but instead related to the way I'm trying to rebuild the .apk. I have an .apk with the following resource ID's:

<resources>
<public type="drawable" name="stat_notify_sdcard_low_space" id="0x0[COLOR="Red"]3[/COLOR]020001" />
<public type="drawable" name="ic_lock_power_reboot" id="0x0[COLOR="red"]3[/COLOR]020000" />
<public type="array" name="examples" id="0x0[COLOR="red"]3[/COLOR]030000" />
<public type="string" name="example" id="0x0[COLOR="red"]3[/COLOR]040000" />
<public type="string" name="global_action_reboot" id="0x0[COLOR="red"]3[/COLOR]040001" />
<public type="string" name="reboot" id="0x0[COLOR="red"]3[/COLOR]040002" />
<public type="string" name="reboot_confirm" id="0x0[COLOR="red"]3[/COLOR]040003" />
<public type="string" name="reboot_progress" id="0x0[COLOR="red"]3[/COLOR]040004" />
</resources>

The problem now is that after rebuilding the .apk, the resource ID's are changed to:

<resources>
<public type="drawable" name="stat_notify_sdcard_low_space" id="0x0[COLOR="red"]2[/COLOR]020001" />
<public type="drawable" name="ic_lock_power_reboot" id="0x0[COLOR="red"]2[/COLOR]020000" />
<public type="array" name="examples" id="0x0[COLOR="red"]2[/COLOR]030000" />
<public type="string" name="example" id="0x0[COLOR="red"]2[/COLOR]040000" />
<public type="string" name="global_action_reboot" id="0x0[COLOR="red"]2[/COLOR]040001" />
<public type="string" name="reboot" id="0x0[COLOR="red"]2[/COLOR]040002" />
<public type="string" name="reboot_confirm" id="0x0[COLOR="red"]2[/COLOR]040003" />
<public type="string" name="reboot_progress" id="0x0[COLOR="red"]2[/COLOR]040004" />
</resources>

In fact, the resource ID's for that .apk should indeed start with 0x03 because ID's 0x01xxxxxx belong to framework-res.apk and ID's 0x02xxxxxx belong to mediatek-res.apk. Does anyone knows any workaround for this?
[Android Software Development] kripkorn:
anyone can help me with version i need to use to compile framework-miui-res on latest version. i already try every method but always ended up in bootloop.

I using windows 7 64bit.
[Android Software Development] CosmicDan:
So many damn novice questions, really annoying.

Sent from Xperia Play (R800a) with Tapatalk
[Android Software Development] bgcngm:
Not sure if you are referring to my question, but this is actually the only thread where users can have a decent support. Besides, I have deeply searched all the topics about apktool and haven't find anything related to my problem. Maybe the solution is pretty easy, but I just need a hint because I'm stuck with that.
[Android Software Development] CosmicDan:
Delete public.xml, recompile.

Sent from Xperia Play (R800a) with Tapatalk

---------- Post added at 10:53 PM ---------- Previous post was at 10:52 PM ----------

Mainly the one between. Dont worry about resource ID's, just delete public.xml and apktool regenerates it when compiling. If the ID's change, they change in smali code aswell.

Sent from Xperia Play (R800a) with Tapatalk
[Android Software Development] bgcngm:
The problem is that this .apk doesn't contains smali code, only resources. And if those ID's are regenerated it breaks every other dependent app... like android.policy.jar, for example, that expects those resource ID's.
[Android Software Development] CosmicDan:
I assume youre editing a framework file. Decompile everything, make your mods to framework, recompile framework, install new compiled framework, recompile dependant files.

Sent from Xperia Play (R800a) with Tapatalk
[Android Software Development] jozka.1:
Asus ICS 4.0.3 SystemUI.apk

Hi,

I modified SystemUI.apk from ICS(Asus 4.0.3 - TF101) and it decompile-recompile fine now.

The problem was in public.xml about id.
[Android Software Development] -Happy Feet-:
hi,

i wanrt recompile my systemUI.apk.

but always it shows this error:

C:\apktool>apktool b SystemUI
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...

and the File is smaller as the original one.

Can anyone help me?
[Android Software Development] CosmicDan:
FFS! What error? So what if it's smaller? Did you even try it? If you're on ICS, you'll need to use Cyanogenmod or for other ROM's manually disable package signature verification.
[Android Software Development] varun.chitre15:
Pls research before posting

Its because it is in compressed form or unsigned
[Android Software Development] il Duce:
Hey cosmic Dan, why don't you calm the F down. Thanks.
[Android Software Development] -Happy Feet-:
I´m on ICS

i modding the first time and i want to learn... :)

i think that is not correct that the source could not find
[Android Software Development] iBotPeaches:
To all the previous comments.

I'm updating a new Wiki slowly. https://github.com/iBotPeaches/Apktool/wiki Read the FAQ portion when its up there and public.

The APK is smaller because its unsigned. Not compressed. Some APKs are compressed and some are not, and if you compress everything then the APKs that weren't compressed no longer work. The best method would be read the method of compression, but thats a tiny rehaul.

Apktool v1.5.1 uses -o --original. So on rebuild do

apktool b -o DeskClock.apk Deskclock

That takes the folder (where the decompiled stuff is /DeskClock and builds it into /DeskClock/dist/apk), then merges those elements into DeskClock.apk retaining the signature, size and what not with the new resources.

I'm very busy this week with exams and real work. I'll try and knock out the last few bugs this weekend. Still fixing up some maven -> gradle bugs.
[Android Software Development] evol4g:
What you posted was not an error.. keep in mind you have to sign the apk after you compile the new apk.. I have a basic users guide on how to use apktool in chef central

This was a guide on modifying ICS apks before ibotpeaches took over.. since he has its a basic apktool guide..

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

Just follow the instructions
[Android Software Development] -Happy Feet-:
I followd the instructions. I forgot to took the META-INF and the Manifest.XML in the new ZIP with 7zip.

Now i try this again after drag and drop and then sign again.

geschrieben mit dem Android 4.0.4 powerd HOX
[Android Software Development] mekanismen:
There's no need to re-sign system apps after modding them with apktool.

---------- Post added at 07:13 PM ---------- Previous post was at 07:09 PM ----------

You should NOT sign system apps after modding them. If anything, drag and drop the original META-INF from the original apk to your modded version.

The signature of the app is located in META-INF, so don't sign the app after drag and dropping that folder to the new app.
[Android Software Development] reosm:
When version 1.5.1 released?
[Android Software Development] shehroze3:
i keep getting an error that says:

Unable to access jarfile C:\android-sdk\platform-tools\\apktool.jar

Can someone please help me? i have searched all over google and tried everything but nothing will fix it
[Android Software Development] iBotPeaches:
Obviously you haven't. -_-

It the file doesn't exist there. Easy as that.
[Android Software Development] shehroze3:
What am i missing, because the file is in the folder?
[Android Software Development] mikep99:
rename "apktool_1.5.0" to "apktool"
[Android Software Development] shehroze3:
OMG i didnt know i was supposed to do that lol. Thank you so much!
[Android Software Development] -Happy Feet-:
Hmm die APK seems to be okay...i went back to 2.17.401.2 and try it again.with the Vodafone Base 2.17.601.2 would Not work..why ever ..

geschrieben mit dem Android 4.0.4 powerd HOX
[Android Software Development] reosm:
1.5.1 Version ?
[Android Software Development] mattmanwrx:
Compile it from source or wait for it to be released :)
[Android Software Development] il Duce:
What sort of magical things are you hoping for that are not accomplished by 1.5?

Here's my response as an XDA forum moderator, since clearly you can't be bothered to read back a page or two:

Stop asking about future versions of anything, ever, because they only come out when they're ready, regardless of your silly posts.

If you persist (rather than learn respect and patience) there will be consequences. Consider this an official warning.
[Android Software Development] reosm:
Can artist ???????
[Android Software Development] il Duce:
What?
[Android Software Development] CosmicDan:
Lol!

Just curious, are the plurals and possibly other string-formatting bugs fixed in 1.5.1? No biggie really, after doing a lot of research I find that latest MIUI APK's can be recompiled fine with a bit of manual tweaking.

If these bugs are not quite nailed yet, I would be happy to help with the Wiki.
[Android Software Development] iBotPeaches:
Programmed all day at work and school so really was exhausted. So instead I wrote up a good portion of the Wiki and localized the wrapper scripts to Github. (So I don't have to manage 2 different sites).

Wrapper Scripts: https://github.com/iBotPeaches/Apktool/downloads

Wiki: https://github.com/iBotPeaches/Apktool/wiki

I know that "Wiki" means group edit on every other site, but I don't think it works like that on Github. So I'll try and write up some good documentation. If you have any ideas or want me to explain anything in more detail. Let me know now so I can write it up.
[Android Software Development] evol4g:
Yeah thats exactly what i meant by resigning the app... I only work with system apps
[Android Software Development] zelendel:
Changing your post doesn't mean no one saw it. It only means you were smart enough to do it before too many saw it. For having that much common sense I will alot you this one warning. Knock it off.

Sent from Arkham
[Android Software Development] reosm:
Stop picking on me, do your job!
[Android Software Development] CosmicDan:
Sorry if this is already reported, or not reported correctly, but sometimes apktool randomly crashes out. It's rare, but it forces me to double-check my kitchen logs to make sure everything built properly. Simply running it again without any changes works.

copy "E:\Android\~ROM, Radio, Kernel, etc\Xperia Play - MIUIv4 (Mine)\base_postmods_inject\framework\framework.jar.patch" "C:\Users\Dan\AppData\Local\Temp\miui_build\framework"
1 file(s) copied.
patch -p0 --no-backup-if-mismatch -i "C:\Users\Dan\AppData\Local\Temp\miui_build\framework\framework.jar.patch" -d framework
patching file `smali/android/app/Activity.smali'
patching file `smali/android/app/Dialog.smali'
patching file `smali/android/view/View.smali'
patching file `smali/android/view/ViewRoot.smali'
patching file `smali/android/view/ViewRootImpl.smali'
echo [i] Checking for rejects...
echo ...everything seems OK! Building...
java -jar "E:\Android\~ROM, Radio, Kernel, etc\Xperia Play - MIUIv4 (Mine)\base_tool\apktool.jar" b "framework"
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" java.lang.NullPointerException
at org.jf.util.PathUtil.getRelativeFile(PathUtil.java:44)
at org.jf.smali.smaliFlexLexer.getSourceName(smaliFlexLexer.java:2878)
at org.antlr.runtime.CommonTokenStream.getSourceName(CommonTokenStream.java:345)
at org.antlr.runtime.tree.CommonTreeNodeStream.getSourceName(CommonTreeNodeStream.java:106)
at org.antlr.runtime.tree.TreeParser.getSourceName(TreeParser.java:78)
at org.jf.smali.smaliTreeWalker.getErrorHeader(smaliTreeWalker.java:357)
at org.antlr.runtime.BaseRecognizer.displayRecognitionError(BaseRecognizer.java:192)
at org.antlr.runtime.BaseRecognizer.reportError(BaseRecognizer.java:186)
at org.jf.smali.smaliTreeWalker.smali_file(smaliTreeWalker.java:436)
at brut.androlib.mod.SmaliMod.assembleSmaliFile(SmaliMod.java:85)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:43)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:243)
at brut.androlib.Androlib.buildSources(Androlib.java:200)
at brut.androlib.Androlib.build(Androlib.java:191)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
xcopy /e /y "framework\build" "E:\Android\~ROM, Radio, Kernel, etc\Xperia Play - MIUIv4 (Mine)\base_postmods_inject\framework\framework.jar\build\"
0 File(s) copied
[Android Software Development] zelendel:
First off I am sorry to the OP for the derail and this will be the last post on the matter.

Now for you. You think I am picking on you? What are we in high school again? I am not picking on you. This is a development site. Not a site that you come to feeling entitled to anything. The OP has the right to make a full stop and not tell anyone anything. That is his choice. Now before you reply with another childish "stop picking on me" read this

http://xdaforums.com/showthread.php?p=16682226#post16682226

And as for my job. The next time you pull something like that. you will be banned.
[Android Software Development] madquack:
Everything works perfectly if you follow the directions. With version 1.5.0, I was able to modify CM10 Trebuchet.apk and Gallery2.apk to remove haptic feedback from both applications. Everyone having issues, read more, read more, read more. I am a complete retard and managed to figure it out.

Your tool has greatly enabled to me to further understand how android packages work as well as figuring out smali. Smali is still the spawn of satan however.

@iBotPeaches: Have some beers on me bro, keep up the great work. :good: Confirmation Number: 7AP031255F0912548
[Android Software Development] mattmanwrx:
Upload apks? I'll take a quick look when I can...