yashsingh1/xdaforums huggingface dataset:
[Android Software Development] yash92duster:
Help Required regarding Recompiling apk

[MENTION=3924617]iBotPeaches[/MENTION],

Help Required :crying:

I have Decompiled the apk successfully

but

when recompiling I get errors

I have copied apktool.bat & apktool.jar to C:\Windows

I am using latest version of java
[Android Software Development] yash92duster:
decompile & recompile is success

For samsung camera 4 apk

Microsoft Windows [Version 6.1.7601]

Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows>apktool d C:\Windows\SamsungCamera4.apk

I: Using Apktool 2.1.1 on SamsungCamera4.apk

I: Loading resource table...

I: Decoding AndroidManifest.xml with resources...

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

I: Regular manifest package...

I: Decoding file-resources...

I: Decoding values */* XMLs...

I: Baksmaling classes.dex...

I: Copying assets and libs...

I: Copying unknown files...

I: Copying original files...

C:\Windows>apktool b C:\Windows\SamsungCamera4

I: Using Apktool 2.1.1

I: Checking whether sources has changed...

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

I: Checking whether resources has changed...

I: Building resources...

W: warning: string 'GPS_msg' has no default translation.

W: warning: string 'editableshortcut_helptext' has no default translation.

W: warning: string 'reset_dialog_msg' has no default translation.

I: Building apk file...

I: Copying unknown files/dir...

But I get warnings in between, Will it affect the recompiled apk???
[Android Software Development] Dzepar:
It won't affect, missing strings translation is only telling that :)

Sent from my XPERIA M2
[Android Software Development] edzamber:
No, its missing strings translation, no impact to recompiled apk, it should working properly.
[Android Software Development] Dethfull:
Did you imported your frameworks-all-res.apk before decompilation,? If no, import first, and dexompile gain.
[Android Software Development] yash92duster:
Should I first place in c:\windows framework res.apk and twframework.apk and decompile them

After that only should i decompile the app I want to make changes??
[Android Software Development] dic1911:
the correct way to install framework is explained at the apktool web page

run "apktool if framework-res.apk"
[Android Software Development] yash92duster:
Ok

Will try it out and report
[Android Software Development] Dethfull:
Exact, some apps will fail, some anothers no, if qihoo is your framework feature, the decompilation process will fail, if the apktool installed framework or blank framework consts in apktool installation. Sometimes, rarelly, blank frameworks are good, but your framework haves builted qihoo, and is someyhing exclusive from your mobile. So, you are obligated to import your frameworks because, untill this point: qihoo feature.

---------- Post added at 03:02 PM ---------- Previous post was at 02:42 PM ----------

You can try this: https://code.google.com/archive/p/apktool/downloads too, you need root, it runs apktool like pc apktool direct on mobil. Try, XD
[Android Software Development] yash92duster:
Will try it

Thanks for info :)
[Android Software Development] arun483:
No support for mm apks yet? I am not able to recompile mm apks
[Android Software Development] Train88:
Yes there is support for MM... TeamBlackOut has been theming MM since the developer previews. What's your issue?
[Android Software Development] arun483:
I can't successfully recompile CMUpdater from CM13 I am using APKTool by BDFreak and latest apktool.jar.
[Android Software Development] Train88:
Use the apktool command line way. I haven't used anything besides the apktool cmd way since LP, all the gui's are almost always what creates the problem. Make an "apktool" folder on the root of your machine with apktool.jar, apktool.bat, a new cm13 framework-res.apk, and the apk you're decompiling.

Edit: I don't remember, is CMupdater a system app? You might want to try the cmd "apktool b -c CMupdater"
[Android Software Development] starbucks2010:
Do you have any "space" in your path "E:\Port...."? If yes, you should remove that space; I heard.that java doesn't like spaces in the path. You can try also the latest apktool v2.1.1.

Good luck.
[Android Software Development] arun483:
Yup that was the issue thanks :D
[Android Software Development] iBotPeaches:
This should be fixed as of - https://github.com/iBotPeaches/Apktool/commit/a684bae43ae51859a3bd933dc0d52c3186eb8abf and https://github.com/iBotPeaches/Apktool/commit/606e47bf557cb23aa150acb237c8f0068cce50fc
[Android Software Development] edzamber:
[MENTION=3924617]iBotPeaches[/MENTION],

Many Thanks for theses commits but it seems not fix SecSettings2 and twframework-res.apk recompilation.

Here are logs.
[Android Software Development] iBotPeaches:
Those commits were to fix the "janky" animation that presented after using Apktool. Not every commit to apktool fixes every bug possible :) Nothing in those commits targeted that problem.
[Android Software Development] edzamber:
Ok... Sorry for my misdunderstanding [emoji14]

Maybe it will be fix as soon twframework-res.apk can be recompiled.

Thanks anyway for your great job [emoji6]
[Android Software Development] claude96:
check here on how to recompile MM twframework-res.apk : http://xdaforums.com/showpost.php?p=67483997&postcount=7502

[MENTION=3924617]iBotPeaches[/MENTION] maybe this can help somehow with the issue !
[Android Software Development] genuine55:
[MENTION=3924617]iBotPeaches[/MENTION] I've been trying to install my system ui in apktool but keep getting this error any help by any chance I upgraded to 2.1.1 because was getting the same error on 2.0.0 I'm running tmobile s6 marshmallow thanks any help would be appreciated
[Android Software Development] Ticklefish:
SystemUI.apk isn't a framework file. You don't need to install it
[Android Software Development] micky387:
Yes ,right and when you install Framework ,use apktool if xxxx not aoktool if ..... it's a mistake ;)
[Android Software Development] DoctorStrange96:
Err... Apktool is not properly decompiling motorola framework-res files (tested this on a 6.0 moto g2 rom).

W: Config flags size > 52. Exceeding bytes: 0x16662214.
W: Invalid config flags detected: string-mcc204-mnc4-ERR0
W: Config flags size > 52. Exceeding bytes: 0x16662214.
W: Invalid config flags detected: array-mcc204-mnc4-ERR1
W: Config flags size > 52. Exceeding bytes: 0x16662214.
W: Invalid config flags detected: bool-mcc204-mnc4-ERR2

Also, the menu opening animation is messed up (slower) after recompiling, no matter if any file was edited.
[Android Software Development] Crussader:
Try the "dirty" version of ApkTool, not the release version.
[Android Software Development] bovirus:
[MENTION=3924617]iBotPeaches[/MENTION]

On the first post there is the info/changelog about version 2.1.1 but the downlaod link is about version 2.1.0.

Could you please fix it?
[Android Software Development] sebastiandg7:
I am being a little confused... When I decompile my framework all of the public ids start with 0x01.... but the smali files of the some system apps contains 0x7.... ids..... Whats wrong?
[Android Software Development] Lenny Bard:
Hey everyone, I have this error on recent rom : "[Fatal Error] AndroidManifest.xml:1:1: Content is not allowed in prolog."

You have an idea ?
[Android Software Development] Ticklefish:
Looks like you have something on line 11 of your AndroidManifest.xml that you shouldn't..
[Android Software Development] Lenny Bard:
Hum at line 11 I've got this : <uses-permission android:name="android.permission.ACCESS_ALL_EXTERNAL_STORAGE"/>

It's strange I have this error only on systemui and not on all samsung firmware..
[Android Software Development] edzamber:
Hi,

Here mate

https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.1.1.jar
[Android Software Development] bovirus:
[MENTION=4507636]edzamber[/MENTION]

Thanks for the link.

I'm using develop build. I wrote it to fix for standard users.
[Android Software Development] Dragon-snaff:
i have some proplem with framework-res.apk and twframework

i take the frameworks from s7 and i try to decompile some system apps but it said there is proplem

any fix??

any framework that's working without a trible?
[Android Software Development] pablo2002:
Great work! Thanks iBotPeaches

Thank you iBotPeaches!!! Great job! i finally did can decompile and recompile and edit SystemUi.apk on samsung Note 5 N920C. Apktool is very usefull to me, thanks!!! You are a genius!!!
[Android Software Development] secretmyth:
I got this while I try to recompile Macrodroid v3.13.15

I: Using Apktool 2.1.1

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

I: Smaling smali_classes2 folder into classes2.dex...

I: Building resources...

W: E:\td\tt\res\layout\preference_list_fragment.xml:4: error: Error: Resource is not public. (at 'id' with value '@android:id/menu').

W:

W: E:\td\tt\res\layout\preference_widget_switch.xml:2: error: Error: Resource is not public. (at 'id' with value '@android:id/right_icon').

W:

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ciy\AppData\Local\Temp\brut_util_Jar_5879612881221841332.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 4043, --version-name, 3.13.15, -F, C:\Users\ciy\AppData\Local\Temp\APKTOOL4714382295390595248.tmp, -0, arsc, -0, apk, -0, arsc, -I, C:\Users\ciy\apktool\framework\1.apk, -S, E:\td\tt\res, -M, E:\td\tt\AndroidManifest.xml]

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

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

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

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

at brut.apktool.Main.cmdBuild(Main.java:224)

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

Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ciy\AppData\Local\Temp\brut_util_Jar_5879612881221841332.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 4043, --version-name, 3.13.15, -F, C:\Users\ciy\AppData\Local\Temp\APKTOOL4714382295390595248.tmp, -0, arsc, -0, apk, -0, arsc, -I, C:\Users\ciy\apktool\framework\1.apk, -S, E:\td\tt\res, -M, E:\td\tt\AndroidManifest.xml]

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

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

... 5 more

Caused by: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ciy\AppData\Local\Temp\brut_util_Jar_5879612881221841332.tmp, p, --forced-package-id, 127, --min-sdk-version, 15, --target-sdk-version, 23, --version-code, 4043, --version-name, 3.13.15, -F, C:\Users\ciy\AppData\Local\Temp\APKTOOL4714382295390595248.tmp, -0, arsc, -0, apk, -0, arsc, -I, C:\Users\ciy\apktool\framework\1.apk, -S, E:\td\tt\res, -M, E:\td\tt\AndroidManifest.xml]

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

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

... 6 more
[Android Software Development] Ticklefish:
You have an issue with two ids in your APK..

E:\td\tt\res\layout\preference_list_fragment.xml:4: error: Error: Resource is not public. (at 'id' with value '@android:id/menu').
E:\td\tt\res\layout\preference_widget_switch.xml:2: error: Error: Resource is not public. (at 'id' with value [EMAIL="'@android:id/right_icon')."]'@android:id/right_icon').[/EMAIL]

You'll need to fix those to get your APK to recompile.
[Android Software Development] secretmyth:
thanks for replay..this happen because dev add support for Android N.

with old version I don't have this problem.

apktool v2.1.1 support Android N??
[Android Software Development] zelendel:
To be honest. Who ever it is doing that has jumped the gun. The source code is not fully released. Without the full source you cant be sure how things will work.

You will have to wait for Oct when the source is released. Real devs don't build off of preview code.
[Android Software Development] secretmyth:
thanks you for replay....I'll wait for source code then.
[Android Software Development] kos25k:
hello andromaniacs..as you are my last hope,I will post here my ooold wish.I dont think is possible,but never know..

So guys I want my privacy back.I've searched maaaaany hours,tested every single possible solution I found on google,w.o result.I want to get rid off this stupid timestamp that appears below my name (others see) on facebook messenger.You know,this stupid timestamp (active now,active before X minutes,hours etc.) even my chat is turned off.So can anyone reasonable answer me,what is the point of turning the chat off,from the point that anyone can see you if you are online on facebook by just looking below your name in messenger and see this timestamp???currently I gound a way to hide this timestamp only from firefox on PC with an addon called FB master.I read also that iphone users can achieve this with bluepill and other jailbreak apps.so will we sit and do nothing for our privacy?come on bro's this is rediculuous.I don't know android programming etc...but I am 100% willy to co-operate with anyone who wants to achieve this..I see 95% of android mods are about graphics and sound.is this logical dudes??What about our lost privacy???

Sorry for my tone,but I am really fed up after over 50 hours searching google and found nothing.I would really appreciate if someone send me a p.m to see what to do,or talk about possible solutions inside this thread.Thanks for listening to me bro's.
[Android Software Development] OsitKP:
Hi!

Any chance to make the tool copy utf-8 named files? It crashes while trying to do this.
[Android Software Development] iBotPeaches:
That's probably your charset or environment problem. It handles UTF8 chars fine here. Whether AAPT chokes on those characters is a different story being tracked in bug #885
[Android Software Development] AngeL_219:
How can i fix This

How can i fix this :confused:

I will only do is editing /res/values/styles.xml

Plss.Help Me :)
[Android Software Development] OsitKP:
The app crashes while copying utf8 named files from package (not smali).
[Android Software Development] Ticklefish:
You have a lot of this sort of error:

W: D:\Apps\Virtous Ten Studio\Apks\Workspace\StockSettings\res\layout\preference_header_switch_item.xml:11: error: Error: No resource found that matches the given name (at 'style' with value '@com.mediatek:style/ImageSwitch').

This is saying that you haven't provided the right resources when you first decompiled your APK. Make sure to install any and all framework files before you decompile.

That's to do with apktool 2.2, which isn't out yet. It's best to report this issue on github rather than in here. This is only for the official versions of apktool.
[Android Software Development] bluflight:
Guys, but apktool support oxygenos apk's from oneplus 3?
[Android Software Development] Ticklefish:
Probably. Try it and see. Any problems, let us know.
[Android Software Development] Carotix:
i'm trying to edit ClockPackage 6.0.1 for s6

i tried different apktool ... 2.1.1 , 2.1.2 dirty ... i'm using the last TMA ..

well , i can decompile and recompile but i get this log and my flash get always fc

i tried with or without signature .. but i get the same log

Recompiling "ClockPackage_M_Osup.apk" With New Signature,
in work area "_WorkArea1", using "apktool-2.1.2-dirty-small.jar"

With Tickle My Android 13.4.1.0.
(tinyurl.com\ticklemyandroid)

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

I: Using Apktool 2.1.2-dirty
I: Smaling smali folder into classes.dex...
I: Building resources...
W: E/ResourceType(11052): Failed resolving ResTable_map name at 3032 with ident 0x02040075
W: E/ResourceType(11052): Failed resolving ResTable_map name at 1796 with ident 0x02040004
W: W/ResourceType(11052): Attempt to retrieve bag 0x0201002b which is invalid or in a cycle.
W: E/ResourceType(11052): Failed resolving ResTable_map name at 2980 with ident 0x02040075
W: W/ResourceType(11052): Attempt to retrieve bag 0x02010051 which is invalid or in a cycle.
W: W/ResourceType(11052): Attempt to retrieve bag 0x02010051 which is invalid or in a cycle.
W: warning: Package not found for resource #02010052
W: warning: Package not found for resource #0201002b
W: warning: Package not found for resource #0201002b
W: warning: Package not found for resource #02010051
W: warning: Package not found for resource #02010051
W: warning: Package not found for resource #02010051
I: Building apk file...
I: Copying unknown files/dir...

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

Recompile Successful!

can anyone help me?
[Android Software Development] starbucks2010:
Is this a Samsung clock app? If yes, have you installed the correct version of framework and tw-framework? Try also some older versions of apktool like 2.0.2.
[Android Software Development] _alex74_:
hi mate long time no see you...

in fact those errors pops out even on contacts and setting, which for some weird reason works anyway with no issues here

I think [MENTION=3924617]iBotPeaches[/MENTION] already aware of it
[Android Software Development] :
It's in either xml or most likely smali like showtimestamp
[Android Software Development] kos25k:
duuuudeee!!thanks god at least you are the first who answer me at least something!!!I don't know unfortunately nothing about programming..if anyone help me firther...I really will owe him muuuuchhh...
[Android Software Development] Necromancer3:
can't decompile the nfc apk. anyone knows what framework is needed?

This is for LG G3 D855 30C (Marshmellow), but any pointers are welcome

F:\NFC>apktool install-framework framework-res.apk
I: Framework installed to: C:\Users\Necromancer\apktool\framework\1.apk

F:\NFC>apktool d lgnfc.apk
I: Using Apktool 2.1.1 on lgnfc.apk
I: Loading resource table...
I: Decoding Shared Library (com.lge), pkgId: 2
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Necromancer\apktool\framework\1.apk
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x020a01b1
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x020a01b1
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x020a01b1
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x020a01af
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x020a01ac
I: Decoding values */* XMLs...
Can't find framework resources for package of id: 2. You must install proper framework files, see project website for more info.
[Android Software Development] Padong1523:
How to fix this one? Error in recompiling, even I haven't edited anything. (T_T)
[Android Software Development] iBotPeaches:
Just to update everyone here versus my split communication across social media. 2.2.0 is coming out this weekend (Maybe Monday) and is a bug fix release with a tiny feature change. The storage location for frameworks are moving into file system locations that aren't visible without hidden directories on. This should clean up $HOME folders and more and lead to the future of Apktool managing its own frameworks efficiently.

2.2.1 will closely follow whenever Android Nougat is released and patched. I think aapt2 (The 2nd major iteration of aapt) is coming and might be the default. No one will know if old aapt will be able to build Nougat apps so the release might take awhile. This is why 2.2.0 is being released before Nougat.
[Android Software Development] iBotPeaches:
A new version has been released!

v2.2.0 (Released August 7, 2016)

Download: https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.2.0.jar

Details of Release: https://connortumbleson.com/2016/08/07/apktool-v2-2-0-released/
[Android Software Development] :
Amazing wish huawei wouldn't mess with their apps so framework stuff never gets to work ? damn I love this ? going from one phone to another which has issues loading framework oh well my regular luck thanks for your amazing work as always though ?
[Android Software Development] potorino:
credits

how to remove the credits in a moded game can anybody teach me how by using apktool i can't find it
[Android Software Development] :
Well I already answered you how.

Now it's up to you. Since it's obviously a pirated game I won't help you more than that.
[Android Software Development] DaOldMan:
Dear Dev,

There are no fixes for Samsung users in the latest apktool: MM twframework-res.apk recompile issue still persists. MM SecSettings2.apk recompile resource table error still persists.

Are you aware of those problems ? Are they on your list to be fixed ?

Thanks a lot for your time and wonderful work !
[Android Software Development] crazyramen:
Amazon Fire 1.apk

Hey, I'm pretty new at this, so sorry if this is a noob question, but I couldn't really find anything on the forums. I tried this out for the first time on my Fire HD 6. I decompiled the framework (framework-res.apk, SystemUI.apk, and amazon-res.apk) with no issues. It gave me the framework files 1.apk, 16.apk, and 127.apk. I'm trying to edit the SystemUI.apk. When trying to recompile SystemUI.apk (without editing any files) it gives me the error that it cannot find 1.apk in the /root/apktool/framework folder. It is there, and when I try using them in a different folder with option -p, I get the same error.

So my question: is this an issue with the Fire HD, or am I doing something wrong? If this is a simple thing I'd appreciate it if someone could point me in the right direction for learning more.

EDIT: ok just found out that I have java 1.8, going to try to rollback now. That didn't work... helppls

[IMG="Error Message and Framework Folder"]https://lh6.googleusercontent.com/ma7QjKMpFt9tMzaDzC6Hh4aPeB9AVjj7pLdE0lG0fTFQKXEIfpTP7fwBGCYm-6IN4yzNANgFEVlJddY=w1366-h654-rw[/IMG]
[Android Software Development] iBotPeaches:
I have lots of Samsung related reports open. Not owning any Samsung device, its hard to get these investigated and fixed.

https://github.com/iBotPeaches/Apktool/issues/1258 -

https://github.com/iBotPeaches/Apktool/issues/1259

https://github.com/iBotPeaches/Apktool/issues/1278

Have you tried the new 2.2.0 release? That version doesn't store frameworks in that location. You don't need to install SystemUI. So try newest release and let me know.
[Android Software Development] crazyramen:
Thanks for the response. Stupid mistake not having the latest version, I know. I tried it again after updating and I got similar errors. Now it recognizes 1.apk, but it gives me similar errors regarding /tmp files.

I have java version 1.7.80, apktool version 2.2.0, and aapt version .2-23.0.2

[IMG="NewErrors"]https://lh3.googleusercontent.com/zrogGkrT3WsRluXnBuGMQJFo9W6CujKNr73pg_60LEg7-iS1k7PxCXpY5hrmD7naLQ-LLJWE48Yc2HA=w1366-h654-rw[/IMG]

Thanks for all your help.
[Android Software Development] DaOldMan:
How can we help (beside buying you a Samsung device which you deserve [emoji1] [emoji2] ) ? We have many devs in xda Samsung community that will help I am sure.

Phronesis team member
[Android Software Development] kos25k:
Can anyone kindfull enough please,decompile and recompile ANY facebook mobile app for me,with removed the timestamp "active now,active before X mins.." that appears below our name??(don't even know if this is possible)

Στάλθηκε από το XT1562 μου χρησιμοποιώντας Tapatalk
[Android Software Development] Ticklefish:
You don't have a Samsung device? I'll have to see how much I can donate so you do. It won't be much but those guys are such troublemakers with their files that it would be for a worthy cause!
[Android Software Development] thereassaad:
[MENTION=3924617]iBotPeaches[/MENTION] , just a smal donation from here

Confirmation code

7GM12642627829845

Thank u so much for ur hard work & hope all devs / guys do it & u can buy a Samsung device , , ???? ..