Skip to content
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

[core] Decompilation res, the style have no parent info. #931

Closed
weimings opened this issue May 13, 2020 · 15 comments
Closed

[core] Decompilation res, the style have no parent info. #931

weimings opened this issue May 13, 2020 · 15 comments
Labels
bug Core Issues in jadx-core module

Comments

@weimings
Copy link

weimings commented May 13, 2020

Decompilation res, open values/styles.xml, the style have no parent info.
Like

<style name="CustomizableHomeTheme" parent="@android:style/Theme.DeviceDefault">

use apktool_2.4.1.jar to decompilation the apk , the parent is complete, use jadx, only have

<style name="CustomizableHomeTheme">

I find some drawable by xml is lost.

@weimings weimings added Core Issues in jadx-core module bug labels May 13, 2020
@jpstotz
Copy link
Collaborator

jpstotz commented May 13, 2020

Have you already tried the latest unstable version of Jadx?
Can you please provide the APK file this problem occurs?

@weimings
Copy link
Author

weimings commented May 13, 2020

Have you already tried the latest unstable version of Jadx?
Can you please provide the APK file this problem occurs?

I was already pull the the latest unstable version, build it by idea and tried it.
https://apkpure.com/wear-os-by-google-smartwatch-was-android-wear/com.google.android.wearable.app

I use jadx, open resources.arsc/values/styles.xml , AboutTheme is

<style name="AboutTheme">
     <item name="android:textColor">@color/google_black</item>
</style>

use apktool_2.4.1.jar, AboutTheme is

<style name="AboutTheme" parent="@style/Theme.AppCompat.Light">
        <item name="android:textColor">@color/google_black</item>
</style>

@jpstotz
Copy link
Collaborator

jpstotz commented May 13, 2020

Sorry, but at the moment Jadx does not consider the ResourceEntry.parentRef data for generating those values.

@weimings
Copy link
Author

Sorry, but at the moment Jadx does not consider the ResourceEntry.parentRef data for generating those values.

Please explain this problem in the readme, it can reduce misleading users.

@jpstotz
Copy link
Collaborator

jpstotz commented May 13, 2020

@weimings Sorry but I am too lazy for that. Writing a few lines of code that add generation of parent attribute to Jadx is easier ;)

@skylot
Copy link
Owner

skylot commented May 13, 2020

@weimings this issue is fixed in PR #933 by @jpstotz.
Please check the latest unstable build.

@skylot skylot closed this as completed May 13, 2020
@weimings
Copy link
Author

weimings commented May 14, 2020

@weimings Sorry but I am too lazy for that. Writing a few lines of code that add generation of parent attribute to Jadx is easier ;)

@skylot

Thanks, I will try this patch.
But I decompilation the ClockworkHomeGoogleLocalEdition.apk(com.google.android.wearable.app )pull from xiaomi watch, found res/drawable/list_divider.xml was lost.

The apk in this zip, zip pwd is 123.
com.google.android.wearable.app.zip

@jpstotz
Copy link
Collaborator

jpstotz commented May 14, 2020

@weimings I am sorry but the posted APK has no drawables subdirectory unter /res, hence Jadx can not display such a section.

Just open it with a ZIP utility and see it yourself.

@weimings
Copy link
Author

@weimings I am sorry but the posted APK has no drawables subdirectory unter /res, hence Jadx can not display such a section.

Just open it with a ZIP utility and see it yourself.

There should be a part of res in resources.arsc.
I decompilation the ClockworkHomeGoogleLocalEdition.apk use apktool_2.4.1.jar, The complete drawables can be found.
You can verify this using apktool_2.4.1.jar.

@jpstotz
Copy link
Collaborator

jpstotz commented May 14, 2020

Apktool seems to use a special algorithm of re-generating the different subdirectories located in /res within the APK file.
In difference Jadx just displays the content as it is.

Hence this is not a bug in Jadx but a special feature of apktool. From my perspective the focus of Jadx is on decompiling the code and not the resources.
Therefore I don't think we will try to re-implement the resource re-generating feature as implemented in apktool.

If someone wants to do so feel free. apktool and Jadx aber both open source projects under Apache 2 license.

@weimings
Copy link
Author

Apktool seems to use a special algorithm of re-generating the different subdirectories located in /res within the APK file.
In difference Jadx just displays the content as it is.

Hence this is not a bug in Jadx but a special feature of apktool. From my perspective the focus of Jadx is on decompiling the code and not the resources.
Therefore I don't think we will try to re-implement the resource re-generating feature as implemented in apktool.

If someone wants to do so feel free. apktool and Jadx aber both open source projects under Apache 2 license.

Okay, understand this, thank you. Then please explain in the readme, otherwise some users will waste a lot of investigation time without knowing this. like me...

@jpstotz
Copy link
Collaborator

jpstotz commented May 15, 2020

@weimings Sorry to hear that you lost so much time, but even after this lengthy discussion I still don't understand what you are aiming for. If you are looking for some feature(s) in particular and the readme does not state anything about it may be the next time you could simply ask.
Regarding the text for the readme, I find it rather difficult to write a text as I am not sure what you expect.

May be it would be better if you could you please provide such a text?

@weimings
Copy link
Author

@weimings Sorry to hear that you lost so much time, but even after this lengthy discussion I still don't understand what you are aiming for. If you are looking for some feature(s) in particular and the readme does not state anything about it may be the next time you could simply ask.
Regarding the text for the readme, I find it rather difficult to write a text as I am not sure what you expect.

May be it would be better if you could you please provide such a text?

The README.md In jadx say "decode AndroidManifest.xml and other resources from resources.arsc", but not all resources from resources.arsc.
I think use 'a part of resources from resources.arsc' is better.
Thank you.

@jpstotz
Copy link
Collaborator

jpstotz commented May 18, 2020

@weimings Sorry but I can't include your proposed text because it contains two major errors:

  1. The resources that you see in the apktool decompilation are not included in resources.arsc. If I am not mistaken Jadx completely decompiles all values* entries from resources.arsc. The resources you don't see are from the APK itself. Those resources are included as individual files.

  2. Jadx decompiles all resources, the only difference between apktool and Jadx is the naming of the files. For example the resource you were searching is decompiled by apktool to the name res/drawable/list_divider.xml. In Jadx the original file name as it is defined in the APK file is used: res/3G.xml.

@weimings
Copy link
Author

@weimings Sorry but I can't include your proposed text because it contains two major errors:

  1. The resources that you see in the apktool decompilation are not included in resources.arsc. If I am not mistaken Jadx completely decompiles all values* entries from resources.arsc. The resources you don't see are from the APK itself. Those resources are included as individual files.
  2. Jadx decompiles all resources, the only difference between apktool and Jadx is the naming of the files. For example the resource you were searching is decompiled by apktool to the name res/drawable/list_divider.xml. In Jadx the original file name as it is defined in the APK file is used: res/3G.xml.

OK, Thanks for your answers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Core Issues in jadx-core module
Projects
None yet
Development

No branches or pull requests

3 participants