yashsingh1/xdaforums huggingface dataset:
[Android Software Development] timkre:
I made my changes and built the apk again successfully. Now when trying to install I get the error below about no certificates. Any ideas? Do I need to sign the APK? I am not familiar with signing APK's.

C:\Users\User\Downloads\platform-tools_r33.0.3-windows\platform-tools>adb install kcteleservice_4810.apk
Performing Streamed Install
adb: failed to install kcteleservice_4810.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed to collect certificates from /data/app/vmdl1884586152.tmp/base.apk: Attempt to get length of null array]
[Android Software Development] Thebear j koss:
What is the app? Is it a system app? Need to check how original signatures are set up. Test key signing may not work. If system app may need to install as system app. There are way too many variables to know what you need to do.
[Android Software Development] Aqq123:
Yes, any APK you install needs to be signed.

However for system apps you can use the -c (--copy-original) flag to apktool to keep the original signature. It no longer matches the contents but it doesn't matter as it's not checked. As long as there is a signature.

In fact if you change the signature on a system APK such as TeleService it might break functionality. Since certain system components are supposed to share the same signature. So unless you want to re-sign the whole system, -c is the way to go (as long as you're not modifying the manifest).
[Android Software Development] timkre:
Yes. This is a system app. I would like to retain the original signature.
[Android Software Development] timkre:
I am wanting to modify the manifest to force a downgrade to an older version of the app. So therefore the -c option won't retain those changes. Am I correct on that? Or is there a better way to change the version number of the app so the system will accept the downgrade?
[Android Software Development] okp2023:
There's an issue when decompiling some resources. That what get in Manifest after apktool using:

<activity android:name="com.mxtech.videoplayer.mxtransfer.ui.folder.FolderActivity" android:screenOrientation="portrait" android:theme="@2098003976"/>

And this is the result of using ApktoolM:

<activity

android:theme="@com.mxtech.videoplayer.ad.transfer_bundle:style/Light_7d0d0008"

android:name="com.mxtech.videoplayer.mxtransfer.ui.folder.FolderActivity"

android:screenOrientation="portrait" />
[Android Software Development] BearsAreCool2077:
Hi all, first time posting here (thanks for all the incredible content and effort you guys put into apktool).

Recently, NVIDIA pushed a new update to its AndroidTV APK (NVIDIA Games) that disables a feature named Gamestram, that allows the users to stream games from PC to the Android device (NVIDIA shield). Now, they want to force the users use their paid cloud-based product.

The older versions of that app still work fine but now NVIDIA is forcing the app to auto-update internally, so my goal was to make some small modification to prevent/ disable the auto-update check.

I decompiled the APK using JADX and found the specific class and service they use to check for a new version. Then I used apktool, tried to make some small modifications in some strings (easy to find in the smali folders) and repacked using apktool with the flag "--copy-original". In my first attempt to install it via ADB, I got the error:

com.nvidia.tegrazone3-5.53.32205352.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl1921416010.tmp/base.apk: Failed to collect certificates from /data/app/vmdl1921416010.tmp/base.apk: File res/drawable-mdpi-v4/profile_1080p30.png in manifest does not exist]

Then I noticed some of the res/ files were missing and copied them from the original app (using 7-zip), so I added them manually. Now, when I try to install, the error is:

com.nvidia.tegrazone3-5.53.32205352.apk: Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES: Failed collecting certificates for /data/app/vmdl2107400841.tmp/base.apk: Failed to collect certificates from /data/app/vmdl2107400841.tmp/base.apk: META-INF/TEGRAZON.SF indicates /data/app/vmdl2107400841.tmp/base.apk is signed using APK Signature Scheme v2, but no such signature was found. Signature stripped?]

I suspect Android is doing some checksum to verify that the internal files got modified?

The challenge around this project is that this NVIDIA app is a system app, so I am trying to find a way to make a small internal change without affecting the signature (don't know if this is possible).

Can anyone help with some advice on what I should attempt? Should I root my device? Should I try to write a Magisk module (I saw another post mentioning this).

For reference, this is the APK I am trying to modify: https://www.apktoy.com/nvidia-games/com.nvidia.tegrazone3

Thanks in advance for any help!
[Android Software Development] TheMystic:
Un-possible.
[Android Software Development] BearsAreCool2077:
Any suggestion on what else I could try? Maybe renaming the app, rooting the device and trying to install it as it was a new app?
[Android Software Development] TheMystic:
Signature check is present to prevent tampering. It may be possible to install it if you sign it with a new signature. I have never done it, so you'll have to look for ways to sign an apk yourself.
[Android Software Development] BearsAreCool2077:
Yesterday I was able to repack, zipalign, and sign by myself. When I kept the same package name, Android complained that there was an existing app with same package name but with different signature, so it wouldn't allow me to install it.

Then I renamed the app (package name, internal folders and references) but it would complain about existing providers and permissions in the AndroidManifest.xml already being used by the original app.

That's why I was trying to find a way to modify/ replace/ patch the original app directly. I saw some old posts mentioning about copying the META-INF and the AndroidManifest.xml but this does not work anymore.

Anyways, thanks for your reply.
[Android Software Development] TheMystic:
I don't think you'd be able to install it while the original app is installed. And because it is also a system app, you'll have to root the device to uninstall it and then try installing the modified app.

I have never done this, so unable to give you specific steps. But I'm sure it is doable.
[Android Software Development] Rootk1t:
I think it's a good idea to look towards magisk modules.

As magisk uses overlay-based mechanism, after rooting your device & installing magisk, you can overlay your modified app over stock one via magisk module (e.g. android will "think", that overlayed one is a genuine one).

In this case you don't have to bother with stock app and it's signatures (furthermore as system partitions nowadays are mainly read-only, you can't uninstall stock system app, without making partition -rw).
[Android Software Development] ale5000:
Just uninstall the original app (if you uninstall only for the user you don't need root), then reinstall the modded version with a different package name.
[Android Software Development] Rootk1t:
Though if system partition is -ro, he won't manage to install modded app as system app.
[Android Software Development] ale5000:
I haven't read all the messages before but it is strictly needed to be a system app?

Many permission can be granted via adb also on user apps but it depends on what it is strictly needed by the app.
[Android Software Development] iBotPeaches:
A new version has been released!

v2.8.0 (Released July 17th, 2023)

Apktool 2.8.0

md5 aefd27becd2b97527c47e595bd22d8d2

sha256 b331323ebf325d63e13375a6147915f9dac048f0f1f86783806f925941748dbc

Details of Release: https://connortumbleson.com/2023/07/17/apktool-v2-8-0-released/

Doc site: https://apktool.org/blog/apktool-2.8.0
[Android Software Development] iBotPeaches:
A new hotfix version has been released!

Yep apologies - this last release was a bit buggy.

v2.8.1 (Released July 22th, 2023)

Apktool 2.8.1

md5 c186ee0c87dbf197456cc010aeba99da

sha256 7b4a8e1703e228d206db29644b71141687d8a111b55b039b08b02dfa443ab0f9

Details of Release: https://connortumbleson.com/2023/07/22/apktool-v2-8-1-released/

Doc site: https://apktool.org/blog/apktool-2.8.1
[Android Software Development] starbucks2010:
Hello,

I rebuilt the apktool from github using latest java jdk-20 on windows 11 (gradlew.bat build shadowJar) but when I try to decompile an apk I get the below error.

Anyone have an idea what's wrong or how can I solve this issue?

Thank you.
[Android Software Development] iBotPeaches:
It looks like it was built on a newer JDK without enforcing a lower JDK version. I'm not sure how that is possible because I see the compatibility here.

All master builds spit out an artifact when done. Take the latest commit a few days ago - can you try the build attached to it? https://github.com/iBotPeaches/Apktool/actions/runs/6152670274
[Android Software Development] starbucks2010:
Thank you for taking your time to support me.

I tested the apktool-v2.8.1-63-515af4fa-SNAPSHOT.jar and I get the bellow error.

I tested the official apktool jar v2.8.1 and all is ok.
[Android Software Development] iBotPeaches:
Okay thanks for catching a regression then. I guess on the movement to Kotlin DSL for Gradle - it must be ignoring my specified compatibility type.

I'll have to brainstorm on this, since not sure of my mistake yet. Will accept a PR since I'm guessing my mistake is in here somewhere - https://github.com/iBotPeaches/Apktool/blob/master/build.gradle.kts
[Android Software Development] iBotPeaches:
Okay, I believe I fixed it. I needed to enforce the tool chain preferred version through all subprojects - not just the CLI - https://github.com/iBotPeaches/Apktool/commit/f3936cbd22f931659f7bd47e5a5aaf23ea354006
[Android Software Development] starbucks2010:
Hey,

Just to let you know that all seems to be ok with the latest apktool recompiled from the latest source.

Thank you very much for your fast fix. Much appreciated your work. I hope you'll remain motivated to continue the work on apktool cause is a magnificent piece of work.

I would have one more question if you don't mind: what's the difference between the apktool compiled with/without proguard?

Thanks again.

[*] Installing framework framework-res.apk

I: Framework installed to: bin\framework\1.apk

[*] Decompiling test.apk

I: Using Apktool v2.8.1-64-f3936cbd-SNAPSHOT on test.apk

I: Loading resource table...

I: Decoding file-resources...

I: Loading resource table from file: bin\framework\1.apk

I: Decoding values */* XMLs...

I: Decoding AndroidManifest.xml with resources...

I: Regular manifest package...

I: Baksmaling classes.dex...

I: Copying assets and libs...

I: Copying unknown files...

I: Copying original files...

DONE

Elapsed time: 11 sec.
[Android Software Development] iBotPeaches:
Funded by two companies at the moment, as well as launching GitHub Sponsors so yes the past few months have had more activity than past 6 years combined. So it basically means in my head - "people are paying me to keep the bug tracker triaged and work on tickets when I have free time"

I don't want to sound like I refuse to budge without funding, but it has become increasingly difficult to work on open source stuff and a few sponsorships pushed me to have some freedom for that. I blogged about this in detail here if curious.

Apktool uses Proguard solely for removing unused code. It does not leverage any of the minification or obfuscation features that Proguard offers. Its simply used to help clean dependencies of functions we don't leverage so the binary size is much much smaller.
[Android Software Development] iBotPeaches:
A new version has been released!

aapt2 is now default!

v2.9.0 (Released October 8th, 2023)

Apktool 2.9.0

md5 246e7208cfb92c73d21e4e6a8909dda1

sha256 e5ecf759297b845be64a3a5145ccc372db905b15a801a22ea1c91ee03c4c7a65

Details of Release: https://connortumbleson.com/2023/10/08/apktool-v2-9-0-released/

Doc site: https://apktool.org/blog/apktool-2.9.0
[Android Software Development] patrickneil:
Hi friends, I'm not sure where to ask this question, so if there's a better forum, I'm happy to inquire there. I'm trying to work with the keyboard app Microsoft Swiftkey. The JSON layout files I want to futz with live in res/raw, but unpacking with apktool doesn't actually make them readable, they're still the same gibberish as if I just open the APK as a ZIP. Is there a trick to get the /raw folder to decompile? Sorry if this is an amateurish query, and thanks for the awesome tool!
[Android Software Development] iBotPeaches:
We can't really automate anything with res/raw and there is no standard on how the files in there should be unpacked. So no to answer your question, possibly in future if we parse each file to look for compression, encryption, axml, arsc, etc.
[Android Software Development] starbucks2010:
Since few releases of apktool I see some doubled lines (usually the same lines) in the decoded styles.xml. Would it be possible to look into this problem and see if it can be fixed? I can provide logs and apk where I encounter this problem if necessary. I have this issue to samsung apps.

Thanks in advance.
[Android Software Development] iBotPeaches:
I'd say report a bug with as much detail as you can. I realize our test suite doesn't really have any tests to confirm no duplication, so it that could be a hole for regressions could occur.
[Android Software Development] Tulsadiver:
Has anyone been able to decompile and recompile Pixel phones SystemUIGoogle.apk for Android 14? I get several attributes that aren't recognized when building resources.... I've tried the newest apktool published and I also built a snapshot today and tried that.

I've seen that in Pixel phones for quite some time. Always in styles.xml.
[Android Software Development] DiamondJohn:
Along the lines of @iBotPeaches response, I have found 7Zip can sometimes unpack a RAW file, as the people who built the file, often use a known compression algorithm that 7Zip will attempt to interpret via the header. Which gives me another idea. check the header for any clues as to what the file may contain or what format its in. Long shot, but you may be lucky.
[Android Software Development] patrickneil:
Yep, I had thought of 7Zip, but it didn't help open the files either. But thanks for suggesting looking up the header information. Each of the .json layout files starts with the characters "xœ" which Wikipedia tells me should be zlib default compression format, something used by coders in Python it seems. So I now have a command line program that lets me at least look inside to see that yes, the info is there, so thanks for the reply!
[Android Software Development] DiamondJohn:
Well done 👏 You probably got further than I would of, even though it was me who gave you the simple, and now forehead-slapper thought.

I am a little shocked that the file had such an easy to identify header, and 7Zip didn't work it out. I would of tried the easy route and expanded the file and added the correct extension to see if 7Zip could handle it when hinted in the right direction. Basically to avoid finding another app to do what 7Zip should or even possibly can do already. I have been very lucky with 7Zip's ability to expand "random" files with no extension within a compressed file. Did this file by any chance have a misleading/incorrect/random extension?

If you could be bothered, this case sounds like something to flag to the 7Zip devs. And therefore when I use it, I dont need to find the solution ;)
[Android Software Development] iBotPeaches:
A new version has been released!

v2.9.1 (Released December 6th, 2023)

Apktool 2.9.1

md5 40705d4cf2fd3b4f605872e993f0d4a3

sha256 de7ce8aa109acb649e7f69cfe91030ffc20dbcc46edd8abbf6c2d1e36cfccd7b

Details of Release: https://connortumbleson.com/2023/12/06/apktool-v2-9-1-released/

Doc site: https://apktool.org/blog/apktool-2.9.1
[Android Software Development] iBotPeaches:
A new security hotfix version has been released!

v2.9.2 (Released January 5th, 2024)

Apktool 2.9.2

md5 352f85721fa95847f03a10fa7ea78322

sha256 831f0ffc97b6f20f511d6183cbf6785464d341aacb0fb7e6f22ef0c7b228911a

Details of Release: https://connortumbleson.com/2024/01/05/apktool-v2-9-2-released/

Doc site: https://apktool.org/blog/apktool-2.9.2
[Android Software Development] iBotPeaches:
A new security hotfix version has been released!

v2.9.3 (Released January 20th, 2024)

Apktool 2.9.3

md5 e28e4b4a413a252617d92b657a33c947

sha256 7956eb04194300ce0d0a84ad18771eebc94b89fb8d1ddcce8ea4c056818646f4

Details of Release: https://connortumbleson.com/2024/01/20/apktool-v2-9-3-released/

Doc site: https://apktool.org/blog/apktool-2.9.3
[Android Software Development] starbucks2010:
Hi,

Is there any switch I can use to force the rebuilding to not compress the .dex/arsc files?

Thank you.
[Android Software Development] Thebear j koss:
Just curious as to why you don't want them compressed? And the tool that compresses them can the compression just be changed somehow in for instance the baksmali tool? Also can't resources just be opened with like 7zip after building? Files won't be readable but you can extract or copy files out of it
[Android Software Development] Thebear j koss:
Using MiXplorer on compiled apk, pulled resources and opened with MiXplorer archive add on.
[Android Software Development] starbucks2010:
Actually, I'm using an automated tool that decompile an apk/jar, do the file modifications I indicate into a script file and compresses back the apk/jar. So, I would like to put a switch into the recompilation command line so the .dex or .arsc files don't get compressed (to stay the same as in stock apk/jar).

The reason behind this is to avoid the lag created by the decompression of resources from that apk/jar when is used.

Thanks.
[Android Software Development] Thebear j koss:
Yeah, sorry. That's beyond my skill level. I would think there must be a way to change compression levels within apktool itself, I just wouldn't know how to go about doing it. Resources and images and other stuff is compressed and zipped by aapt, so would need to edit the compression of the aapt somehow. From what little I do know, java seems to be the limiting factor of being able to change things like what you want to do, but again that's way out of my realm. Someone more knowledgeable may be able to help you out.
[Android Software Development] starbucks2010:
@iBotPeaches does it exists such switch in apktool? thanks
[Android Software Development] Tulsadiver:
I'm wondering if I'm doing something wrong when building apktool. Previously, the new build would show a version number of the current version plus some additional decimals. The builds I did the last two times came after the current 2.9.3 stable but they read as 2.9.2. when used.
[Android Software Development] Zhelkek:
The application I need, although compiled for API 23, uses Ljava/time/format/DateTimeFormatter, available in API 26. I found a ThreeTenABP backport, but I don’t know how to add this library when I recompiling APK via apktool. Is it possible?
[Android Software Development] starbucks2010:
is there a way to get the file name instead of .source "qb/82535270...." in the decompiled files?

thank you
[Android Software Development] Renate:
That probably is the file name. Unless you have the actual source to the apk, what difference does it make?

And if you have the source to the apk you can figure it out anyway.

Many apk are ProGuard'ed and just say nonsense there anyway.
[Android Software Development] Thebear j koss:
Is this in newer apps? Is an obfuscated file, or is it missing in newer android 15 sdk? Have you updated aapt 2, frameworks, and other resources? I'm just checking as you are usually ahead of new changes and all, you're a veteran here on XDA.
[Android Software Development] starbucks2010:
Thanks for your inputs guys.

Actually is like this since some time.

I'm trying to decompile the SystemUI android 14 and yes, I use aapt2, latest apktool 2.9.3 and smali 3.0.5.

In the below picture I should have .source "SecQuickStatusBarHeade.smali" instead of that long string of qb/825....

If is worth mentioning, I use latest BatchApktool 3.8.0 and I have this problem only for SystemUI. For other decompiled apps I get the filename instead of that random string.
[Android Software Development] Pneuma1985:
Yeah we need an error message to see why your framework-res.apk isnt compiling..
[Android Software Development] iBotPeaches:
Your aapt was out of date, by a lot.

As for the -d mode. I think I'm removing it. I don't know what it does, and it doesn't seem to work, and I don't see the benefit of it.

The only thing that looked cool was the -j mode from Brut.all YouTube video, but that never made it into actual production.
[Android Software Development] DualJoe:
Oh, was it -j mode that allowed realtime debugging with Eclipse? If so, forget about my post. I thought it would be -d. :p

Eclipse realtime debugging would be so cool. :o
[Android Software Development] ionutz1708:
thank you guys for being so kind and trying to help me...i managed to do it after all..thank you again
[Android Software Development] v1r0x:
Do you have aapt in your %PATH variable?
[Android Software Development] varun.chitre15:
Yes I have

I can decompile and recompile rest all apks I have without any error.
[Android Software Development] iBotPeaches:
Send me the apks please. I'll take a look for the arrays problem.

Sent from my SGS3 AT&T Variant
[Android Software Development] raziel23x:
I have found that some APK files will decompile and recompile fine on windows but not on Linux and the same goes for Linux.
[Android Software Development] varun.chitre15:
@iBotPeaches

Here is the apk

http://d-h.st/Pgt

Thanks!
[Android Software Development] a1exander:
Could someone please help me? :)

Im trying to decompile framework.jar from Nexus S MIUI rom, but Im just getting this error. What am i doing wrong?

C:\apktool>apktool if framework-res.apk
I: Framework installed to: C:\Users\Alex\apktool\framework\1.apk

C:\apktool>apktool if framework-miui-res.apk
I: Framework installed to: C:\Users\Alex\apktool\framework\6.apk

C:\apktool>apktool d framework.jar
I: Baksmaling...
I: Copying assets and libs...

C:\apktool>apktool b framework.jar
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:162)
at brut.androlib.Androlib.build(Androlib.java:179)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:158)
... 4 more

Thanks in advance!
[Android Software Development] iBotPeaches:
Your trying to build a JAR file. The default output folder is $name.jar.out for JARs, so you could do

apktool b framework.jar.out
[Android Software Development] a1exander:
Cant believe I didnt think of that. Thanks, it worked! :)

Is the output framework.jar the one at "framework.jar.out/dist" directory?

And also do I have to sign it or can I just put it back in the rom after iv'e replaced a smali file and compiled?