yashsingh1/xdaforums huggingface dataset:
[Android Software Development] Thebear j koss:
I got banned for a month. The mods at XDA hate me. Lol

Sent from my Moto G5S Plus using Thebear Blue XDA Labs

---------- Post added at 11:15 PM ---------- Previous post was at 11:10 PM ----------

Yes it is safe. Always have a backup of the original apk just in case. That is a trick [MENTION=2126467]djdarkknight96[/MENTION] taught me, so i am not a genius or anything. Themers are lazy and just try any shortcut we can. Lol

Sent from my Moto G5S Plus using Thebear Blue XDA Labs

---------- Post added at 11:18 PM ---------- Previous post was at 11:15 PM ----------

Yup. There are a few apps that can't be decoded. Some apps like Netflix will only partially decode

Sent from my Moto G5S Plus using Thebear Blue XDA Labs
[Android Software Development] danielvilla1:
And why?
[Android Software Development] Thebear j koss:
https://github.com/iBotPeaches/Apktool/issues/1750

Sent from my Moto G5S Plus using Thebear Blue XDA Labs
[Android Software Development] Eleo:
So the fix proposed by ibotpeaches is moving to a unix or mac environment, right? Android is linux based. So, by this logic, apktool X apk should be able to decompile it. Let me try...

Edit: Nope it gives error on android too. See attachment.
[Android Software Development] iBotPeaches:
It's not much of a fix, but a work-around due to the command limitation on Windows. As that ticket shows, I really tried to fix the issue. I fixed it, then broke Apktool entirely for all platforms. I reverted that, to have Windows to continued to be broken in certain use cases to allow it to work completely on other operating systems. Apktool on Android is still not officially supported, and I don't think the logic you made is exactly fair, but to each his own.
[Android Software Development] techker:
hey guys is there an official fix for the exception in main thread java error??

and is there a place where to get a framework file?cause for me it is android boxes apk not phone...

thx!
[Android Software Development] djdarkknight96:
Would need to see full log to know anything, you could adb pull framework or use a file manager like MiXplorer which can see system files without root just not data files. I use MiXplorer on my android tv box. It's an xda app not on playstore. Xda labs also has it. Can copy paste fw from system/framework/
[Android Software Development] Spannaa:
Try searching this thread for png malformed ;)
[Android Software Development] laura almeida:
Can't decompile the latest Hangouts from apkmirror

I: Using Apktool 2.3.3 on Hangout v25.0.197085453.apk
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:53)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:741)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:67)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:59)
at brut.androlib.Androlib.getResTable(Androlib.java:68)
at brut.androlib.ApkDecoder.setTargetSdkVersion(ApkDecoder.java:228)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:118)
at brut.apktool.Main.cmdDecode(Main.java:164)
at brut.apktool.Main.main(Main.java:73)
Caused by: java.io.IOException: Expected: 0x00000008, got: 0x00000202
at brut.util.ExtDataInput.skipCheckShort(ExtDataInput.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:354)

at brut.androlib.res.decoder.ARSCDecoder.readEntryData(ARSCDecoder.java:276)
at brut.androlib.res.decoder.ARSCDecoder.readTableType(ARSCDecoder.java:252)
at brut.androlib.res.decoder.ARSCDecoder.readTableTypeSpec(ARSCDecoder.java:175)
at brut.androlib.res.decoder.ARSCDecoder.readTablePackage(ARSCDecoder.java:131)
at brut.androlib.res.decoder.ARSCDecoder.readTableHeader(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
... 8 more
[Android Software Development] Ibuprophen:
This specific error is known by [MENTION=3924617]iBotPeaches[/MENTION] and there's a handful of issues open with that same error with the following one being the most recent.

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

Keep in mind that this same issue is present on a few other apps as well and iBotPeaches is aware of it.

Some issues can take quite some time to figure out and you will just have to be very patient.

Good Luck!

~~~~~~~~~~~~~~~

I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
[Android Software Development] techker:
il check to see

even on my mac same issue

Exception in thread "main" java.lang.NullPointerException

at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:58)

at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:516)

at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:267)

at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:132)

at brut.androlib.ApkDecoder.decode(ApkDecoder.java:108)

at brut.apktool.Main.cmdDecode(Main.java:166)

at brut.apktool.Main.main(Main.java:81)
[Android Software Development] porkyhontas:
The last time this happened it took a couple months for a fix. I'm as frustrated as you but rest assured [MENTION=3924617]iBotPeaches[/MENTION] will get to it. [emoji6]
[Android Software Development] MedElAmine:
Hello,

I am trying to use apktool in a malware detection app in Android, hence I need an api to use that tool.

After 5 years, is there an api for apktool ?

Regards,
[Android Software Development] laura almeida:
There is a workaround though, for now.

If you use this framework:

https://basketbuild.com/filedl/devs?dev=aniruddhc&dl=aniruddhc/framework-res.apk (unknown source but working)

and apktool version 2.2.4 from here: https://bitbucket.org/iBotPeaches/apktool/downloads/

then you can decompile hangouts.
[Android Software Development] porkyhontas:
No, not yet. I was just saying it took a few months last time it couldn't be decompiled.

Sent from my AnaKonda themed SM-N920P using AnaKonda XDA Developers App
[Android Software Development] porkyhontas:
Thanks for the hook up!!! I was able to use apktool 2.2.4 and Oreo framework on Hangouts 25..

Sent from my AnaKonda themed SM-N920P using AnaKonda XDA Developers App
[Android Software Development] levone1:
Any help with this... I'm messing with latest stock fw for Xperia X compact, (Android 8.0), and latest apktool, on Windows 10. Import of framework-res and SystemUI, and decompile of framework-res, SystemUI, and Settings, and recompile of Settings after modification, all working fine without error. Recompile attempt of framework-res throws this extremely long error, even without any modification:

I: Using Apktool 2.3.3
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
brut.androlib.AndrolibException: brut.common.BrutException: could not exec: [C:\Users\ABIGA_~1\AppData\Local\Temp\brut_util_Jar_294653455656183533.tmp, p, --forced-package-id, 1, --min-sdk-version, 26, --target-sdk-version, 26, --version-code, 26, --version-name, 8.0.0, --no-version-vectors, -F, C:\Users\ABIGA_~1\AppData\Local\Temp\APKTOOL2558091336128908562.tmp, -x, -0, arsc, -0, png, -0, res/drawable...
([B][I][COLOR="Red"]at this point, there was a list of what looked like every file in /res/drawable, and /res/drawable/hdpi, and /res/drawable/xhdpi, etc., and then[/COLOR][/I][/B])... ,
-0, ogg, -0, arsc, -S, C:\Windows\framework-res\res, -M, C:\Windows\framework-res\AndroidManifest.xml]

I know it may be an Xperia-specific issue that I can't do anything about, but I figured there might be something I'm missing, or maybe a workaround, or...?

Thanks
[Android Software Development] Thebear j koss:
Post the full log.
[Android Software Development] Ticklefish:
Are you recompiling with aapt2 support?
[Android Software Development] Thebear j koss:
Next time upload the log to pastebin or gdrive or something and share the link. I see you have the no version vectors issue. Look here- https://stackoverflow.com/questions/50258248/apktool-2-3-3-dirty-error-during-apk-recompilation
[Android Software Development] levone1:
OK, thanks. Seems like what I can take away from that link is that I should use a different Java version? I already have apktool 233 from official download...
[Android Software Development] Eleo:
I have met the similar error on apktool 2.3.3. Then I reverted back to apktool 2.3.1 and there were no such issues. Please try and report back.
[Android Software Development] levone1:
I have experienced the 'first type is not attr' error before, (https://xdaforums.com/showthread.php?p=75565353), but that's not what happened here. Switching to 2.3.1 brought success...

That did it. Recompile without error, even after modification
[Android Software Development] Thebear j koss:
Never said anything about that. But at least you got it working. Always keep a folder of apk tools. I have seen some apps go back to 1.5.2
[Android Software Development] levone1:
The user in the link you posted started his post out with a log showing 'first type not attr' error, then said he realized that he needed to change jdk version to fix it...
[Android Software Development] levone1:
Any help or ideas appreciated -

I have Xperia X Compact f5321 with O 8.0, latest stock Sony fw.

What I have done:

deodex framework and push to system - OK; deodex some system apps, like SystemUI, and push to system - OK; use Apktool to modify a few lines in /res/values/colors.xml, and in .../styles.xml, in framework-res.apk and Systemui.apk - import, decode, and rebuild all OK without error; signed new apks by either copying original manifest and signature from working deodexed apk to modded apk, or by copying resources.arsc from modded to original, (tried both ways with both apks).

What happens:

When replacing SystemUI apk, either in TWRP file manager or by flashable, phone has no SystemUI after reboot. Then, when I replace the modded SystemUI with my backed up original, phone reboots to black screen, and I can only fix by restoring /data from TWRP backup.

When replacing framework-res apk, either in TWRP file manager or by flashable, phone gets frozen on boot animation and loops.

I have never had to troubleshoot this kind of thing, because until O, I never had a problem with replacing apks, once I was able to get them to recompile. Not sure how to figure out what's happening.

Thanks
[Android Software Development] Eleo:
Before everything, you should know that these can be diagnosed only by logs. There are many logging procedures in XDA to follow. I will answer with my previous exleriences.

The reason why you are getting no systemUI is probanly because you have faulty signature in edited systemUI. Repair it. I open modded and original apks like a zipped folder and check contents. If signature is faulty, you might see that META-INF folder is absent (easiy fixable by copying and pasting META INF from original to edited UI). And when this happens, you need to wipe data of systemUI, because even if you replace it with original UI, the data of faulty UI will not allownit run. After replacing with original systemUI, navigate to systemUI data (in my note3 it is in data/data/com.android.systemui folder) and wipe that folder. After this, rebooting will give you your original systemUI back.

Same could be with framework-res. Signature.
[Android Software Development] levone1:
Thanks. I'm definitely no expert, but I have been using apktool and modding SystemUI since LP, so I do know the basics about signing. I have tried replacing META-INF folder from original working apk, and also tried using original apk, with it's original META-INF folder untouched, and replacing resources.arsc file, (suggested by someone else in this thread). Same results. I'll start looking into logging...
[Android Software Development] levone1:
Interesting thing - don't know if it means anything... If I replace the SystemUI apk with the modified one, while the phone is booted, then restart SystemUI, via app, the SystemUI restarts and runs fine with the modifications. But, if I reboot, then it boots with no SystemUI...
[Android Software Development] Ibuprophen:
Just throwing a thought...

Is your system mounted as R/W?

After replacing the SystemUI app, did you set the permissions for the app as "rw-r-r-"?

~~~~~~~~~~~~~~~

I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
[Android Software Development] levone1:
Yes, set permissions 644. I guess I didn't actually check if system was mounted r/w, but I don't think I could be doing all of the cut/copy/paste I've been doing if not. There's never any errors or issues with writing to or from system. One thought I had - my kernel is modded with rootkernel to disable dm-verity, etc, but do you think there might be some other Sony security thing that rootkernel is missing?
[Android Software Development] Hal9k_:
Hi all.

I found a strange situation with the latest apktool and framework-res.apk (and others apks) from Android 8.0.0 Oreo.

If I open apk as ZIP, i can find some files in zip:framework-res.apk:\res\anim-watch-v8, zip:framework-res.apk:\res\drawable-hdpi-v4, zip:framework-res.apk:\res\layout-sw600dp-v13 and other -vXX folders.

But if I unpack apk with apktool d framework-res.apk, I can only find res\anim-watch, res\drawable-hdpi, res\layout-sw600dp and other folders without -vXX suffix.

Because of this I can't use --copy-original option for save original signature.

This problem does not exist while working with framework-res.apk from the same devices with Nougat and Marshmallow. Only with Oreo.

Has anyone encountered this?
[Android Software Development] djdarkknight96:
Yep been covered in the thread, search back a few pages.
[Android Software Development] Ibuprophen:
This specific issue is known to iBotPeaches on a handful of submitted issues within Github.

I do know that [MENTION=3924617]iBotPeaches[/MENTION] is aware of this and has been working on it for quite some time now.

It looks like its tied to the AAPT that's causing a Namespace issue for a handful of newer apps as well as Oreo specific ones.

I also remember seeing this being referenced on reddit and another site that has a few individuals who seemed to find a type of workaround for this but, I can't give you any specifics because I can't remember where exactly those were posted.

Good Luck! :)

~~~~~~~~~~~~~~~

I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
[Android Software Development] Hal9k_:
[MENTION=4828250]Ibuprophen[/MENTION], I found a discussion of this problem in April in this thread. :(

Well, wish good luck to [MENTION=3924617]iBotPeaches[/MENTION] in solving this problem.

Apk works correctly if I manually rename the folders as it should be.
[Android Software Development] rizki_Alkaf:
Editing overlay file (vendor/overlay/framework-res__auto_generated_rro.apk) on Android Pie using the latest version of APKTool causes a bootloop (stuck on loading animation).

Any help for this?
[Android Software Development] edzamber:
[MENTION=3924617]iBotPeaches[/MENTION]

Smali/baksmali updated to 2.2.5 :)

https://bitbucket.org/JesusFreke/smali/downloads/
[Android Software Development] shashank.degloorkar:
Timeline for version 2.3.4

Hi , Is there any timeline for the release of version Apktool 2.3.4?

Or version 2.3.3 is stable enough for Android P Unpackaging/Repackaging tasks.
[Android Software Development] Thebear j koss:
Never a time line. When and if an update is done, only then will it be posted. You can always try 2.3.3 on Pie and report with your findings. Only way to find out is to try...

Sent from my Essential Phone using Thebear Blue XDA Labs
[Android Software Development] sms2000:
Did anybody encounter a problem with XML text files as icons?

'apktool d' reports:

S: Could not decode file, replacing by FALSE value: mipmap-anydpi-v26/icon.xml

and the resulting XML icon is zero length. When rebuild it lost and not included.
[Android Software Development] Asellus:
"Invalid data detected"

While using "apktool_2.3.3 d" to tweak SystemUI.apk of a Samsung Note 4 with MM stock ROM I got thousands of "Invalid data detected":

D:\Note 4\DevBase 5.9>java -jar ..\apktool_2.3.3.jar if -p framework framework-res.apk
W: Invalid data detected. Skipping: 4 byte(s)
[>900 times]
W: Invalid data detected. Skipping: 4 byte(s)
I: Framework installed to: framework\1.apk

D:\Note 4\DevBase 5.9>java -jar ..\apktool_2.3.3.jar d -p framework SystemUI.apk
I: Using Apktool 2.3.3 on SystemUI.apk
I: Loading resource table...
W: Invalid data detected. Skipping: 4 byte(s)
[>400 times]
W: Invalid data detected. Skipping: 4 byte(s)
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: framework\1.apk
W: Invalid data detected. Skipping: 4 byte(s)
[~1000 times]
W: Invalid data detected. Skipping: 4 byte(s)
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...

D:\Note 4\DevBase 5.9>java -jar ..\apktool_2.3.3.jar b -c -p framework SystemUI
I: Using Apktool 2.3.3
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 'data_usage_disable_mobile_vzw_1' has no default translation.
W: warning: string 'data_usage_disable_mobile_vzw_3' has no default translation.
W: warning: string 'mobile_hotspot_dialog_nosim_warning_title_jpn' has no default translation.
W: warning: string 'switched_to_onephone_mode' has no default translation.
W: warning: string 'switched_to_twophone_mode' has no default translation.
I: Copy original files...
I: Copy AndroidManifest.xml...
I: Copy META-INF...
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

The resulting dist/SystemUI.apk does not work.

Any hints?
[Android Software Development] Eleo:
Did you import both framework apks? Framework-res and twframework-res...
[Android Software Development] Asellus:
Up to now not. After adding twframework-res.apk the build reports more messages

D:\Note 4\DevBase 5.9>java -jar ..\apktool_2.3.3.jar b -c -p framework SystemUI
I: Using Apktool 2.3.3
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: fakeLogOpen(/dev/log_crash, O_WRONLY) failed
W: fakeLogOpen(/dev/log_crash, O_WRONLY) failed
W: fakeLogOpen(/dev/log_security, O_WRONLY) failed
W: fakeLogOpen(/dev/log_security, O_WRONLY) failed
W: warning: string 'data_usage_disable_mobile_vzw_1' has no default translation.
W: warning: string 'data_usage_disable_mobile_vzw_3' has no default translation.
W: warning: string 'mobile_hotspot_dialog_nosim_warning_title_jpn' has no default translation.
W: warning: string 'switched_to_onephone_mode' has no default translation.
W: warning: string 'switched_to_twophone_mode' has no default translation.
I: Copy original files...
I: Copy AndroidManifest.xml...
I: Copy META-INF...
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

and unfortunately the resulting SystemUI.apk also does not work :crying:
[Android Software Development] Thebear j koss:
Did you disable signature verification?

Sent from my Essential Phone using Thebear Blue XDA Labs
[Android Software Development] Asellus:
To my knowledge it is not needed because I replace the whole apk.

But I gave it a try using the newest Lucky Patcher (I can't use Xposed due to SafetyNet, this is why I try to tweak the first time on my own).

I could apply the first two options of

Signature Verification Status always True

Disable .apk Signature Verification

Disable signature verification in the package manager

Because I only deodexed SystemUI.apk the latter option could not be chosen ("using odexed services.jar").

With the two patches applied the newly built SystemUI.apk did not work too.
[Android Software Development] Aqq123:
Did you try forcing framework update?

apktool empty-framework-dir --force

Decompiling similar stuff works for me. Maybe it's something specific to a particular APK. In any case, this file is easy to recreate. It's something like that:

<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@mipmap/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
[Android Software Development] iBotPeaches:
A new version has been released!

v2.3.4 (Released September 5, 2018)

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

md5 - ea45fba42cc01f82b7b805a1823af211

sha256 - 758b1bd58f9c9dd5ca85258d31c75f32e5878a502e3d75c66f3bfacf74b9dc1d

Details of Release: https://connortumbleson.com/2018/09/05/apktool-v2-3-4-released/
[Android Software Development] danielvilla1:
We can't decompile the Netflix apk
[Android Software Development] Thebear j koss:
Post the error
[Android Software Development] Eleo:
I believe your post was answered several times and you still keep on posting same post repeatedly:

https://xdaforums.com/showthread.php?t=1755243&p=76540449

https://xdaforums.com/showthread.php?t=1755243&p=76720217

Some apps cannot be decompiled because the person who built it does not want it to be decompiled and recompiled by other users. Can we keep it like that?
[Android Software Development] JIJOK:
maybe this is a noob question but I really need to know, is it possible to remove "android.permission.INTERNET" ?? ( "full network acces" when installing app ) every time I remove it app crash. Any help ? thnx
[Android Software Development] Eleo:
You can change app preferences using app ops apps or xposed modules. If app has to have a connection, then it is normal to crash. Since you didn't even provide app crash logs it is impossible to troubleshoot for me
[Android Software Development] JIJOK:
ok then I will try to give all info, the app is Foxit MobilePDF, I can use it "normally" without any connection ( thats why I try to remove permissions ), app ops and app ops root dont work since dont even detect that permission, didnt try xposed yet.

Here is the log ..... I think, 1st log I do
[Android Software Development] kramer04:
[MENTION=3924617]iBotPeaches[/MENTION]

hi

I'm trying to decompile/compile new Framework Note9 Oreo 8.1 with apktool 2.3.4

I can easily decompile it but when compile without any changes i've again error with 9.png

In log i've

W: Could not find sources

It's weird because Framework is installed.

Could you tell me what I am wrong ?

Attached log
[Android Software Development] Thebear j koss:
Read back or search thread. Issue has been discussed
[Android Software Development] kramer04:
Ok but 1st what keywords can i use, i don't find any answer to solve my problem

and 2 do you mean there is a solution to fix my problem ?

Thanks
[Android Software Development] Thebear j koss:
Go back to July. And it worked for others. Can't say it will for you.
[Android Software Development] kramer04:
Thanks for help

But nothing works for me

So if [MENTION=3924617]iBotPeaches[/MENTION] could take look ?
[Android Software Development] kimoVoid:
Hi, i installed 2 frameworks, but apktool only seems to use the first one and i'm kinda sure that it needs to use both, i can't decompile an apk cuz the second framework isn't loading...
[Android Software Development] usitaly:
the framework-res.apk is deodex?
[Android Software Development] djdarkknight96:
Afaik framework dex files are in framework jar but I could be wrong been long time since I edited fw. Like gingerbread lol.