yashsingh1/xdaforums huggingface dataset:
[Android Software Development] levone1:
any ideas about this...

(latest apktool; Debian Linux; 'if' and 'd' commands ran without error; no changes made to any files; stock Sony Xperia Oreo 8.0 apk [framework-res])

I: Using Apktool 2.3.1
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
W: /tmp/brut_util_Jar_344682835541589355.tmp: 1: /tmp/brut_util_Jar_344682835541589355.tmp: @8: not found
W: /tmp/brut_util_Jar_344682835541589355.tmp: 1: /tmp/brut_util_Jar_344682835541589355.tmp: ���: not found
W: /tmp/brut_util_Jar_344682835541589355.tmp: 1: /tmp/brut_util_Jar_344682835541589355.tmp: ���: not found
W: /tmp/brut_util_Jar_344682835541589355.tmp: 1: /tmp/brut_util_Jar_344682835541589355.tmp: ���������������/lib64/ld-linux-x86-64.so.2GNU: not found
W: /tmp/brut_util_Jar_344682835541589355.tmp: 1: /tmp/brut_util_Jar_344682835541589355.tmp: ELF: not found
W: /tmp/brut_util_Jar_344682835541589355.tmp: 58: /tmp/brut_util_Jar_344682835541589355.tmp: @ui: not found
W: /tmp/brut_util_Jar_344682835541589355.tmp: 59: /tmp/brut_util_Jar_344682835541589355.tmp: Syntax error: "(" unexpected
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 2): [/tmp/brut_util_Jar_344682835541589355.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, /tmp/APKTOOL2035834700149188750.tmp, -x, -0, arsc, -0, arsc, -S, /root/framework-res/res, -M, /root/framework-res/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:492)
at brut.androlib.Androlib.buildResources(Androlib.java:426)
at brut.androlib.Androlib.build(Androlib.java:305)
at brut.androlib.Androlib.build(Androlib.java:270)
at brut.apktool.Main.cmdBuild(Main.java:227)
at brut.apktool.Main.main(Main.java:75)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 2): [/tmp/brut_util_Jar_344682835541589355.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, /tmp/APKTOOL2035834700149188750.tmp, -x, -0, arsc, -0, arsc, -S, /root/framework-res/res, -M, /root/framework-res/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:456)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:478)
... 5 more
Caused by: brut.common.BrutException: could not exec (exit code = 2): [/tmp/brut_util_Jar_344682835541589355.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, /tmp/APKTOOL2035834700149188750.tmp, -x, -0, arsc, -0, arsc, -S, /root/framework-res/res, -M, /root/framework-res/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:95)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:450)
... 6 more

I guess something's not decoding for some reason...?

Note - built fine on Win10
[Android Software Development] nguyentankiet:
Delete pip_dismiss_scrim.9.png in systemui\res\drawable-xxhdpi

Open publish.xml delete line "pip_dismiss_scrim"

Recom again
[Android Software Development] Spannaa:
It tells you what's wrong (and this has come up a few times in this forum)!

res\drawable-xxhdpi\pip_dismiss_scrim.9.png is malformed - fix the .9patch image before you recompile and it'll work ;)

Reference
[Android Software Development] iBotPeaches:
The problem is that is output from aapt. So we are running the command via apktool and once we encounter an error message, which usually comes over stderr, we pass those out to the console prefixing with our logger with "W" for warning. This is the warnings/errors you see. Likewise, the regular output from aapt (on stdout) is ignored (unless verbose is enabled).

We are just passing a stream of data currently. We don't know what is happening until the failure occurs. We could arguably read the entire output into a string, run some regular expressions and update the user, but seems like a good deal of work. Once the the aapt command returns with a non-zero value, we know an error has occurred so we die out (Exception), which has that stacktrace with it. That stacktrace is incredibly helpful for fixing issues as it tells me exactly where the failure occurred. While the warnings/failures above the stacktrace are for the user to identify what went wrong. This isn't always true, sometimes the exception is the error.
[Android Software Development] Ticklefish:
Hmm. So not quite as simple as I'd hoped.

Is it possible to put a new line between the aapt output and the stacktrace? I get that the stacktrace is useful but it might be that the sheer size of it is distracting users from the text above.

I stress that this isn't in any way a complaint. You'll always get people who, upon encountering an error, immediately ask for help without reading the lines and trying to solve it themselves. That'll never change and we'll just have to deal with it as and when they post.

I was just wondering if something could be done to prompt people, even if just a little bit, into trying to work out a solution on their own.
[Android Software Development] Thebear j koss:
Best thing I learned was to read a log or an output like the error message using apktool. Always fix that 1st error you see and work from there. Once you get that the process stops at the error, it is easier to filter out everything else afterwards. The 9 patch error is always the worst, it looks like your computer is being hacked when the output flies by. Lol
[Android Software Development] endorfina_pl:
Hello i have big problem with recompile app. I want edit car launcher app but i cant recompile it...

Apktool give me error:

[IMG="error"]https://i.imgur.com/2VtHzlj.png[/IMG]

Anyone can help me?

[MENTION=3924617]iBotPeaches[/MENTION]
[Android Software Development] Ticklefish:
If apktool.yml is missing it means that your APK didn't decompile properly.
[Android Software Development] endorfina_pl:
Please check PM
[Android Software Development] Ibuprophen:
Exactly as Ticklefish had stated...

I believe that it looks as though you may have confused Decompile with Decompress.

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

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] endorfina_pl:
Im use now "TickleMyAndroid" and work! Thanks guys! Awesome work! :)
[Android Software Development] levone1:
Anybody been successful with stock O on Xperia device? I don't know if it's just me, and I'm missing something, or if we need to wait for Apktool update for Xperia. I've tried Apktool on Windows, Linux, and Android, (and Tickle My Android), and I haven't gotten a successful recompile of framework-res or SystemUI yet, although import and decode run without issue, (actually framework did build on Win10 one time, but wouldn't boot). Errors vary from platform to platform, (I've posted 2 or 3 here with no response). Sorry if I'm not getting something... If anyone's willing to help, I'll post whatever you need.
[Android Software Development] Thebear j koss:
Well [MENTION=2126467]djdarkknight96[/MENTION] helped you out 3 months ago, not sure what your other issues are, but if you post error log output I am sure someone can help you. The 1 log I saw you posted says that resources are not found which seems to me that proper frameworks/files were not installed but you also said it built on win 10 but wouldn't boot. On 1st try, decompile the app, recompile without changes and install the recompiled app to see if it works. If not post logs to see what the issue is, while also posting steps to what you did- built with new signature, original signature, flashed new app using a zip, pushed using adb, etc. The more info the easier it will be to find the issue.
[Android Software Development] levone1:
OK. I had originally planned on testing and logging more, but wasn't sure if I should just give up. I'll look into it more. 3 months ago was still N... Typically, in my last 4 years of modding Xperia apks, nothing more than framework-res and maybe SystemUI was needed for framework, (except semcgenericuxp... which isn't in there anymore), but maybe with O there's some other framework file I'm missing. That's why I wondered if anyone else here has had success with Xperia O, to see what they did. I also haven't seen any modded stock roms yet, which made me wonder if it wasn't just me..

Thanks
[Android Software Development] levone1:
OK I'll check it out... (sorry I just realized that I forgot the / in code...(fixed)
[Android Software Development] [] AL []:
just an idea from what I could read here (apart from the obvious 9-patch png that need fixing) could it be possible that (on Windows) you are not placing the framework, the systemUI and the apktool. jar files in the same working directory? Seems like you're placing all those at different places; so why not try to put them all in one folder where you open the command prompt from?
[Android Software Development] niaboc79:
Paste this file in system/res/drawable-xxhdpi

It's a common issue on Oreo.
[Android Software Development] iBotPeaches:
aapt2 has been merged into master. The upcoming March release will give the ability to rebuild with aapt2 instead of aapt. Note for large applications, this will almost never work without manual intervention. aapt2 has a few bugs and much more restrictive process when linking assets, unlike the previous aapt. I'd like this release to basically be a large public beta, but still stable for aapt1. Apktool also gained the ability to detect "what" version of aapt it has when you use the custom aapt binary parameter. This might prove to be wrong if custom developers modify the version information of the aapt binary, but we will cross that bridge if/when discovered.

I have a few more tickets to investigate, but then this I'll slice this release and await the influx of issues as we grow the aapt2 test cases for each discovered issue.

EDIT:

Pull Request for those interested: https://github.com/iBotPeaches/Apktool/pull/1726

Changes to framework/base for those interested: https://github.com/iBotPeaches/platform_frameworks_base/commits/apktool_8.1.0
[Android Software Development] Thebear j koss:
[MENTION=3924617]iBotPeaches[/MENTION] lucky you android P betas may be available next month... It never ends. Lol
[Android Software Development] Ticklefish:
I'll say. It seems like only yesterday I was trying to get my phone to the dizzy heights of Froyo..

Still, with dedicated developers like [MENTION=3924617]iBotPeaches[/MENTION] keeping up the hard work, I'm sure we'll be modding all the way up to Zucchini Pie (or whatever) and beyond!
[Android Software Development] iBotPeaches:
I guess the jokes were right - Android P DP 1 has dropped - https://android-developers.googleblog.com/2018/03/previewing-android-p.html

AOSP is probably lying to us, but it seems no configuration changes at the resource level according to the diff report - https://developer.android.com/sdk/api_diff/p-dp1/changes/pkg_android.content.res.html. This would require just an update of the Android P framework and things should work if this stays as-is.
[Android Software Development] bovirus:
[MENTION=3924617]iBotPeaches[/MENTION]

With latest updates on source code (3 days ago) I got this error during compilation on final tests

[MENTION=292510]brut[/MENTION].androlib.aapt1.BuildAndDecodeTest > classMethod FAILED

java.lang.NullPointerException

at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:132)

at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:115)

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

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

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

at brut.androlib.aapt1.BuildAndDecodeTest.beforeClass(BuildAndDecodeTest.java:61)

brut.androlib.aapt1.LargeIntsInManifestTest > checkIfLargeIntsAreHandledTest FAILED

java.lang.NullPointerException

at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:132)

at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:115)

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

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

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

at brut.androlib.aapt1.LargeIntsInManifestTest.checkIfLargeIntsAreHandledTest(LargeIntsInManifestTest.java:66)

brut.androlib.aapt1.ProviderAttributeTest > isProviderStringReplacementWorking FAILED

java.lang.NullPointerException

at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:132)

at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:115)

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

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

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

at brut.androlib.aapt1.ProviderAttributeTest.isProviderStringReplacementWorking(ProviderAttributeTest.java:70)

brut.androlib.aapt1.UnknownCompressionTest > doubleExtensionStoredTest FAILED

brut.directory.PathNotExist: Entry not found: assets/bin/Data/two.extension.file

at brut.directory.ZipRODirectory.getCompressionLevel(ZipRODirectory.java:108)

at brut.androlib.aapt1.UnknownCompressionTest.doubleExtensionStoredTest(UnknownCompressionTest.java:80)

brut.androlib.aapt1.UnknownCompressionTest > pkmExtensionDeflatedTest FAILED

brut.directory.PathNotExist: Entry not found: assets/bin/Data/test.pkm

at brut.directory.ZipRODirectory.getCompressionLevel(ZipRODirectory.java:108)

at brut.androlib.aapt1.UnknownCompressionTest.pkmExtensionDeflatedTest(UnknownCompressionTest.java:69)

59 tests completed, 5 failed
[Android Software Development] cnkzlyr:
Im using latest apktool x mobile. Using galaxy s5 exynos g900h. No problem about decompiling editing and recompiling systemui. But I think signature is not working. When I install the systemui, after reboot I see no status bar, no recents and no wallpaper. Can you help please
[Android Software Development] [] AL []:
Mmm!

First of all, wrong thread; this one has nothing to do with a mobile version of apktool.

Second, we know your phone model and the app you want to edit, but you give us zero details on what you did and try. The problems you've described only tells us that your app is obviously not working, but that's all you give us to work with. So put yourself in our shoes and tell us how many wild guesses we should give you?

Here I'll risk one anyway: decompile and recompile without any changes to the app and try (notice that I didn't use the word install because system apps are replaced, not re-signed and certainly not installed as a stand alone apps (you might know all that, but again: how can we know?...).

I already wrote more than you did; so if you want more help, I'd suggest you make sure that your posts have as much info as possible on what you did and how.
[Android Software Development] danyldft:
Here I have the same problem.

Regards
[Android Software Development] iBotPeaches:
My test suite passes on Mac & Linux on Travis and passes locally on Mac and Linux. The only missing system is Windows in that scenario. As long as the final jar continues to work on Windows, I think I am going to disable building on Windows. I don't have the resources or time to continue to look into Windows issues.
[Android Software Development] bovirus:
[MENTION=3924617]iBotPeaches[/MENTION]

If in the prior release it passed on Windows OS.

It means probably that you add some features that are os dependent (I believe not best solution for a java build).

I and the other users on Windows can help you to test it.

Because that there are developer and user under Windows OS.
[Android Software Development] iBotPeaches:
Thanks for testing. It seems a few tests are falling, it might be the same root cause, but I don't have a Windows environment available currently for development so feel free to put in a pull request when you identify the fix. The test suite runs automatically on Unix and Mac, so fixing the issue locally on Windows will allow you to test the fix on Mac and Unix leveraging TravisCI.
[Android Software Development] bovirus:
[MENTION=3924617]iBotPeaches[/MENTION]

I didn't know if Mac/Unix has the limit of 255 chars for path/files structure.

I checked that in Windows there is this limit and your structure in some conditions is over 255 chars as path/filename.
[Android Software Development] bovirus:
[MENTION=3924617]iBotPeaches[/MENTION]

I compiled undere Linux (VMWAre under Windows 7 OS) and it was OK just for a warning.

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :

Building SNAPSHOT (master): 171349

> Task :brut.j.util:compileJava

Note: /home/ubuntu/Desktop/Apktool/brut.j.util/src/main/java/brut/util/Duo.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Download https://repo1.maven.org/maven2/org/smali/baksmali/2.2.2/baksmali-2.2.2.pom

Download https://repo1.maven.org/maven2/org/smali/smali/2.2.2/smali-2.2.2.pom

Download https://repo1.maven.org/maven2/org/smali/dexlib2/2.2.2/dexlib2-2.2.2.pom

Download https://repo1.maven.org/maven2/org/smali/util/2.2.2/util-2.2.2.pom

Download https://repo1.maven.org/maven2/org/smali/baksmali/2.2.2/baksmali-2.2.2.jar

Download https://repo1.maven.org/maven2/org/smali/util/2.2.2/util-2.2.2.jarktool-lib:compileClasspath

Download https://repo1.maven.org/maven2/org/smali/dexlib2/2.2.2/dexlib2-2.2.2.jar

Download https://repo1.maven.org/maven2/org/smali/smali/2.2.2/smali-2.2.2.jar

> Task :brut.apktool:apktool-lib:compileJava

warning: /home/ubuntu/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.64/456a985ac9b12d34820e4d5de063b2c2fc43ed5a/jcommander-1.64.jar(com/beust/jcommander/Parameter.class): major version 52 is newer than 51, the highest major version supported by this compiler.

It is recommended that the compiler be upgraded.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

1 warning

BUILD SUCCESSFUL in 1m 18s

20 actionable tasks: 17 executed, 3 up-to-date
​

Is it normal?
[Android Software Development] iBotPeaches:
Yes I'm aware of all warnings during build. They won't cause a problem yet, they are just warnings.
[Android Software Development] nhan1411:
Hi iBotPeaches,

Could you help support android P DP1? I have tried version 2.3.1 on this ROM. Decompiling systemUI is succesfull but recompiling is not.
[Android Software Development] Ibuprophen:
This issue has already been submitted to [MENTION=3924617]iBotPeaches[/MENTION] in Github within the following link.

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

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

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] nhan1411:
Thank for yor information. Hope that he will fix this issue soon.
[Android Software Development] djdarkknight96:
Looks like he did 3 days ago

Quote:

Okay in master is a fix for the numeric error and added in the Android P Preview internal framework.
[Android Software Development] nhan1411:
Where can i find that fix? I tried his page but saw nothing
[Android Software Development] djdarkknight96:
https://github.com/iBotPeaches/Apktool/commit/7621fdb79cd17bd411f4474fd2c329510c6ea859

https://github.com/iBotPeaches/Apktool/commit/c7ac2c05e2065413587ada1875994b1b7c41a8fb
[Android Software Development] nhan1411:
Thank you so much. But i dont know how to use it. All i know is download the tool and play around. I wonder if he update the fix in his tool.
[Android Software Development] djdarkknight96:
You can build with the new changes, look in op for how to. It's not too hard tbh
[Android Software Development] bovirus:
[MENTION=8120844]nhan1411[/MENTION]

For anyone could be interesting I created a repository an archive compressed file that contain always latest apktool built.

The download link is here

Apktool - latest beta build

The link will remain the same also with new version.

..
[Android Software Development] nhan1411:
Thank you so much. I will tried if the beta version works on anroid P
[Android Software Development] cnkzlyr:
Dear developers. Im trying to learn something.

Im on samsung galaxy s5 exynos stock mm Odexed debloated zipaglined rom which made by me on assayed kitchen.

Im using apktool x latest 7.3.3 on mobile.

Can anyone help me please. Dont have problems while importing framework compiling apk or recompiling. There is a problem about signature. Im trying to modify systemui dimens xml. Compiled. Signed via apktool x. But after flash systemui Im getting black background after boot, no lockscreen recents or status bar. Also tried to sign with mixplorer mix signer addon. I heard about something systemui signature needs to be fixed by replacing some files from recompiled apk to original apk. But this information is in everywhere complicated.

Can anyone tell me what to do after recompiling systemui apk step by step about the signature thing?

The other question, do I need to use zipagline button after signing apk? Why need?
[Android Software Development] Spannaa:
As you were told before by [MENTION=3703649][] AL [][/MENTION] - This thread has nothing to do with a mobile version of apktool - it's for the original command line version, so there's no buttons!

Don't sign system apks, they won't work on your device unless you've disabled signature checking.

If you've only edited res/values/dimens.xml in SystemUI.apk, just drop resources.arsc from your edited, recompiled SystemUI.apk into the original SystemUI.apk using the same compression level as the original (resources.arsc often isn't compressed).
[Android Software Development] cnkzlyr:
Sorry sir.

You say, edit dimens.xml, recompile. Then replace resources.arsc from recompiled apk to original apk? No need to move res folder or dimens.xml?

What about if I also edit colors.xml?
[Android Software Development] Spannaa:
You can't replace dimens,xml or colors.xml in the original apk because the res/values folders are compiled into resources.arsc - look in the original SystemUI.apk with 7-Zip and you won't see any res/values folders ;)

If you're only editing files in the res/values folder, just dropping resources.arsc from recompiled apk into original apk should be enough (but, like I said, make sure you check the compression).
[Android Software Development] methoddon1:
can someone please provide both framework files for Samsung oreo?! thanx..

framework-res.apk and twframework-res.apk
[Android Software Development] Spannaa:
This isn't really the place to ask, but It might help if you mentioned the device and rom you want them for ;)
[Android Software Development] methoddon1:
Samsung Oreo is not enough mentioned?! never mind, I got it from TMA thread..
[Android Software Development] cnkzlyr:
Brother it worked thank you very very very much ??

---------- Post added at 02:26 PM ---------- Previous post was at 02:04 PM ----------

[MENTION=2948558]Spannaa[/MENTION] Bro finally, which folders are in resources.asrc? Which folders I can edit and copy only resources.asrc as u said? Smali in it? Im very happy your method worked for values folder
[Android Software Development] Spannaa:
resources.arsc just contains all of the res/values folders e.g. res/values, res/values-v21, res/values-en-rAU, res/values-fi-sw600dp-v13 etc. etc.

so you can edit anything in these folders and just replace resources.arsc

smali is in classes.dex for deodexed roms and a separate file for odexed roms.
[Android Software Development] [] AL []:
Do you think that Samsung uses only one Oreo ROM for all the device they make?

Maybe your device name is in your signature, but I don't see it with the Xda Android app I'm using; so pretty hard to help on not enough details... Just for next time...