yashsingh1/xdaforums huggingface dataset:
[Android Software Development] IZI.Xav:
Apk compilation problem with apktool 2.2.1 on marshmallow

Hello everyone, here I look well on the thread but I'm not sure I got my answer.

I work on ubuntu 16.04 apktool 2.2.1 works perfectly for decompile & conmpile also my apk but with its errors:

Compiling SecSettings2.apk ...
I: Framework installed to: /home/xav-famousrom/.local/share/apktool/framework/1.apk
I: Framework installed to: /home/xav-famousrom/.local/share/apktool/framework/127.apk
I: Using Apktool 2.2.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 'device_info_software_summary_wifi' has no default translation.
W: warning: string 'device_info_status_summary_wifi' has no default translation.
W: warning: string 'pdg_summary_title' has no default translation.
I: Building apk file...
I: Copying unknown files/dir...

Then by installing the apk it does not work or it crashes.

Apk: 6.0.1 marshmallow

S6 edge +

If someone has an idea about the worry thank you
[Android Software Development] dic1911:
Then you must did something wrong, in my case it's changing the package name, it didn't gave me any error, but I didn't do it right, so it just crashes
[Android Software Development] [] AL []:
Moved my question to the Q/A thread to keep this one clean for developments.
[Android Software Development] iBotPeaches:
A new version has been released!

v2.2.2 (Released January 23, 2017)

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

Details of Release: https://connortumbleson.com/2017/01/23/apktool-v2-2-2-released/
[Android Software Development] DaOldMan:
This whole problem is still the old bug with twframework-res. For a long time apktool can't use the resources from twframework-res correctly. We need to remove the spinner tag (reference) and then than the app will use Googles original time picker instead, which is not in twframework-res.....

I understood [MENTION=3924617]iBotPeaches[/MENTION] bought an S5 in order to fix this but as this was months ago it seems we are stuck with this problem. It's more then the time picker of course. I hope to hear some good news about this soon.
[Android Software Development] edzamber:
[MENTION=3924617]iBotPeaches[/MENTION],

Fantastic !!!!
[Android Software Development] Train88:
It's not a valid framework style... Go to that line in styles and change that parent style to something that exists in framework

Edit: I just double checked myself, it is valid. Maybe you need to update which framework-res.apk you're using to decompile/recompile with? Also, check everything in styles near those styles to see if something else is off
[Android Software Development] Team DevDigitel:
thank you guys for the update!!!! its working again with my dec patch android n systemui and other system apps! it was really holding me back. you are awsome!
[Android Software Development] DaOldMan:
That looks promising ???. Finally we can use Samsungs time picker?
[Android Software Development] edzamber:
I think Yes, i havn't try yet to re-enable it in SecSettings2... I will try [emoji2]

Edit : it doesn't working [emoji22]
[Android Software Development] :
[MENTION=3924617]iBotPeaches[/MENTION] the issue 885 and 1389 is the new protection method issue where xml files was stored in root of app in Chinese? Is this fixing that issue?
[Android Software Development] djdarkknight96:
Anyone report the round icon issue in manifest? Keeps triggering errors, also shortcuts in xml folder. The attributes aren't being pulled from framework.

Sorry i know I should search but I'm a little busy atm.
[Android Software Development] thereassaad:
Yes sir , i faced those no resources on Google App , in manifest & in xml too ..

Edit ::

Im sure it's related to framework installation , as i faced same on Samsung browser & only fixed by installing latest Samsung framework exactly nougat one ..
[Android Software Development] djdarkknight96:
I have N framework with those attributes so it's not that.
[Android Software Development] thereassaad:
Yes for Google App same here too with n framework & they still no resources , only fixed them by deleting those resources from manifest & from 2 xml in xml-v22 ( shortcuts.xml & voice_interaction_service.xml ) , i know it's bad idea to delete them .. ?
[Android Software Development] djdarkknight96:
Yeah I've build it successfully, mostly all Google apps have these issues. I'm just seeing if it was reported. If not I'll make a bug report.
[Android Software Development] asafyry:
great work and tested ..thx u so mush
[Android Software Development] tx_dbs_tx:
[MENTION=3924617]iBotPeaches[/MENTION] Thanks for your continued work and support of ApkTool. Your work in this dev community is definitely a major role in everything we do here. You are irreplaceable my friend, Thanks again! :highfive:
[Android Software Development] iBotPeaches:
Both should be fixed. 1389 was personally tested, but no longer had APK from 885 (due to losing that HDD a couple months ago). Since the stack trace of 885 matched that of 1389, I closed them both as fixed with the changes in 2.2.2. Now 885 had additional problems, but the original report was about invalid tokens in XML files.

I did have an S5 for about 3 days. It arrived during busy business trips and I took it with me to hack on it in a hotel and it got stolen. Android Device Manager can never find the device so I assume who ever stole it knew exactly what to do so most of the Samsung issues being fixed are because of the similarity in fixes, nothing intentional.
[Android Software Development] zeestats:
Nice work...
[Android Software Development] djdarkknight96:
Apktool 2.2.2 and 7.1.1 framework fixed round Icon and shortcut issues. I was using 7.0 fw which only has shortcut attributes.
[Android Software Development] DaOldMan:
Damn, does it mean we can forget about the problems with twframework be fixed ?
[Android Software Development] :
[MENTION=3924617]iBotPeaches[/MENTION] i think you should add this batchapk tool is working for huawei files most of them at least

To op for people who still asks for how to decompile huawei files.

It can decompile framework and most apps except settings apk it framework apk might need some extra edit after compile since it seems to decompile and recompile except it looses some strings or values but most stuff seems to work anywam
[Android Software Development] moluntic:
hey guys,i have problem with secsetting.

i fkash my rom without any modification of secsetting2.apk

i edit secsetting and add my rom info to it (tried with apktool v2.2.1)

i flashed just secsetting and works great

but

i used this new secsetting and included it to same rom zip

i flashed rom cleanly (wiped everything)

after booting setting receiver shows me FC and setting app wasnt there in app drawer

please help
[Android Software Development] edzamber:
Bad recompilation of your apk. Package error.

Try to install SecSettings as normal apk, you will see package error.

You need to recompil again or drag and drop all from recompiled SecSettings to original one (drag and drop all as ressources.arsc, classes.dex, res folder and Asset folder if exist, but not META-INF and androimanifest)
[Android Software Development] moluntic:
ok i will try,thanks for replying
[Android Software Development] bailey2408:
can you post tool? dying to try to mod a few things on my mate 8
[Android Software Development] Master_T:
Hi everyone

I'm trying to use ApkTool to decompile the YouTube apk to do some simple color modding.

Being new to modding, the first thing I wanted to test is whether the tools are working correctly, before doing any modding. So I just decompiled, recompiled and resigned the apk, using the following commands:

Decompile:

apktool d yt.apk

Recompile:

apktool b yt -o yt_rebuilt.apk

Signing:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore mystore.keystore yt_rebuilt.apk myalias

The commands seem to complete without any errors.

However, when launching the rebuilt apk on the phone, it just crashes at the splash screen.

By checking adb logcat, I found out that the crashed is caused by this exception:

java.lang.SecurityException: Signature check failed for com.google.android.youtube
at android.os.Parcel.readException(Parcel.java:1684)
at android.os.Parcel.readException(Parcel.java:1637)
at irb.a(Unknown Source)
at ipo.a(Unknown Source)
at jff.a(Unknown Source)
at jfj.run(Unknown Source)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at jhe.run(Unknown Source)
at java.lang.Thread.run(Thread.java:761)

Is this a problem with the rebuild apk, or am I doing something wrong when signing?

I see several modded versions of YT here on XDA, so there must be a way to do this properly... what am I missing?
[Android Software Development] Train88:
I do YouTube for TeamBlackOut... Your problem is that you tried to re-sign YouTube, but google has a signature verification built into java (smali) classes so it will not work without their signature. You must pull your edits into a stock apk with an archive tool like 7zip then you must flash it to system/app for it to work.
[Android Software Development] Master_T:
Thanks, worked perfectly!:good:
[Android Software Development] Phone_Guru:
Worked for me too with Youtube, Gmail and play store. Tried the same with maps and got an error that something went wrong during installation, please install again. Any ideas what that could mean?
[Android Software Development] Ydriod/YdroidExpo:
Cant find src files in apk i can only see fd and ir folder in classes2 dex and in classes fd tools appinfo

i want src file s of it cant even see main activity n all
[Android Software Development] djdarkknight96:
I haven't had maps work in years, not sure you can use it after altering it.
[Android Software Development] Phone_Guru:
I had it working until recently using a recompiled file flashed into data. That stopped working with nougat along with all of the other apps which I did the same way. However, as I said, I was able to get the others working again by bringing my changes into a stock apk using 7zip as recommended.
[Android Software Development] Thebear j koss:
[MENTION=7287427]MaxlMuller[/MENTION] you have too much xposed crap to dig thru that could be causing your errors. Uninstall anything xposed and retry is my suggestion.

The savage mutilation of the human race is set on course

protest&survive
[Android Software Development] cbucz24:
Hi,

I made some scripts I shared over in the themes section but I had a question about the apktool itself.

Is there a limitation built into it?

My scripts automate the process for Windows and the most I can get to decompile at once is 20. Anything more and only one is done.
[Android Software Development] STORMING BLOOD17:
apktool wont open

how do i run it
[Android Software Development] seanskiT!:
Read the OP
[Android Software Development] Mohammad.n:
Hi

When I want to Recompile Settings.apk (Redmi Pro Helio X25 Miui 8 Android 6.0 ) program that gives an error

Warning Package not found for resource #1001004f

What should I do ?
[Android Software Development] cbucz24:
Did you install the frameworks? Probably 2 you need installed if you haven't yet. And for good measure i usually do the systemui as well.
[Android Software Development] Mohammad.n:
Yes i am install

- framework-ext-res.apk

- framework-res.apk

- miui.apk

- miuisystem.apk

- mediatek-res.apk
[Android Software Development] zelendel:
You will need a special app tool for those. They make changes that apktool doesn't cover. Even after working with them the miui devs that for apktool developers gave up support. For miui.
[Android Software Development] Swapnil Soni:
i saw that apktool 2.0.0rc4 decompiles whatsapp.apk with drawable-xxhdpi with the attach image containing folders..

and in apktool 2.2.2 it decompiles it with drawable-xxhdpi-v4 folder with attach image files..

so which one should i use for subs theme overlay
[Android Software Development] xxhorseriderxxx:
Gboard

Anyone have any tips for modifying Gboard from Google? I recompiled with no errors and signed the apk using a market app and the app absolutely refuses to get past the welcome screen. Should I try a different method to sign the apk? Is there something I'm missing about modifying google apps?
[Android Software Development] Thebear j koss:
Can't sign google apps. Need to keep original signature and flash to system. May need to do something with the libs as well. Not even certain gboard can be modified or not, a lot of google apps like g+ and gmail won't work at all after touching any resources...

The savage mutilation of the human race is set on course

protest&survive
[Android Software Development] ungeeked:
On latest oxygen Os (7.1.1) , I changed a few hex color codes in settings APK. Upon recompiling, there were no errors, replacing the APK manually (with correct permissions) works and new colors are applied as expected.

However upon rebooting, phone keeps on booting infinitely.

This used to work previously on 7.0 based ROMS. I have already installed framework-res and oneplusframework, checked permissions etc. Could this be due to new security patch (March)?
[Android Software Development] zelendel:
So let me get this right. You replaced a file that was in use by the system and it got corrupted? Big surprise there. Run a log cat while in a bootloop from your pc. That will tell you why it is bootlooping
[Android Software Development] xxhorseriderxxx:
How do I preserve the original signature?
[Android Software Development] Thebear j koss:
https://ibotpeaches.github.io/Apktool/documentation/

Read. Learn. Everything you need and need to know about apktool and how to use correctly our good man Connor has provided documentation for.

The savage mutilation of the human race is set on course

protest&survive
[Android Software Development] ungeeked:
https://www.dropbox.com/s/phms700x6xft88u/logcat.txt?dl=1
[Android Software Development] Thebear j koss:
Your framework is muffed up. It fails to parse, so nothing will function as all necessary themes are pulled from framework causing your bootloop.

The savage mutilation of the human race is set on course

protest&survive
[Android Software Development] ungeeked:
Didn't touch framework. Only settings.apk :confused:
[Android Software Development] [] AL []:
Setting.apk, systemUI.apk and framework-res.apk are all pretty much intricate parts of a wider termed 'OS framework'. And for having meesed up my system quite a few times before playing with those, I've learned long ago that the best way to change any of those is to never do it 'hot plugged' (or manually if you prefer). Always make yourself a flashable zip AND as importantly, an UNDO zip.

This might even be more important in your case, because from what I could see, you seem to have full phone encryption. But I'm no expert here and guessing; allI know is that patching my framework to disable encryption was the first thing I did with this phone.

And btw, I wouldn't want to go much more OT here, but I wonder what is finally up with the Nougat's V2 signing/verification? I mean anyone could explain to me in 2 or 3 sentences what has changed in regards to using recompiled apps? Is it just a matter of disabling signature verification while installing in recovery mode?

Thx
[Android Software Development] djdarkknight96:
V2 is just an additional signature security but it's only on N. Nothing we have done signing apps has been affected.
[Android Software Development] Thebear j koss:
I was only commenting on why you are bootlooping. Something is causing your framework not to open upon boot, that is what i gather reading your log. Mismatched signatures or missing/corrupted files will cause this, i was just relaying what is the cause.

The savage mutilation of the human race is set on course

protest&survive
[Android Software Development] S5AndroidUser:
Apktool - Error retrieving parent for item: No resource found that matches the given

I tried to Change things in SystemUI.apk from LineageOS 14.1. I only made two changes in Colors.xml but when i tried to Recompile it, this Error comes up:

W: C:\Users\nicom\Desktop\Sonstiges\LineageOS\New\SystemUI\res\values\styles.xml:2139: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.StatusBar'.
W:

W: C:\Users\nicom\Desktop\Sonstiges\LineageOS\New\SystemUI\res\values\styles.xml:2140: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.StatusBar'.
W:

W: C:\Users\nicom\Desktop\Sonstiges\LineageOS\New\SystemUI\res\values\styles.xml:2145: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.StatusBar'.
W:

W: C:\Users\nicom\Desktop\Sonstiges\LineageOS\New\SystemUI\res\values\styles.xml:2155: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/TextAppearance.StatusBar'.
W:

W: C:\Users\nicom\Desktop\Sonstiges\LineageOS\New\SystemUI\res\values\styles.xml:2258: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.DeviceDefault.Settings.Dark'.
W:

W: C:\Users\nicom\Desktop\Sonstiges\LineageOS\New\SystemUI\res\values\styles.xml:2365: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/Theme.DeviceDefault.Settings.Dark'.

I tried to Recompile it without changing anything but i got the same Errors. I need help
[Android Software Development] Thebear j koss:
Need to install the framework res i believe. Those parent styles are not represented apparently in the framework you have installed.

The savage mutilation of the human race is set on course

protest&survive
[Android Software Development] Phone_Guru:
Gmail resources can be modified. I made a themed version of the latest 7.2 release.

---------- Post added at 06:32 PM ---------- Previous post was at 06:30 PM ----------

That gives different errors.
[Android Software Development] djdarkknight96:
I've seen others say Gmail can be themed again. But they are killing signature check in their Rom. Are you doing something special? We provide too many so making a gmail that only works on rooms with no signature is not how I wanna go. Unless you found something we didn't?
[Android Software Development] Phone_Guru:
I'm doing nothing special. I used to be able to flash a recompiled file to data, now I have to add my changes into a stock apk using 7zip line TBO does.
[Android Software Development] djdarkknight96:
Did you install twframework? I don't see 2.apk on that log
[Android Software Development] thereassaad:
Yes definitely Samsung Contact app need twframework-res.apk install ...
[Android Software Development] djdarkknight96:
Ok then, you'll be editing values, those errors are xml and images. Once you build it, drop resources.arsc in the apk using 7 zip abd you'll eliminate those errors because you'll only use values...nothing in those errors show values issues so you'll be fine.
[Android Software Development] tentak:
After recompiling apk not working... sintax error

I have recompiled and copy resources.arsc from build folder to original apk with 7zip.
[Android Software Development] djdarkknight96:
You get builds errors then the resources might not be complete. I forgot public.xml in values could be corrupt from missing resources. Was worth a try.
[Android Software Development] tentak:
How can i solve this error?
[Android Software Development] djdarkknight96:
Don't think you can unless those images are things are in another resource. Try installing systemui like framework.
[Android Software Development] tentak:
Nothing, i have installed systemui and another apks from system apks, but noone solve it. :confused:
[Android Software Development] djdarkknight96:
Must be the Samsung issue they been talking about here. Closed source so not easy to break all their resources. Thru might have special apk we don't.
[Android Software Development] tentak:
So i cant translate this apk:confused::(
[Android Software Development] djdarkknight96:
Doesn't look good
[Android Software Development] toole:
How can I use this apk tool to duplicate apps on my phone? .. I've got the latest APKTool x installed on my phone
[Android Software Development] Thebear j koss:
No idea what that is, this is a tool used on a computer to decompile and recompile apps, it does not work on phones or tablets nor does it duplicate apps on devices.

To all the amazing, smart, strong females that continue to change the world... Thank you.
[Android Software Development] zelendel:
It is a watered down version of apktool that was abandoned long ago but a user started working in it again. It should have stayed dead as devices just don't have the needed power and hardware to pull of what apktool can do.
[Android Software Development] Thebear j koss:
Thank you. Great explanation. Sort of figured it was something like that.

To all the amazing, smart, strong females that continue to change the world... Thank you.
[Android Software Development] 1droidmod:
Actually, it works great on my device. My device has more RAM and is more powerful than my laptop, LOL.
[Android Software Development] zelendel:
The amount of ram really doesnt mean alot. It is the type of ram as well as other things. Mobile chips are not meant to handle the load that things like apktool can put it through.

Many of the themers on the site have tried it over time and it is always advised to use it on your pc. Mainly if you are active in the custom rom world. This is due to all the different frameworks that are needed.

Im glad it works for you. I am sure if all you are doing is changing some text lines it might be ok but that is about it.
[Android Software Development] Thebear j koss:
Yeah, i have been an active xda member, and avid apktool user for years that communicates with devs from many devices that theme, mod, or build and have never seen or heard anyone talk of any apktool for on device modding. I have asked about some apps that claim to have the same functions and abilities of apktool, and some devs i know have given them a shot, but nobody has had any praise for them. Personally i despise pouring thru xmls and smali files even on my computer, couldn't even imagine trying to find a color call in smali on even my tablet's screen... But i am not knocking anyone's work, if it works for someone and they are comfortable using it, by all means continue. I am also 100% sure the dev of the app owes a huge debt of gratitude to Connor here for all his work on apktool.

To all the amazing, smart, strong females that continue to change the world... Thank you.
[Android Software Development] zelendel:
Yeah I have not personally tried it in many years. It was looked at as a great thing until what you just mentioned happened. It would keep failing Or corrupting things.

I think DJ may have tried it back in the day but I don't recall. Mind you this is back during the great xml hunt of real early theming lol.
[Android Software Development] djdarkknight96:
Yeah it sucked bad Bach in the day, I use it on my phone just to search for stuff on the go. But building with it would take a ton of battery. Now on something like the PIXEL C it would work great I bet.
[Android Software Development] porkyhontas:
Yes, thumbing through endless lines of smali and xml files suck bad enough on a computer, I couldn't imagine doing it on a phone, tablet or phablet.

AnaKonda Theme & Apps

eREDicate Theme & Apps
[Android Software Development] Spannaa:
You have lots of warnings (which don't matter) and no errors.

Does the recompiled apk work when you push it to your device?