yashsingh1/xdaforums huggingface dataset:
[Android Software Development] gcrutchr:
@iBotPeaches

Still getting an error on my ICS 4.0.3 SystemUI.apk for my ASUS TF700T.

D:\ASUSTF700T\ROMs\94526\test2>java -jar apktool10.jar if framework-res.apk

I: Framework installed to: C:\Users\GCrutcher\apktool\framework\1.apk

D:\ASUSTF700T\ROMs\94526\test2>java -jar apktool10.jar d SystemUI.apk systemui

I: Baksmaling...

I: Loading resource table...

I: Loaded.

I: Decoding AndroidManifest.xml with resources...

I: Loading resource table from file: C:\Users\GCrutcher\apktool\framework\1.apk

I: Loaded.

I: Decoding file-resources...

I: Decoding values*/* XMLs...

I: Done.

I: Copying assets and libs...

D:\ASUSTF700T\ROMs\94526\test2>java -jar apktool10.jar b systemui

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce

ption: could not exec command: [aapt, p, -F, C:\Users\GCRUTC~1\AppData\Local\Tem

p\APKTOOL494483656523866747.tmp, -I, C:\Users\GCrutcher\apktool\framework\1.apk,

-S, D:\ASUSTF700T\ROMs\94526\test2\systemui\res, -M, D:\ASUSTF700T\ROMs\94526\t

est2\systemui\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:251)

at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)

at brut.androlib.Androlib.buildResources(Androlib.java:269)

at brut.androlib.Androlib.build(Androlib.java:192)

at brut.androlib.Androlib.build(Androlib.java:174)

at brut.apktool.Main.cmdBuild(Main.java:185)

at brut.apktool.Main.main(Main.java:70)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\U

sers\GCRUTC~1\AppData\Local\Temp\APKTOOL494483656523866747.tmp, -I, C:\Users\GCr

utcher\apktool\framework\1.apk, -S, D:\ASUSTF700T\ROMs\94526\test2\systemui\res,

-M, D:\ASUSTF700T\ROMs\94526\test2\systemui\AndroidManifest.xml]

at brut.util.OS.exec(OS.java:83)

at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.jav

a:249)

... 6 more

D:\ASUSTF700T\ROMs\94526\test2>

Attached are the framework-res.apk & SystemUI.apk.

Hope you can help.
[Android Software Development] nixx-X1:
Now I feel stupid, I was completely unaware of this factor (and up till now nobody bother to tell me :) )

Guess I didn't do enough research since I got stuck at step one all the time I didn't look ahead.

In the past I used the multitool to get icons etc out of other apps, but never looked at the code.. just assumed it'd be the same.

I tried, but he wants to do it himself, but have been waiting (and friendly reminding him) for 4 months now.. so I'm a little impatient i guess :)

Thank you so much! I'll have a look and see if I can do anything with it.

I do love Lamborghini's ;)

Thanks to all for the clarification, I'll have a look in the next days and see if I can do anything with it.

Also have found a guide on how to put the smali stuff back together..
[Android Software Development] DaOldMan:
[MENTION=3924617]iBotPeaches[/MENTION] or someone who knows Miui,

I need 2.0.1/2.0.0 for MIUI (lollipop Mi4i), getting the "values-mcc9998-mnc9999" problems when compiling :(. Can someone point me to a working tool or how to change the source to make it compile correctly ?

Thanks a lot !
[Android Software Development] Aman Dewett:
[MENTION=4916750]Thebear j koss[/MENTION] sir you helped me a lot before, so now i have already learnt about resources(res). Now i wanna learn about Smali language, can you please tell me from where i should start to do reverse engineering?
[Android Software Development] Thebear j koss:
Smali is my weak spot. Lol. There is no easy way to go about doing things in smali unless you studied it or have been working in it for years. It's still trial and error for me. Basics for theming, there are a few things you can do to to cut down the millions of lines of code. Basic search for setBackgroundColor, setTextColor, and getpaint will still bring up tons of hits but it helps tremendously. Also helps if you know what you are looking for. Say you want to change a tab background color that is in smali, the best way to find it is to search it's id from the public.xml in values. Once you start just doing the basics of finding using the public ids and the set background, text, etc it will get a little easier.

Best advice, start small. Do an app that is done already. Try finding the changes made by developer from the stock app yourself and when you get stuck have a copy of the done app to diffmerge the changes he made if you get stuck. You can see what they did and after a while you can start seeing little things that made no sense whatsoever you can at least identify.

I'm sure there is a better way but i'm no dev, programmer, or even a true themer. Just a guy that smokes too much and dabbles in theming.

Always use the public ids to search for stuff and reference when needed and keep notes on what you changed. It will be easier next time so you can see what you changed the last time. The changes you did are most likely going to be in the same spot or near where they were the last time. Hope it helps somewhat. Lol
[Android Software Development] djdarkknight96:
I use this with monitor.bat in the SDK tools folder to get id's color codes and smali locations using adb from your device. Helps a ton along with Bear's explanation.
[Android Software Development] :
To get ids? Why you need monitor for that. or you use the layout option to work with it?

And yes to debug an app you most certainly use monitor or any logtool (like Catlog) for Android.

It helped me (sorta) understand what was causing the G4 message app to die. but not really since it didn't explain exactly where it was crashing. Turned out to be LG's own framework that didn't had a dimension defined for the G4 message. I also googled for what the error ment and later on found out where it was (after applied pretty much all style Related info in LG's own framwork from G4 to G3) but sometimes the logdoesn't fully explain where the issue lies.
[Android Software Development] Vivek_Neel:
Monitor.bat makes that easy for you.

You can't just keep going to res/layout and find the ids you Want

That sounds tedious. Does not it? :)
[Android Software Development] :
I often don't mess with ids [emoji14] afaik its most false values there anyway ? or I might be wrong
[Android Software Development] Thebear j koss:
Ids? Those are bools that are t/f. Everything in an app, color, drawable, text, sound, animation is given an id located in public.xml. Just find the # of whatever you are looking for and search for it in notepad++
[Android Software Development] :
Not talking about Bools
[Android Software Development] Thebear j koss:
Sorry. Think i just misunderstood you.
[Android Software Development] :
It isn't easy if you don't have it forward on your screen to look at ill explain tomorrow
[Android Software Development] Lanchon:
something can indeed be imported into eclipse, google dexpatcher :)
[Android Software Development] erikalin:
I see that word in your signature file, but this thread is for apktool and so the answer is correct for this tool... If your tool can turn an apk file into an Android Studio project, maybe the one who asked for that can go to your thread to learn more. :good:
[Android Software Development] Thebear j koss:
Erika!!!! Sweet i have a question i need help with and i think yoy may have the answer i need. When i get home i will send you a pm with my question. [emoji106] [emoji106] [emoji106]
[Android Software Development] djdarkknight96:
Yes ID's and no they aren't false values, if you don't know where the layout or smali location using the ID points you to the layout where the love begins. :)
[Android Software Development] Aman Dewett:
Thank you Guys at least i can take start with it :)
[Android Software Development] Aman Dewett:
[MENTION=4916750]Thebear j koss[/MENTION] is this what you were talking about but through this way i couldn't found that id in that smali which is indicated in layout file or maybe i am doing something wrong.

check attachments please.
[Android Software Development] Thebear j koss:
In smali open all the items that pertain to whatsapp. I don't know whatsapp, but the path for most is smali-com-android-app name. Open all those files in the app name folder and search all the files and you can narrow it down from there. Also did you check all the styles.xmls to see if it is defined there?

Here is some great tutorials from team blackout- http://www.designrifts.com/teamblackedoutapp/tutorials/

There's written tutorials and a couple of videos that are really helpful. They are made for inverting apps from light to dark but they can really be applied anyway you like. [MENTION=2126467]djdarkknight96[/MENTION] is the man to ask about whatsapp, he themes it for tbo.
[Android Software Development] laura almeida:
Can you try using apps like Agent Ransack to find all the smali files in which 0x7f10007a is specified ?
[Android Software Development] :
i'm talking about:

<item type="id" name="half_wrong_password_dialog_root">false</item>

<item type="id" name="description">false</item>

<item type="id" name="image">false</item>

<item type="id" name="enter_confirm_string">false</item>

<item type="id" name="btnOk">false</item>

<item type="id" name="toast_layout_root">false</item>

<item type="id" name="text">false</item>

<item type="id" name="locale">false</item>

<item type="id" name="radio1">false</item>

<item type="id" name="NotificationContent">false</item>

there are false values in the ids.
[Android Software Development] Thebear j koss:
Ok, i got you now. I was thinking of the id's in public.xml. Completely different.
[Android Software Development] Lanchon:
well your original post was overarching because it wasnt qualifying that statement. anyway dexpatcher uses apktool internally to decompile resources and also provides gradle plugins for apktool invocation to anybody needing to integrate vanilla apktool into the android build system, so i think my comment is relevant. but its just a matter of opinion anyway.
[Android Software Development] Morningstar:
I have no idea what Agent Ransack is, but you can do what you describe with the search function in Notepad++. Easy-peasy.
[Android Software Development] shmshd12:
can somebody create 2.0.1-Snapshot .jar and give a download

link

:D
[Android Software Development] bovirus:
[MENTION=6143851]shmshd12[/MENTION]

Small version-

Full version -
[Android Software Development] shmshd12:
[MENTION=637263]bovirus[/MENTION]

Thanks :)
[Android Software Development] :
You just doomed us all ????
[Android Software Development] Spannaa:
Not sure you should be posting those here - check out the thread guidelines in post #1:

Sent via Bacon...
[Android Software Development] Thebear j koss:
I didn't even know what they were, it brought me to mega saif i have it installed which i don't, then it f/c my browser. Lol but yeah only share your snapshot builds via pm. Ibotpeaches doesn't need issues being reported of an unofficial build ...
[Android Software Development] bovirus:
[MENTION=2948558]Spannaa[/MENTION]

OK,. i just want to help some.

But if someone is not able to compile who can help him?

Removed the link and posted as PM, but I'm not agree about this rule.

For me the author should be make availble the compield version for all uaer that can do it.
[Android Software Development] Aman Dewett:
Yes i did checked the styles.xml it is defined there but even if i change it's color from there no affect which indicates that color is define in smali and thanks i will ask [MENTION=2126467]djdarkknight96[/MENTION] after trying these tuitorials.

How it can help me?
[Android Software Development] Vivek_Neel:
I appreciate your sense of helping :good:

But he just suggested you the right thing. Its always good to respect the op's decision. Because there is reason behind what op posted :)
[Android Software Development] djdarkknight96:
Because that's how we keep order, not hard to understand not place confusing build links here...who knows if they complied it correctly or has a bug he's working on. Rules are rules period!
[Android Software Development] bovirus:
[MENTION=2126467]djdarkknight96[/MENTION]

Yes it true. But you forgot that not all users can compile it.

And in this case if the author put in the first post also just latest build already compiled all users can get it directly.
[Android Software Development] djdarkknight96:
What are you trying to do? I've fully inverted and also made Clear version of whatsapp. It's not an easy edit at all.

---------- Post added at 09:53 AM ---------- Previous post was at 09:50 AM ----------

You assume it's working properly, if it's not who do you complain to then? As he hasn't release it yet and there's an issue?

Patience will get you everything, impatients gets you nothing.
[Android Software Development] Thebear j koss:
Just don't post it on this thtead. Share your builds however you want, just out of repect to [MENTION=3924617]iBotPeaches[/MENTION] and to not mix up bugs being fixed with new onrs that may have come up. It can get confusing.
[Android Software Development] iBotPeaches:
Yeah, what everyone already said. The current source built from GIT possibly has a nasty error where all decompiled resources include the qualifier "v4" ( or some version). In my testing on Lollipop I don't experience this, but in a trusted group of testers, they report that this breaks their APKs, as every APK includes a qualifier. This is why the promised 2.0.1 release is a bit delayed. I'm trying to get to bottom of that problem. It is a strange problem, because the Android version of the host device affects it. This means I'm constantly downgrading/upgrading my Nexus 5.

I might explore a build bot service where newly built binaries are uploaded online, since I try and make sure every commit on master is stable, but I make mistakes so I can't confirm that always. In point, any 3rd party builds should be shared privately, because posting them in here results in some mixups for me.

I know 2.0.1 should be out already, but just hold a bit more time with me. I don't want to push a build that I immediately have to panic and fix to release a 2.0.2 for.
[Android Software Development] DaOldMan:
Dear [MENTION=3924617]iBotPeaches[/MENTION],

Can you please help with the miui problem I asked about 2-3 pages ago? It got lost in the smali discussion probably.

Thanks for all your wonderfull work!
[Android Software Development] Ticklefish:
Personally, I don't mind using an unofficial build for myself. But I only ever recommend an official build for others. It just gets too complicated otherwise.

Not everybody has the same competency at de/recompiling files (which is just a matter of experience) so it's best to try to keep things simple.

---------- Post added at 10:46 AM ---------- Previous post was at 10:43 AM ----------

That'd be this post here: http://xdaforums.com/showpost.php?p=61678096&postcount=3390

(There are a lot of posts in this thread! lol)

:highfive:
[Android Software Development] iBotPeaches:
Thanks for link. [MENTION=3026895]DaOldMan[/MENTION] this is a problem that I told my MIUI folks to fix at their level. MNC/MCC max is 999. These values of 9998 are invalid, if I remove the checks in both aapt & apktool, then anyone can make apks with those values. Which I believe will crash non-miui devices (That I'm not 100% sure on). I have no problem patching apktool for MIUI changes that don't affect other things, but this change to validation would tweak the entire usage of apktool with mnc/mcc.

I would delete those directories or rename them to 999, 998, etc. You can read my stack overflow response here which is about this same problem for additional details.
[Android Software Development] georgcmef:
Hey all can someone give me a hand? I am running into a large amount of invalid tokens upon me trying to recompile it even without me changing anything. I just decompile then recompile to see what the errors are

for example this line returns an error:

<o.ᐧ android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/com_playstation_companionutil_drawable_background" android:scaleType="centerCrop" android:contentDescription="@android:string/untitled" />

what am i doing wrong and why can i not build the apk with not even changing anything. I'm guessing there are characters that are being used in the apk that the compiler doesn't know about. How do I fix this.
[Android Software Development] Ticklefish:
Can you share the error message that apktool gives you please?
[Android Software Development] Aman Dewett:
Bro i know it's not easy to mod whatsapp but i still wanna mod it, first i will try to change text colors from .smali and as time passes i will make a complete mod like extra privacy filters (Freeze last seen, hide second ticks) and many more like whatsapp+. Will you please help me to learn smali you just have to tell me where to start.
[Android Software Development] DaOldMan:
I have read most of anything you ever wrote about the subject. Most of it was done in years 2012, 2013. I can't really find aapt source to compile for windows platform, or a guide how to do it on ubuntu (cross compiling). So I can't use your commit to fix aapt.

Deleting/renaming those directories for 40+ apk is not a really easy task, and has to be done every time again and again. Yes, it works.

If you can help me with this problem I would appriciate it a lot. I tried PatchRom aapt, still the same problem :(.
[Android Software Development] :
Well to get more detail in what went wrong.

1, what version of apktool are you using

2, is it framework related file or just a random app from etc playstore

3, if framework related did you load the frameworkfile?

4, you sure that you opened the correct xml file and not the uncompiled? Or that it is decompile successfully?

To me it looks like a incomplete or corrupt decompile of the xml and that causes you to being unable to recompile properly.
[Android Software Development] Lanchon:
dont learn smali, its assembler, its unproductive as hell. study dexpatcher instead (disclosure: its my own spawn from hell). decompile using bytecode-viewer or just cfr (ive got cfr linux only sctipts there too). probably obfuscated, so you might want to add an iterative manual deobfuscation (ie renaming) step to your workflow; u can use dex2jar toolset for that i think.
[Android Software Development] DUHAsianSKILLZ:
Hi. I have a problem when using the apktool tool. When decompiling and recompiling with no edits or anything to the systemUI apk, it causes the nontification pulldown to shift to the left when i install it back to my tablet. When I flash back the original systemUI that came with the firmware, no problem with shifting or anything. Just the one I recompiled from apktool without any changes causes it to shift. My device is Galaxy Tab S 10.5 running on TouchWiz 5.0.2 and I used the apks that I pulled from my device. I am using apktool 2.0.0 too. I didnt see anyone report it here (I used search and everything). This shift bug also appears on the Tab 4 when recompiling and decompiling without any changes or mods added to systemUI (running TouchWiz 5.0.2 also).

I have pinpointed the problem to be in layouts folder and it might either have something to do with status_bar_expanded xml and maybe super_status_bar xml as it only happens when you pulldown the status bar. So far I have only seen this problem on tablets running TouchWiz 5.0.2 Stock since I had the same problem on the Tab 4 and Tab S (even the Tab S 10.5 inch model and 8.4 inch model). Everything decompiles and recompiles with no errors or anything. Heres a picture of flashing the apk that I decompiled and recompiled with no edits or mods added. As you can see this one is shifted the the left.

In which its supposed to be in the middle and not towards the left. Any thoughts?

Heres the original systemUI without going through apktool or anything. This is what its supposed to loom like
[Android Software Development] georgcmef:
1. I'm using the latest build from the github repo

2. It's the modified remote play app from the Sony Xperia phone to work on all phones.

3. How do I check to See if its dependant on the framework?

4. I get no errors on the decompile and what xml file are you referring to ?

Thank you for your help
[Android Software Development] :
Hmm strange well I was talking about undecompiled files but if you got a success in decompile you should not be worried.

So it does not recompile? What was you recompiling and what does the cmd say?

If you changed in smali you can just go to build and grab the classes.dex and put it in your untouched app

If you are not going To touch any xml files you should use

Apktool d --no-res to avoid any issues with xml when decompile since you are most likely going To edit classes.dex
[Android Software Development] DSA:
Decompile your new apk, compare it to the original one and look for anything that's changed
[Android Software Development] DUHAsianSKILLZ:
Hmm, I just opened the original apk with winrar and extracted status_bar_expanded xml and status_bar_ header xmls from the layouts folder. Then after I recompiled my themed apk, I opened the new apk with winrar and dragged the two xmls I extracted from the original apk into the layouts folder. Now it all works fine. So Im guessing apk tool changes these two xmls for tablets?
[Android Software Development] Aman Dewett:
ok thanks i will try it as well
[Android Software Development] georgcmef:
When I compile apktool complains about invalid tokens.

Here is the file in trying to messes with its the Playstation remote play app. It works on any android device. https://www.dropbox.com/s/8sebyo88pj21gex/RemotePlayPortV1.4_Beta_Native.apk?dl=0

If you can decompile and compile it then is my setup.
[Android Software Development] DaOldMan:
Dear [MENTION=3924617]iBotPeaches[/MENTION],

I have compiled aapt from google sources, applied the changes (the mmc and mcc 3 digit and the older qualifiers changes from your git). You should know that the latest version of aapt needs the frameworks to have AndroidManifest.xml in them beside the resources (in 1.apk for instance). I think you should consider adding this file automatically when installing framework via apktool. Otherwise the latest aapt will not recognise and use 1.apk and complain there are no resources.

I have removed the check for AndroidManifest.xml from source and recompiled aapt but that needs more work as I got errors with resources for some reason. So I push AndroidManifest via a script for meanwhile :)

Thanks for your help !
[Android Software Development] georgcmef:
I got some screen caps of the exact error.

First I decompile the apk then i try and build it without changing a thing.

Decompile

build1

build 2
[Android Software Development] :
Seems like there is an opening or close that is either missing or too much

< > or </> or maybe double of a settings style that is double
[Android Software Development] MattMatt0240:
Hey [MENTION=3924617]iBotPeaches[/MENTION], or anyone else quite knowledgeable on the matter of the resource qualifiers being added when decompiling (layout-v14,etc...)

I just downloaded this tool again today, decompiled SystemUI from a lollipop ROM, made some edits, recompiled and rebooted the ROM. I did notice a bunch of unnecessary resource qualifiers in the app's package (v-4 qualifier in a lollipop ROM, doubtful). SystemUI was not present/showing (but was not force closing, weird)

Anyway, if we delete these unnecessary resource qualifiers (v-4,etc.. only, not the folder itself) before recompiling, should the apk be OK to use in theory? Or is the bug within recompiling also?

Regardless, thank you for this amazing tool! You're work is greatly appreciated!
[Android Software Development] georgcmef:
Did you try and see if you got the same errors from the apk that I posted earlier?
[Android Software Development] Josephigloe:
Can someone please help me install apktool on my laptop
[Android Software Development] Vivek_Neel:
There are several guides on the internet. You need to make use of it. :)