Apktool icon indicating copy to clipboard operation
Apktool copied to clipboard

[BUG] Doesn't decompile api32 framework

Open pashamcr opened this issue 3 years ago • 5 comments

Information

  1. Apktool Version (apktool -version) - 2.6.2-fc28ac-SNAPSHOT
  2. Operating System (Mac, Linux, Windows) - win
  3. APK From? (Playstore, ROM, Other) - Android SDK (Sdk\platforms\android-32\android.jar)

Stacktrace/Logcat

all ok

Steps to Reproduce

  1. apktool d android_32.apk

APK

If this APK can be freely shared, please upload/attach a link to it. android.zip

Something is wrong. In the res folder, there are only three files: values\attrs.xml values\ids.xml values\public.xml :

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <public type="id" name="accessibilityActionDragStart" id="0x01fe0000" />
    <public type="id" name="accessibilityActionDragDrop" id="0x01fe0001" />
    <public type="id" name="accessibilityActionDragCancel" id="0x01fe0002" />
    <public type="attr" name="shouldUseDefaultUnfoldTransition" id="0x01ff0000" />
</resources>

in the log is:

I: Skipping staged alias stagedId (1fe0000) finalId: 1020055
I: Skipping staged alias stagedId (1fe0001) finalId: 1020056
I: Skipping staged alias stagedId (1fe0002) finalId: 1020057
I: Skipping staged alias stagedId (1ff0000) finalId: 101064c

pashamcr avatar Mar 21 '22 19:03 pashamcr

That does appear to be an issue.

iBotPeaches avatar Mar 21 '22 20:03 iBotPeaches

well actually, this may be right. Just too much verbose output. What if those resources are actually staged aliases because of API 32 not yet finalized?

iBotPeaches avatar Mar 21 '22 20:03 iBotPeaches

@iBotPeaches decompiling the next version of the framework api Sdk\platforms\android-Tiramisu\android.jar is ok, the res folder is full (39mb), the log is the same as before. Used BATCH APKTOOL:

[*] Info:
file: android_t.apk
package: name='android' versionCode='32' versionName='Tiramisu'
sdkVersion:'Tiramisu'
targetSdkVersion:'Tiramisu'
…………………………………………………………………………………………………………………………………… 
I: Using Apktool 2.6.2-fc28ac-SNAPSHOT on android_t.apk
I: Loading resource table...
I: Skipping staged alias stagedId (1fe0000) finalId: 1020055
I: Skipping staged alias stagedId (1fe0001) finalId: 1020056
I: Skipping staged alias stagedId (1fe0002) finalId: 1020057
I: Skipping staged alias stagedId (1ff0000) finalId: 101064c
I: Decoding AndroidManifest.xml with resources...
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

android_tiramisu.zip

pashamcr avatar Mar 21 '22 21:03 pashamcr

well actually, this may be right. Just too much verbose output. What if those resources are actually staged aliases because of API 32 not yet finalized?

It's not about that. While looking at the log, I didn't pay attention to W: Skipping package group: android. This suggests that you need to add support for multi-package resources. ...if removed:

            case 1:
                pkg = pkgs[0];
                break;
            case 2:
                LOGGER.warning("Skipping package group: " + pkgs[0].getName());
                pkg = pkgs[1];
                break;

normally decoded

pashamcr avatar Mar 26 '22 06:03 pashamcr

Okay, if thats the only thing remaining. I believe thats covered in #2514 (for the multi-package support)

iBotPeaches avatar Mar 28 '22 11:03 iBotPeaches

Closing as the only thing left is multi-package support in https://github.com/iBotPeaches/Apktool/issues/2960 or #2514

iBotPeaches avatar Jul 04 '23 20:07 iBotPeaches