iBotPeaches / Apktool

A tool for reverse engineering Android apk files

Home Page:https://apktool.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"error: expected enum but got (raw string) 1"

danwie opened this issue · comments

Information

  1. Apktool Version (apktool -version) - 2.9.3
  2. Operating System (Mac, Linux, Windows) - Mac M2
  3. APK From? (Playstore, ROM, Other) - apkmirror
  4. Java Version (java --version) - openjdk version "21.0.2" 2024-01-16

Steps to Reproduce

  1. docker-apktool d TGTG.apk
  2. apktool b TGTG --output app-rebuilt.apk

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? Yes
  2. If you are trying to install a modified apk, did you resign it? -
  3. Are you using the latest apktool version? Yes

I: Using Apktool 2.9.3
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether sources has changed...
I: Checking whether resources has changed...
I: Building resources...
W: /app/TGTG/res/values/styles.xml:2547: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:5555: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values-sw600dp/styles.xml:12: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values-land/styles.xml:5: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:5645: error: expected enum but got (raw string) 0.
W: /app/TGTG/res/values/styles.xml:5664: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:5684: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:5685: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:6653: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:6872: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:6908: error: expected enum but got (raw string) 1.
W: /app/TGTG/res/values/styles.xml:7365: error: expected enum but got (raw string) 0.
W: error: failed linking references.
brut.androlib.exceptions.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_132557887244562082114228759021717579024.tmp, link, -o, /tmp/APKTOOL6895118649898423389.tmp, --package-id, 127, --min-sdk-version, 21, --target-sdk-version, 33, --version-code, 19021, --version-name, 24.4.11, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, --allow-reserved-package-id, --no-compile-sdk-metadata, --warn-manifest-validation, -e, /tmp/APKTOOL5301612863180157323.tmp, -0, arsc, -I, /root/.local/share/apktool/framework/1.apk, --manifest, /app/TGTG/AndroidManifest.xml, /app/TGTG/build/resources.zip]

My Macbook Pro have M2 chip. I think this equals ARM processor? I have also tried running latest version of apktool in a docker container on my Mac using amazoncorretto:22-alpine-jdk, but it gives the same errors as above.

The only thing I need is to replace the app's Network Security Configuration to allow user-added certificates so that I can inspect the HTTPS traffic using a proxy. I have also tried using apk-mitm directly, but it also gives the same errors.

Not sure how to proceed.

This is a new issue I am trying to figure out how to resolve - don't have a good answer yet. Newer tools are stripping values (ie enums to scalars) for performance reasons. However, Apktool then loses all knowledge of that type, which is then needed when you want to re-assemble.

There is a known issue for this - #3534

Thanks for report - closing.