yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Sal7_one:
hi everyone

please don't kill me XD i'm noob K

i have xperia Z2 5.1.1 i took the framework-res apk and apk tool worked !

but when i want to use apktool b 2 < folder

i get an error i don't know do i need something else than the apktool jar and apktool bat ? and did i do something worng ? and i downloaded the jre and jdk < or whatever they are called my os is win 8.1

btw i used too work on apktool 1.5.2 it was amazing but it doesnt work now so i'm trying to use 2.0.2

soory for my bad english
[Android Software Development] exodius48:
Post error message to analyze it.
[Android Software Development] Sal7_one:
C:\apktool>apktool b 2
I: Using Apktool 2.0.2
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
C:\apktool\2\AndroidManifest.xml:50: error: No resource identifier found for att
ribute 'fullBackupContent' in package 'android'

C:\apktool\2\AndroidManifest.xml:244: error: No resource identifier found for at
tribute 'autoVerify' in package 'android'

C:\apktool\2\AndroidManifest.xml:254: error: No resource identifier found for at
tribute 'autoVerify' in package 'android'

C:\apktool\2\AndroidManifest.xml:262: error: No resource identifier found for at
tribute 'autoVerify' in package 'android'

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.Androl
ibException: brut.common.BrutException: could not exec command: [C:\Users\sal\Ap
pData\Local\Temp\brut_util_Jar_2455257652763895427.tmp, p, --forced-package-id,
127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 5116682, -
-version-name, 5.82.0-alpha.344, -F, C:\Users\sal\AppData\Local\Temp\APKTOOL8065
014440497731974.tmp, -0, resources.arsc, -0, arsc, -I, C:\Users\sal\apktool\fram
ework\1.apk, -S, C:\apktool\2\res, -M, C:\apktool\2\AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:465)
at brut.androlib.Androlib.buildResources(Androlib.java:403)
at brut.androlib.Androlib.build(Androlib.java:291)
at brut.androlib.Androlib.build(Androlib.java:261)
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\sal\AppData\Local\Temp\brut_util_Jar_245525765276389542
7.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version,
23, --version-code, 5116682, --version-name, 5.82.0-alpha.344, -F, C:\Users\sal
\AppData\Local\Temp\APKTOOL8065014440497731974.tmp, -0, resources.arsc, -0, arsc
, -I, C:\Users\sal\apktool\framework\1.apk, -S, C:\apktool\2\res, -M, C:\apktool
\2\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:425)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:451)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\sal\AppD
ata\Local\Temp\brut_util_Jar_2455257652763895427.tmp, p, --forced-package-id, 12
7, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 5116682, --v
ersion-name, 5.82.0-alpha.344, -F, C:\Users\sal\AppData\Local\Temp\APKTOOL806501
4440497731974.tmp, -0, resources.arsc, -0, arsc, -I, C:\Users\sal\apktool\framew
ork\1.apk, -S, C:\apktool\2\res, -M, C:\apktool\2\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav
a:419)
... 6 more

C:\apktool>

first i'm really sorry because i know how stupid i sound

second thank you for replaying
[Android Software Development] djdarkknight96:
Error is saying your installed framework is missing an attribute in the apk's manifest. Might need to update your framework or add additional resources if needed.
[Android Software Development] Sal7_one:
thank you ! ^^

I'm not sure what I'm going to do with the framework error (what do you mean by update your framework ? ) my pc? it's already updated and it has nothing to do with Apktool i think ... does it ?

or android ? and if it's android how do i do that ? I'm really sorry

but when i searched for like the 100 time I found a person who said may be the APK has been edited before which is true !(GBwhatsapp)

but i was trying to edit twitter (com) so I can clone it all the cloning apps didn't work and i got the same error even though twitter wasn't edited before !

anyway i tried it on a simple 800kbs app and it turns out that apktool actually works but twitter is maybe too big or something 16k files
[Android Software Development] Morningstar:
It may just be something to do with twitter. I know another Dev who was trying to mess with twitter recently and kept running into problems.
[Android Software Development] djdarkknight96:
Theming edited apk's is not fun because it depends how they packaged the apk. We theme Twitter without issues so it's not the apk if it's the stock Twitter.

If these guys are using slim framework or anything with modded resources you'll need to install them as well.

In either case use command

apktool if framework-res.apk

with new M framework or modded to your computer if you haven't yet, might just need New M Framework for stock Twitter.

DJ
[Android Software Development] levone1:
Hi. Sorry not exactly the right thread, but just a quick question someone might have a quick answer for...

Trying to use apktool for android, (on the phone, not on the computer), on my Xperia Z1c, and I have the latest version, and frameworks install fine and decompile is fine. Recompile throws this -

CANNOT LINK EXECUTABLE: cannot locate symbol "_ZN7android12AssetManager16setConfigurationERKNS_15ResTable_configEPKc" referenced by "/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.1"...

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.1, p, --min-sdk-version, 22, --target-sdk-version, 22, --version-code, 22, --version-name, 5.1.1-1, -F, /data/data/per.pqy.apktool/APKTOOL4991835450679915763.tmp, -0, arsc, -I, /data/data/per.pqy.apktool/1.apk, -S, /sdcard/apktool/SystemUI_src/res, -M, /sdcard/apktool/SystemUI_src/AndroidManifest.xml]

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

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

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

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

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: [/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.1, p, --min-sdk-version, 22, --target-sdk-version, 22, --version-code, 22, --version-name, 5.1.1-1, -F, /data/data/per.pqy.apktool/APKTOOL4991835450679915763.tmp, -0, arsc, -I, /data/data/per.pqy.apktool/1.apk, -S, /sdcard/apktool/SystemUI_src/res, -M, /sdcard/apktool/SystemUI_src/AndroidManifest.xml]

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

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

... 5 more

Caused by: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.1, p, --min-sdk-version, 22, --target-sdk-version, 22, --version-code, 22, --version-name, 5.1.1-1, -F, /data/data/per.pqy.apktool/APKTOOL4991835450679915763.tmp, -0, arsc, -I, /data/data/per.pqy.apktool/1.apk, -S, /sdcard/apktool/SystemUI_src/res, -M, /sdcard/apktool/SystemUI_src/AndroidManifest.xml]

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

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

... 6 more

I: Using Apktool 2.0.0-07ea41-SNAPSHOT

I: Smaling smali folder into classes.dex...

I: Building resources...

Classes dex is created in build folder. It seems from the little I know that there's some issue with aapt version, but I've tried with every setting. Is there a file I could edit or something that would deal with this? Thanks
[Android Software Development] Dzepar:
[MENTION=6283426]levone1[/MENTION]

Did you install SemcGenericUxpRes.apk? You need both framework and SemcGenericUxpRes installed in order to properly de/recompile SystemUI. ;)

Good Luck.

Sent from my D2303
[Android Software Development] levone1:
Yes, got both. I've read other forums where people have if'd sysui also, so I even tried that for the heck of it. I have gotten a successful recompile on KK, so I'm just wondering if the apktool apk file maybe could just use a little tweak or something. It seems like everything theoretically lines up, but somehow the program is not getting some info it's looking for. Thanks

Here's my thread on it if you care to take a look. - http://xdaforums.com/sony-xperia-z1-compact/general/apktool-phone-t3230338
[Android Software Development] t-ryder:
Did you manage to solve this?

Having same trouble here.

What are we missing?
[Android Software Development] exodius48:
I'm using Apktool 2.0.3 snapshot, still have same issue. :(

apktool b ThemeManager
I: Using Apktool 2.0.3-183eef-SNAPSHOT
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
E/ResourceType( 2432): Failed resolving ResTable_map name at 3264 with ident 0x1
00b000b
warning: string 'basic_info' has no default translation.
warning: string 'theme_batch_has_update_text' has no default translation.
warning: Package not found for resource #1001004f
I: Building apk file...
I: Copying unknown files/dir...
[Android Software Development] t-ryder:
Damn.

miui.pro and xiaomi.eu seem not to have that problem.
[Android Software Development] exodius48:
Probably all of them using modified rom, i decompile ThemeManager from original rom (downloaded from en.miui.com)
[Android Software Development] t-ryder:
What has the theme manager to do with it?
[Android Software Development] exodius48:
I just try to decompile one of system app, then i choose theme manager. hehe :D
[Android Software Development] t-ryder:
I see, did not read that. Got

warning: Package not found for resource #1001004f

when trying to recompile framework.
[Android Software Development] zelendel:
It is has been known that MIUI has been using a different apktool that is modified to work with all the changes they make. At one time the OP stopped supporting MIUI and a few other China based distros because he cant support all the stupid changes they make.
[Android Software Development] t-ryder:
I know. But could've been that someone knows the exact cause and how to fix.
[Android Software Development] zelendel:
You have to compile the apktool with the changes they make. You may have better luck on the MIUI site. You wont find much help here with that rom. Not really respected or worked on here.
[Android Software Development] t-ryder:
For good reasons... I know. Xiaomi sucks, but MIUI is still the best for me.

Thanks anyway.
[Android Software Development] Ban Dan:
Sorry, can't help, but would be most interested in how you got it to run on the phone!

Any detail will be appreciated :)
[Android Software Development] zelendel:
Sometimes of you try reading the error log sometimes the answer is plain and simple even if you are not really sure what you are looking at or for.
[Android Software Development] ravian29:
thanks alot for your reply i am really happy someone senior jumped in, i have become almost half mad after focusing on these issues for last 5 days but not able to manage them. can you please see other scenarios ? apktool 2.0.1 works fine on systemUi of samsung 5.1.1 for note 5 but when i flash it, i only see wallpaper and ui does not load at all
[Android Software Development] levone1:
Links and explanation here - http://xdaforums.com/sony-xperia-z1-compact/general/apktool-phone-t3230338 - I have successfully decompiled and recompiled system ui on KitKat, but stuck on above error for lp.
[Android Software Development] cowsquad:
How about Linux :-p
[Android Software Development] iBotPeaches:
Thanks for the apks.

Let me break something down that will be difficult to explain. Apktool is breaking styles.xml, not breaking it from booting or major style differences. It's just wrong. Point being. There is not many pure apks left in the xda scene. (apks that have never been decompiled or recompiled).

So users are just passing around broken SystemUIs (as an example). We could hard code fixes into apktool, but it might affect other things.

The fix is mainly for parent xml nodes that are private (as defined by updated aapt) , that's why the rebuild fails. Aapt doesn't give you a good error message, but that's the problem.

I'm including a new verbose parameter that allows aapt to echo its results into the bash screen. Note: this is a huge output. Some apks echo near 5,000 lines for it. So I swear if anyone of you post that in here in the future I will very mad.

I will be releasing very easy FAQ for styles.xml fixes that will fix SystemUI rebuilds along with apktool v1.5.0 in due time. Need to get my testers to test it first.

Sent from my SGS3 AT&T Variant
[Android Software Development] iBotPeaches:
Forget that aapt (its an old patched one). I built the newest aapt from source with the MIUI changes so it works with both MIUI and other APKs.

Driving to campus to get access to OS X and Windows so I may compile aapt correctly for all 3 platforms.

This aapt will be a needed component to apktool v1.5.0

Sent from my SGS3 AT&T Variant
[Android Software Development] rquiett:
Ok so it has been way too long since I set up apktool and I am at a loss right now. I downloaded the latest apktool and I know I need more than that. I do have the android sdk set up and java on here. Is there a guide on how to set this up somewhere I am missing?
[Android Software Development] cowsquad:
Google apktool and you'll find a link for it. Easy just move apktool.jar and aapt to use/bin/local (Linux) windows is way easier.
[Android Software Development] rquiett:
Ok thank you for that I was on the right track but for some reason it didn't setup the right framework file the first time through with the command but its working now. Thanks again and thank you again iBotpeaches stellar product
[Android Software Development] CosmicDan:
Yeah my mistake, apktool / aapt is not causing my port issues but it was bad smali code. Aapt from this thread is still ideal. Cheers.

Sent from Xperia Play (R800a) with Tapatalk
[Android Software Development] gcrutchr:
@iBotPeaches

I posted a stock framework-res.apk and SystemUI.apk for the ASUS Transformer Infinity (ICS v4.0.3) in POST #340.

Thanks for your hard work!

Gary
[Android Software Development] pierx:
Hi iBotPeaches

Thanks for continuing this project.

Just reporting, in previous version of your modified apktool, apk that i build (mostly theme) was easily installed through adb.

Now, everytime i build the apk's and install from adb it's always resulting "Failure [INSTALL_FAILED_INVALID_APK]"

it's been signed and build with no errors though. So, i need to install it form device.

it's not big problem for me at all, but just want to let you know ;)
[Android Software Development] adulfo:
When renaming framework-res after decompiling, many errors on RECOMPILING, thus unsuccessful...

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

ption: could not exec command: [aapt, p, -F, E:\DOCUME~1\PS1EDE~1.AVU\LOCALS~1\T

emp\APKTOOL1521873779580952440.tmp, -x, -S, E:\Documents and Settings\Administra

tor\apktool\fmmuiu2831\res, -M, E:\Documents and Settings\Administrator\apktool\

fmmuiu2831\AndroidManifest.xml]

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

a:251)

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

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

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, E:\D

OCUME~1\PS1EDE~1.AVU\LOCALS~1\Temp\APKTOOL1521873779580952440.tmp, -x, -S, E:\Do

cuments and Settings\Administrator\apktool\fmmuiu2831\res, -M, E:\Documents and

Settings\Administrator\apktool\fmmuiu2831\AndroidManifest.xml]

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

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

a:249)

... 6 more

Thanks for this powerful tool.
[Android Software Development] iBotPeaches:
Nothing in that error helps me. Copy the lines above and below that.
[Android Software Development] adulfo:
Sorry... I have decompiled many framework-res, so I just rename the resulting folder. But before I decompile, I install the corresponding framework..

E:\Documents and Settings\Administrator\apktool>apktool b fmmuiu2831 fm2831.apk

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

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

ption: could not exec command: [aapt, p, -F, E:\DOCUME~1\PS1EDE~1.AVU\LOCALS~1\T

emp\APKTOOL1521873779580952440.tmp, -x, -S, E:\Documents and Settings\Administra

tor\apktool\fmmuiu2831\res, -M, E:\Documents and Settings\Administrator\apktool\

fmmuiu2831\AndroidManifest.xml]

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

a:251)

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

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

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, E:\D

OCUME~1\PS1EDE~1.AVU\LOCALS~1\Temp\APKTOOL1521873779580952440.tmp, -x, -S, E:\Do

cuments and Settings\Administrator\apktool\fmmuiu2831\res, -M, E:\Documents and

Settings\Administrator\apktool\fmmuiu2831\AndroidManifest.xml]

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

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

a:249)

... 6 more
[Android Software Development] CosmicDan:
Looks like bad smali code, apktool wont tell you smali code errors (possible future feature?) So try using baksmali to see your bad code.

EDIT: Nevermind, didnt realize it was framework resources.

Sent from Xperia Play (R800a) with Tapatalk
[Android Software Development] iBotPeaches:
Still don't see anything to go on in that error.

Gonna release v1.5.0 in a couple of days. Let's wait for that and see if it resolves it.

Sent from my SGS3 AT&T Variant
[Android Software Development] adulfo:
Thanks... As for now, will refrain from creating name other than the original.
[Android Software Development] wali01x:
thanks for the time you're putting into this ibot and will wait for ur v1.5
[Android Software Development] Fusion777:
Apologies for the nubish question.

I am trying to fiddle with the Google Wallet app (don't ask :angel: ) but it fails with a litany of 'No resource identifier found' errors, such as:

C:\Projects\gwallet\com.google.android.apps.walletnfcrel-2\res\layout\prepaid_top_up_verify_account_view.xml:12: error: No resource identifier found for attribute 'editTextId' in package 'com.google.android.apps.wallet'

I dig into prepaid_top_up_verify_account_view.xml and I notice:

<?xml version="1.0" encoding="utf-8"?>

<com.google.android.apps.wallet.ui.widgets.SafeViewFlipper android:layout_width="fill_parent" android:layout_height="fill_parent"

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:wallet="http://schemas.android.com/apk/res/com.google.android.apps.wallet">

and

<com.google.android.apps.wallet.ui.widgets.ValidatedEditText android:id="@id/TopUpVerifyFirstName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" wallet:editTextId="@id/TopUpVerifyFirstNameInnerId" wallet:nextFocusRight="@id/TopUpVerifyLastNameInnerId" wallet:nextFocusDown="@id/TopUpVerifyLastNameInnerId" />

Deeper in. I'm pretty new at this, so I can't tell if it's merely a schema lookup failure or if maybe it's an underlying smali recompilation issue. Or something else? Any advice is appreciated. Thank you

-- EDIT

Also digging in further find R$attr.smali with:

.class public final Lcom/google/android/apps/wallet/R$attr;

... (lots of lines of smali-ness)

.field public static final editTextId:I = 0x7f010000

Suggesting it at least sorta decompiled it properly...
[Android Software Development] iBotPeaches:
Those aren't regular attributes, are there any other apks you know that use a different schema?

It means the underlaying framework isn't updated to handle that.

Not gonna look into it for this upcoming version, but send me apks and ill try later.

Sent from my SGS3 AT&T Variant
[Android Software Development] Fusion777:
Here are some relevant APK's:

Straight up stock: gwallet APK

From my CM10 kang: framework-res.apk

for the record, using the older framework-res.apk from this thread yielded the same results.

I can't think of any other APK's, this looks pretty self-contained to me (if I understand your question properly). Or do you mean other APK's which use a separate schema so we can test decompile/recompile on them? I *think* DSPManager does. I will doublecheck.

If there's anywhere specific I should be looking, I'm all ears. Thank you for your help---

edit

DSPManager only has a few custom elements, but no custom attributes or schemas that I could find.

edit 2:

Think it may be related to this
[Android Software Development] iBotPeaches:
I have fixed the random SystemUI problem along with the Contacts FC (relating to T9Map). This was a damn long week of apktool.

Point being, any ROM with the name "nyandroid" is wrong (in terms of apktool modifying). I'd like to get in contact with the developer(s) of those ROMs. The structure of some of the APKs are so bad they can't be recompiled. I don't know who is at fault with that, but not really gonna chase em down as its not my problem.

I use stock SystemUI's from samsung, htc and AOSP and I can decompile, rebuild, decompile over and over without error.
[Android Software Development] exodius48:
Did you tried this workaround http://en.miui.com/thread-162639-1-1.html ?
[Android Software Development] djdarkknight96:
When editing system files I usually NEVER use the dist apk. I build then use an untouched stock apk and open it with 7 zip. I then go to the build folder and drop only the files I edited to the untouched stock apk. Then I flash that...Works perfectly on M so far. I'm always worried something doesn't decode right and this always works unless I mess up an edit. Then I'm not chasing apk tool errors all day..Just mine lol

Hope that helps.

DJ
[Android Software Development] ravian29:
thanks a lot for your reply, definitely going to try this method will report back :good:
[Android Software Development] bovirus:
[MENTION=5210243]exodius48[/MENTION] [MENTION=535343]all[/MENTION]

As you can check I can try to fix the installation of apktool tool in my configuration.

Before latest changes I always compiled apktool.jar without problem.

With latest changes didn't work (gradlew.nat applypatches didn't work)

Could you help me? Did someone you compile recently apktool?

Could you make an rachive with your apktool structure (got from github) and uploaded it into a host repository?

It's the only way to check and try to fix it.
[Android Software Development] laura almeida:
[MENTION=637263]bovirus[/MENTION]

Vola!! It is working now!!

PM me, I will guide you to build
[Android Software Development] bovirus:
[MENTION=5331708]laura almeida[/MENTION]

Thanks for your report. Now I'm clear that I'm not alone.

Because as I can see in previous post I reported it many time but for someone is just only a my problem about my configuration.
[Android Software Development] laura almeida:
[MENTION=637263]bovirus[/MENTION]

Check your PM!!
[Android Software Development] mjraogr:
Laura

Did you use for MIUI framework?

Tks

I'm finding for apktool with jar for Bcloud OS