-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apktool and dummy values (once for all) #2104
Comments
Same issue @iBotPeaches |
I'm dealing with that same problem. |
any solutions? |
This issue is finally fixed, and the fix merged, thanks to iBotPeaches. Issue #2439 explains it all. I tested it today using apktool v2.5.0 on the framework-res file above. The style.xml file contained some double lines that caused a bit of trouble.
Once corrected, I faced another issue regarding one dummy value.
The issue:
As said in issue #2439, the fix is to "set dummy attributes to same type (@null)"
I recompiled the apk without any issue, so in short, apktool v2.5.0 fixed the dummy value "bug", and if you run into another error like mine, the solution is to modify it manually and set a value to is (@null) I used the default aapt to do that (aapt1), I got errors using aapt2. This is explained in issue #2438. I'll leave this issue opened if I run into other issues regarding dummy values, but I consider this issue for the major part solved by apktool 2.5.0. Have a good day everybody ;) |
I took a look at this and some things don't seem perfect to me yet. A dummy resource should automatically become null, since its not Dimensions must have some special behavior I need to dig into. The duplicate styles don't make much sense since I only see one in the resources.arsc, so a decoding mess to investigate. |
Going to close this as I resolved the last thing mentioned in my 2 year old comment.
In the upcoming 2.8.2 release we have a few changes that made this resolved:
These combined lead to the above demo with 0 manual changes. I believe this is fully resolved with the upcoming release. |
Information
apktool-2.4.0
) and (apktool-2.3.2
)Stacktrace/Logcat (with aapt2)
Stacktrace/Logcat (without aapt2)
--> Full log: https://pastebin.com/tRZUVCe3
Steps to Reproduce
-
apktool d framework-res.apk
-
apktool b framework-res
(to have the looooong stacktrace)-
apktool d framework-res.apk
-
apktool b --use-aapt2 framework-res
(to have the shorter and more explicite stacktrace)Frameworks
This framework-res.apk (that I try to decompile) is from a ROM (Evolution X 2.0) , I did install it with the command "apktool if framework-res.apk". I also installed the SystemUI.apk using "apktool if SystemUI.apk".
APKs
I don't know if those can be shared freely (I think so tho, since it's out of an open source ROM)
Here you go:
Framework-res and SystemUI.zip
Questions to ask before submission
apktool d
,apktool b
without changing anything?That what I'm doing in order to have this issue.
No, I'm not trying to install it (since I can't recompile it).
I used both 2.4.0 and 2.3.2 but I got the same output from both, so I chosed to pick the 2.3.2 version.
Important Note:
I know that this issue has been reported a lot already, it looks like (in my case) this issue occurs with framework-res.apk files. But you'll see in the details that it's not only my case, so I made a really detailed bug description in order to fix the problem or to report it properly once for all (don't mean to represent every single bug of this kind, but a kind of at the same time).
List of similar issues with dummy values
-#252
-#2095
-#1773
Details, Please Read
So, this is a long story.
I used to decompile framework-res.apk (from LOS Nougat) from multiple ROMs 1 year ago using my Ubuntu desktop. It worked perfectly at that time, but I don't remember which version of apktool I was using (maybe 2.2.4). Since them I didn't used apktool for about a solid 10 months, and one month ago I decided to theme the framework-res.apk of a ROM to enable Ambiant Display Gestures on it.
I installed the framework-res.apk as well as the SystemUI.apk using
apktool if ...
commands.I'm used apktool 2.4.0. I first decompiled the apk with
apktool d framework-res.apk
, modified it and tried to recompile it (apktool b framework-res.apk -c
). It didn't worked.Then I just decompiled/recompiled the apk with the -c mark. Still Didn't wanted to work. I decided to check if java was set the wrong way, but everything was correct on this side. So, java isn't the problem.
Then I tried to decompile/recompile with aapt2:
apktool b --use-aapt2 framework-res
The output and the duration of the recompiling process were different, but still an error. At least I had something to start with: the stacktrace pointed me some lines at the end of the attrs.xml file. So I headed to the lines and I saw this
<item type="attr" name="APKTOOL_DUMMY_428">false</item>
.I googled "apktool dummy" and I found the apktool bugtracker with other issues related to those "apktool dummy" things.
I learnt that APKTOOL_DUMMY_... were the names given to unread values, values that apktool can't read, most of the time because the apk file was corrupted.
But I knew to that my framework-res.apk file wasn't corrupted because it ran without any problems on the ROM I use. Then I tryed to decompile/recompile a third party app (XDA Labs) but no problem this time. I tried then to decompile the framework-res.apk file that I used to decompile when I was on Linux (the LOS Nougat one) but same error: APKTOOL_DUMMY_... at the exact same lines that in the framework-res.apk file from Android Pie.
So I thought apktool 2.4.0 was buggy, and I tried with apktool 2.3.2 but same results (as you can see). So I then tested with apktool 2.2.4 and this time , dummy values weren't located at the same place, but still there. BBUUTT apktool 2.2.4 managed somehow to recompile it.
Soooo, I thought the problem was comming from my PC, that's why I asked to a recognized contributor from xda (tulsadiver) to do it for me : https://forum.xda-developers.com/showpost.php?p=79706547&postcount=7755
In the decompressed apk he gave me, those dummy values were still here at the same place.
As a consequence I couldn't recompile the folder.
My last attemp before posting here was to remove the dummy values knowing that those values are here to fill the whole left by untrancripted values. It didn't worked too, that why I'm here.
If you have even any clues on what I could do, or if the problem is really related to apktool, please let me know down below.
(Update:21-12-2020)This issue is finaly solved!
I made a comment explaining it, here it is: #2104 (comment) .
To make it short the issue was fixed in apktool v2.5.0, I still ran into some errors regarding dummy values, but they're easy to solve. This works using aapt1
The text was updated successfully, but these errors were encountered: