yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Thebear j koss:
So, with system apps you don't use the new apk. Only use the original and switch changes from new apk into original. You only test the apk can be decompiled and recompiled. Now you can make changes. Always keep as much of the original apk as possible, hence moving only changed files from new recompiled apk into the original.
[Android Software Development] haze_1986:
Hi yes, I did not change any code. I used apktool to decompile and recompile it back. The file size went from 18 mb to 11 mb and apk is no longer the same, resulting in a bootloop. I had to reflash the firmware so I am now more cautious in trying again.

I am not sure if there is any settings I missed that resulted in this. I have also tried apk multi tool and getting the same results.

Please refer to attached screenshot, I am not sure why there are so much differences, especially the res folder, bottom is newly compiled one, no changes to the code at all.
[Android Software Development] Tulsadiver:
FYI, Apktool doesn't work on Google March update (looks to be the beta official release).

Reported originally as beta problem, updated to include March update.

[BUG]Unable to install Android 12 L Beta 2 framework-res.apk · Issue #2740 · iBotPeaches/Apktool

Information Apktool Version (apktool -version) - 2.4.1 or 2.6.0, I guess it doesn't matter... Operating System (Mac, Linux, Windows) - Windows (using Power Shell) APK From? (Playstore, ROM, Other) ...

github.com
[Android Software Development] Typhus_:
Yeah, Google silently moved to API 32. Either silently or I've been distracted...dunno.

Fact is, Android 12 since March 2022 build is now 32 and not 31. It's Android 12.1 or 12 L stable or whatever the official name is.
[Android Software Development] Tulsadiver:
Figured you would be on top of it. 😄
[Android Software Development] Typhus_:
That bug report was opened by myself. ;)
[Android Software Development] Tulsadiver:
Ohh, lol!
[Android Software Development] Tulsadiver:
When he gets back to you, can you drop me a line so I can build a new version? It sometimes takes a while before the fix hits the official build.
[Android Software Development] Typhus_:
He did back in January. But I wasn't able to build a snapshot since the tests fails and building gets stuck.

I thought that all I had to do was to use the new android-framework.jar he committed HERE and build apktool...but it just fails.

If you know how to bypass that, let me know as well.

Cheers!
[Android Software Development] Tulsadiver:
Same thing here...
[Android Software Development] Thebear j koss:
I think this is going to be one of the wait until the pixel 6a and the new foldable crap Google will be releasing until anything can be done with apktool. I believe there was 81 fixes to the framework in the last 12L beta and the official 12.1 update...
[Android Software Development] Tulsadiver:
Well you won't see me updating any time soon, lol!
[Android Software Development] Tulsadiver:
Typhus, did you know uour bug report is labled as "waiting on issuer"? Maybe he doesn't know that his work around isn't working
[Android Software Development] Typhus_:
That's just an incorrect and outdated label.
[Android Software Development] iBotPeaches:
I believe my hand is being forced to drop aapt1 support. It seems many new features that applications use require aapt2 (policies, overlays, staged aliases and more) and the default being aapt1 is hurting. I'm debating today/tomorrow to remove aapt1 (as part of 2.6.2) and folks that need aapt1 can just use an older build of Apktool.

I did anticipate this being a slower journey, but API32 (Android 12L) came a bit quicker than I expected and since they can release Android 12L applications today without affecting non API32 - its making this worse and worse with every Google application update.

TLDR - Might remove aapt1 completely in 2.6.2.
[Android Software Development] starbucks2010:
Is there a backward compatibility of aapt2 with aapt1 or is a totally different story?

Thank you.
[Android Software Development] iBotPeaches:
Apktool commands are the same, Apktool does the needed changes behind the scene to support aapt2. If you are using aapt1 manually, yes aapt2 is completely different in nearly every parameter.
[Android Software Development] Tulsadiver:
Thanks for reporting this. With the work around in place, the new build appears to be working now on March update....

Thank you, @iBotPeaches

Edit: stamp-cert-sha256 is now copied to both unknown and original folders so you need to delete the one from the original folder before it will recompile.

Edit2: framework will install but framework-res.apk does not decompile resources.arsc.
[Android Software Development] gcrutchr:
Open new SystemUI.apk with 7zip/winrar. look in the res folder. are there any files with '-vx'?

note: '-vx' where x is a version number

if not, you need to copy all files from original res folder that end in '-vx' into your new SystemUI.apk/res folder.

Ex: orig:color-v7, new: color (Missing color-v7).

So, all res/xxx-vx files need to be copied to new SystemUI.apk

Also, sometimes you need to copy original classes.dex, classes2.dex, etc to new apk. When copying select compression method -> store (no compression).

And, make sure you copy AndroidManifest.xml & META-INf folder from original to new SystemUI.apk
[Android Software Development] OldNoobOne:
Deleted
[Android Software Development] Thebear j koss:
Definitely wrong place. This is for apktool which decodes apks for theming or modification purposes. But if your airplane mode doesn't turn off wifi and data then your airplane mode is broken. And all these questions about secret apps that seem to me like you just don't want to be found, just turn off location services in settings and get a VPN. xxxxxxx

Mod Edit: Some content removed.
[Android Software Development] Mordechay:
Can you help me with that?

https://xdaforums.com/t/error-on-compile-with-apktool.4458551/

no compile. error "duplicate symbol '@null'." in attrs.xml [BUG] · Issue #2836 · iBotPeaches/Apktool

Information Apktool Version (apktool -version) -2.6.1 Operating System (Mac, Linux, Windows) -Windows APK From? (Playstore, ROM, Other) -ROM android 12 Stacktrace/Logcat' all log I: Using Apktool 2...

github.com
[Android Software Development] Thebear j koss:
Need more info, device? ROM? Android version? Stock?
[Android Software Development] Mordechay:
I wrote: android 12

yes
[Android Software Development] Thebear j koss:
Where? Nowhere in your post does it give any info. Just can you help me with this and links to something. I'm not clicking to find out what it is. If you would like help post as much info as possible Saying you are stock Android 12 is not enough. What device? Do you have a Pixel? Outside of a Google device, I'm not sure apktool works on any other devices on Android 12. If you are using a different device, like a Samsung, did you install all necessary files to use apktool? Usually when you get a @null it means apktool didn't find the proper attribute I believe which may be located in a proprietary framework that would also need to be installed into apktool. Your log doesn't provide much info either. Post a full log and not just the error.
[Android Software Development] Mordechay:
...

Not Samsung, what files need to be installed besides framework-res.apk?

Is there a replacement for apktool that works on Android 12?

Can you try to compile yourself? (I uploaded the framework and the app)
[Android Software Development] Ticklefish:
Hi!

So it looks like your problem isn't that you can't compile mtksettings.apk...but that it wasn't decompiled fully in the first place.

I agree with my esteemed colleague's reply - this is most likely down to inadequate framework files.

In pure Android, you only need to install framework-res.apk before decompiling but other manufacturers like to add their own framework files as well. The most famous one is Samsung but a lot of others do it as well.

I don't have your phone so I've no idea what, if any, additional frameworks you have on it. But have a look in "system/framework/" for any apk file with 'res' in the filename.

If you have any, then install those as well then decompile your file and try compiling it.

This might fix the issue, it might not. But it will eliminate one of the possible causes.

The other thing to do is to try using apktool on its own, not a third party tool.

This isn't meant as a criticism of APK Easytool (despite my probable bias) but it's because we don't know how that tool works. It's not impossible there's something about it that is contributing to the issue.

If you use apktool on its own then we know that's another possible cause eliminated.

Lastly....I know it's a pain providing lots of detail about these problems and I know it can seem like that error log is enough. The trouble is that there are just so many phones and so many roms and so many variations of, well, everything that we do need a lot of information to help you.

It's not meant as an insult. We do want to help if we can, we just need a bit more detail to do so.

Please try my advice above and let us know what happens. Hopefully that'll either solve the issue or get us a big step closer to doing so.
[Android Software Development] Mordechay:
I knew that, but there are no more apk files.

I have used both and have the same errors.

If I upload the framework folder will it help?

thanks!
[Android Software Development] Ticklefish:
You're welcome to upload it, sure. But I can't actually do anything for a few days (limited computer access).

What might help is knowing what device you're using. And if you're using a stock rom or a third-party rom. Most of the time those two bits of information will be enough to work if there any other framework files you'll need.
[Android Software Development] Mordechay:
I uploaded.

In github in apktool write a bug tag Does this mean that it is indeed an error in the source code of apktool?
[Android Software Development] Ticklefish:
Your issue on github has indeed been marked as a bug by apktool's developer.

That means there's nothing we can do until a solution to that bug is found. Just keep an eye on the github page.
[Android Software Development] Thebear j koss:
Still have no idea what device and ROM is installed... If the error is just that 1 line (I don't think it is that 1 error) just change that attribute to something else. Wouldn't @null point to nothing anyway?
[Android Software Development] Ticklefish:
Looking at the error log it seems to be every single attribute that's set to @null...and there's hundreds of them so manually changing them to something else could be a little tedious.

You're right that we still don't have enough information to help with this one but it's in ibotpeaches' hands now so we've done what we can.
[Android Software Development] Mordechay:
What to write instead of @null?
[Android Software Development] Ticklefish:
We would have no idea. You would need to write whatever value is supposed to be there. The only people who know what that is are the people who developed the app.

There can be literally hundreds of attributes defined in that file - there's no way anyone else would have a clue what they are.

All you can do is wait for the bug to be fixed.
[Android Software Development] Thebear j koss:
Theoretically you could use a previous 1 that worked and see if they match up. Problem is with material you, so many attributes have changed so it might not work. But on old Samsung days, most of the missing attributes or duplicate attributes could be changed using the previous working apk for the same app as most of them never really changed much anyways. Also, we had to use an older apktool to decode some Samsung apps which someone here had found out. So you could try a different apktool to see if that works. Sometimes trying different things will give unexpected results.
[Android Software Development] joshAll:
Which pc hardware would help me speed up decompilation/building?
[Android Software Development] Thebear j koss:
Nothing really. The process takes a bit depending on apk size. Usually as long as apktool, smali/baksmali, and Java are kept updated it works fine. But I would presume that a faster processor would gain you some time but you won't gain much. How long does it take you to decompile apps? Some apps like framework and larger apps will take longer.
[Android Software Development] DiamondJohn:
investigate what is your current roadblock/limit to performance. Is your CPU running at full tilt, is your hard-drive bogging down? I am assuming your not using a network or USB drive. there are other limiting factors, but CPU & Hard drive are the first two I would investigate. Especially since its not GPU intensive like a 3D game. Computers normally try and run things as fast as they can, and are usually slowed down while waiting on other components. eg your CPU wont be fully utilised if its waiting on data from your hard drive.
[Android Software Development] joshAll:
I have a decent pc. It takes me around a minute to decompile an apk. But i use the too a lot during my work. Any increase in speed would help me to speed up my iteration time.
[Android Software Development] joshAll:
Currently when i run /d nothing in my pc is utilized on 100%. I have 2700x cpu and samsung ssd. So i looks like i just need to wait ☹️
[Android Software Development] DiamondJohn:
I too have an Intel Core i7 2700K (from 2013, it was even a prev gen back then) with a 2x SSD Disk RAID1 system drive, and CPU overclocked to about 4.3GHz. When I am do nothing, my CPU is at 1% ( I am a little confused if you mean "d/ Nothing" mean yr CPU is @ 100% doing nothing?). Also, this CPU has 8 cores. Are ALL your cores at 100%?

Its not often that my CPU gets driven hard, or that I am waiting on anything. If anything, the CPU waits for the drives (or me ;)); not all are SSD, but they re all RAID1.
[Android Software Development] Thanos Atha:
Can I remove online validation of a shuted-down game & make it work offline? Total Recall was shut down & can't verify its cache files
[Android Software Development] Thebear j koss:
Doubtful. Once apps are shuttered or abandoned, there usually isn't any way to connect to servers they use. So you are S.O.L.
[Android Software Development] DiamondJohn:
If the same was done to an app that happened to be live, that would be instructions for warez.
[Android Software Development] dexter-:
Decompiling and building an app with no changes creates a crash at run time. App is Chase UK, anyone know how to get it to build? I have even disabled src decompiling with argument -s and it crashes even when I also use -r to skip res decompiling. Some xml files appear out of nowhere

Spoiler content hidden.
[Android Software Development] Spannaa:
Not sure why you're trying to decompile/recompile a banking app but apktool obviously won't work with hardened apks.
[Android Software Development] dexter-:
want to make a patch so that it works with my rooted phone
[Android Software Development] Thebear j koss:
It won't work. Signature verification would fail immediately. You would need to make a magisk module patch that passes security features that hide root and modified systems. There are already magisk modules that should work on your device.
[Android Software Development] Aqq123:
It's not really practical:

You'd have to redo the patch with every update. The decompiled .smali files can change significantly between releases, so it's not automatic even if you keep prior diffs.

Older versions of banking apps can stop working in a matter of weeks, so you have to keep updating. Staying on an old version is a risky option, you can lose access anytime.

These apps typically also have some tamper protection that would also have to be defeated, which adds to the workload.

Instead, I suggest you just decompile it and check what it looks for, then spoof it. This way it'll be much more future-proof.

I ran into a similar issue recently. In my case, the app was looking for test-keys in build tags (among many other things but this is where the check failed). The patterns in the "obfuscated" code were all hard-coded in one place, so it's just a matter of taking a look and making sure you don't trigger them.

Also if you reinstall the app manually, be sure to make it look as if it still came from the Play Store (pm install -i com.android.vending or equivalent). Some apps are now querying the installation source too.

Anyway, just my two cents.
[Android Software Development] SXUsr:
Hi all.

As I'm still on Pie I've been using Substratum to theme my apps dark, whatsapp has been fine up until now. Get no layout or drawable folders and when I open attrs and styles.xml all I see now is...

<attr name="APKTOOL_DUPLICATE_attr_0x7f040004" format="reference" />
<attr name="APKTOOL_DUPLICATE_attr_0x7f040005" format="reference" />
<attr name="APKTOOL_DUPLICATE_attr_0x7f040006" format="reference" />
<attr name="APKTOOL_DUPLICATE_attr_0x7f040007" format="dimension">

<style name="APKTOOL_DUPLICATE_style_0x7f130001" parent="@style/APKTOOL_DUPLICATE_style_0x7f1303cb">
<item name="android:paddingLeft">@dimen/APKTOOL_DUPLICATE_dimen_0x7f0701e3</item>
<item name="android:paddingRight">@dimen/APKTOOL_DUPLICATE_dimen_0x7f0701e3</item>
<item name="android:minWidth">@dimen/APKTOOL_DUPLICATE_dimen_0x7f0701e2</item>
</style>

...I assume they've just used whatever protection methods now to stop tinkering?
[Android Software Development] dexter-:
thanks for the reply. before I can get into the actual source code to patch these checks, I first have to understand why decoding without res and classes (-s - r arguments) and then building them again produces a different res folder. why doesn't it just copy the res folder like it says it does?

edit: I have realized this to do with when files in the res folder have multiple different case spellings of the name (e.g. rQN.png and RQn.png). It seems like it takes one and ignores the rest
[Android Software Development] iBotPeaches:
A new version has been released!

v2.7.0 (Released November 24th, 2022)

Apktool 2.7.0

md5 ec5b561de3c55ddc2e2223c504b2726b

sha256 c11b5eb518d9ac2ab18e959cbe087499079072b04d567cdcae5ceb447f9a7e7d

Details of Release: https://connortumbleson.com/2022/11/24/apktool-v2-7-0-released/
[Android Software Development] SXUsr:
Got folders now but most files are labelled APKTOOL_DUMMYVAL_0x7f0d0000.xml and look like...

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:whatsapp="http://schemas.android.com/apk/res-auto">
<com.whatsapp.WaImageView android:background="@color/APKTOOL_DUMMYVAL_0x7f0602d8" android:padding="@dimen/APKTOOL_DUMMYVAL_0x7f0704dd" android:layout_width="fill_parent" android:layout_height="@dimen/APKTOOL_DUMMYVAL_0x7f0704dc" android:src="@drawable/first_time_experience_header" />
<com.whatsapp.WaTextView android:textSize="@dimen/APKTOOL_DUMMYVAL_0x7f0704df" android:textColor="@color/APKTOOL_DUMMYVAL_0x7f060465" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/APKTOOL_DUMMYVAL_0x7f0704e1" android:layout_marginTop="@dimen/APKTOOL_DUMMYVAL_0x7f0704de" android:layout_marginRight="@dimen/APKTOOL_DUMMYVAL_0x7f0704e1" android:text="@string/APKTOOL_DUMMYVAL_0x7f120c6c" android:lineSpacingExtra="@dimen/APKTOOL_DUMMYVAL_0x7f0704e0" android:layout_marginHorizontal="@dimen/APKTOOL_DUMMYVAL_0x7f0704e1" whatsapp:APKTOOL_DUMMYVAL_0x7f0401a3="sans-serif-medium" />
<com.whatsapp.WaTextView android:textSize="@dimen/APKTOOL_DUMMYVAL_0x7f0704a1" android:textColor="@color/APKTOOL_DUMMYVAL_0x7f0604c6" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginLeft="@dimen/APKTOOL_DUMMYVAL_0x7f0704e1" android:layout_marginTop="@dimen/APKTOOL_DUMMYVAL_0x7f0704db" android:layout_marginRight="@dimen/APKTOOL_DUMMYVAL_0x7f0704e1" android:text="@string/APKTOOL_DUMMYVAL_0x7f120c6b" android:lineSpacingExtra="@dimen/APKTOOL_DUMMYVAL_0x7f0704a2" android:layout_marginHorizontal="@dimen/APKTOOL_DUMMYVAL_0x7f0704e1" />
</LinearLayout>
[Android Software Development] iBotPeaches:
When an application strips the human readable name of the resource - think like symbols for a shared object - what should we do?

We take the resId knowing it would be unique and prefix it with APKTOOL_DUMMYVAL. What else do you suggest?
[Android Software Development] Thebear j koss:
Are you trying to theme updated Whatsapp? If so, stop. It can't be edited as they obsfucated files in new update. Known issue among the theming community .
[Android Software Development] DiamondJohn:
Iam not a user, and have some concept of your issue, that appears to simply be a unique place holder. I *think* the issue some users have is with the word "DUMMY". Maybe people would be less inclined to be suspicious if its was called/prefixed with something like (fisrt idea's in my head)

APKTOOL_UNIQUE_0x7f0d0000.xml

APKTOOL_UNIQUEID_0x7f0d0000.xml

APKTOOL_UNIQUE_OBJECT_0x7f0d0000.xml

APKTOOL_IDENTIFIER_0x7f0d0000.xml

APKTOOL_LINK_0x7f0d0000.xml

APKTOOL_INTERNAL_0x7f0d0000.xml
[Android Software Development] SXUsr:
That's the answer I was looking for, thanks.
[Android Software Development] Emre67511:
Decompiling and recompiling multiple apks (even without making any changes) gives me "app not installed as package appears to be invalid" on my phone. What can cause this problem ?
[Android Software Development] starbucks2010:
Android 13 restrictions probably
[Android Software Development] Emre67511:
Del
[Android Software Development] Spannaa:
Or apks with obfuscated assets.

An apktool log might help in finding what's causing your problem.
[Android Software Development] Emre67511:
Found the solution, I had to zipalign the apks and now they are installing. Everyone on google said that you have to sign them so I thought signing alone would be enough but it wasn't
[Android Software Development] clewis.it:
Hi. I have a very specific problem with rebuilding an app. I am modifying some ./res/layout/ files to expand the length of some text fields. Literally, the only thing I'm doing is changing android:maxLength="12" to android:maxLength="25". After I make this change, rebuild, sign and replace the apk on my phone, it acts as if the application was deleted. Logcat only tells me the application was removed.

I'm using the latest apktool (2.7.0). I have already made significant changes to other parts of the app to allow screen rotation, added extra values to a field using res/values/arrays.xml, and changed and added smali code. All of these changes resulted in a working app. It's only when I change this one attribute that the problem occurs.

Any ideas what can be causing this problem? I know it's not user error. I do the same thing each time. Build the app with apktool, sign it with platform keys, transfer it to my phone, remove old apk, set permissions 0644. This has worked every time, including on my previous builds. Reading some of the other issues, I have also replaced using the same file name, and zipaligned the apk. both of these had no effect on the apks with modified field lengths. Also, if I changed the field lengths back to original, it works again, so like I said, it's a very specific issue.
[Android Software Development] clewis.it:
ugh, nevermind. I did make a mistake after zipaligning and forgot to remove the old apk. the zipaligned apk works. forget I said anything.
[Android Software Development] Ronnie McNutt:
can i recompile/compile system apps like (secsettings.apk, systemui.apk) or jar files like services.jar with this tool?
[Android Software Development] Thebear j koss:
Yes.
[Android Software Development] jakefeiwin:
In the latest releases, does the size of your apk bloats when you decompile and compile it?

If so how much?

and are there any alternatives?
[Android Software Development] Thebear j koss:
You need to update your framework resources.
[Android Software Development] timkre:
Thanks for that suggestion. I pulled the framework-res.apk from the device and was able to decompile and build with no errors.