Code Monkey home page Code Monkey logo

Comments (8)

shroudedcode avatar shroudedcode commented on May 20, 2024

This error seems to be caused by Apktool which apk-mitm is based on. To narrow down the issue you could try manually decoding and re-encoding the APK without making any changes. For that, you can use the jar/apktool.jar file bundled with apk-mitm:

# Decode to "decoded" directory
java -jar ./apktool.jar decode android.apk --output decoded

# Re-encode to "android-reencoded.apk"
java -jar ./apktool.jar build decoded --output android-reencoded.apk

If that fails the issue is probably not something I can fix but rather an issue with Apktool or a mistake/oddity in TikTok's source code.

from apk-mitm.

54696d21 avatar 54696d21 commented on May 20, 2024

Thank you very much, there's also an error when reencoding the apk file with just using apktool

from apk-mitm.

shroudedcode avatar shroudedcode commented on May 20, 2024

I found multiple issues related to the Syntax error: "(" unexpected error you're getting on the Apktool repository. Two of them (#974 and #2092) are related to the ARM CPU architecture used by Raspberry Pi's. AAPT which is used by Apktool doesn't seem to work on ARM, so you can't use Apktool or apk-mitm on your Raspberry Pi.

This makes me wonder: Are you getting the same error or a different one on your Arch installation?

from apk-mitm.

54696d21 avatar 54696d21 commented on May 20, 2024

I'll try it running it on arch x64 again. It's weird that apktool is in the repository for raspbian...

from apk-mitm.

shroudedcode avatar shroudedcode commented on May 20, 2024

It's weird that apktool is in the repository for raspbian...

That is weird. Maybe that package is built using a patched version of AAPT or it used to work and just doesn't anymore.

from apk-mitm.

54696d21 avatar 54696d21 commented on May 20, 2024

the raspbian version an older one (i think it was before 2.4) but decompiling works fine

and yeah doesn't work on x64 either

maybe its worth trying build for another sdk version?

 java -jar apktool_2.4.1.jar  build decoded --output reencoded.apk
I: Using Apktool 2.4.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes4 folder into classes4.dex...
I: Checking whether sources has changed...
I: Smaling smali_assets folder into assets.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes6 folder into classes6.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes2 folder into classes2.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes3 folder into classes3.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes7 folder into classes7.dex...
I: Checking whether sources has changed...
I: Smaling smali_classes5 folder into classes5.dex...
I: Checking whether resources has changed...
I: Building resources...
W: /home/marc/androidDecomp/decoded/res/values-v21/styles.xml:269: error: Resource entry j6 already has bag item android:windowContentTransitions.
W: /home/marc/androidDecomp/decoded/res/values-v21/styles.xml:268: Originally defined here.
W: 
brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [/tmp/brut_util_Jar_10373368146805472863.tmp, p, --forced-package-id, 127, --min-sdk-version, 16, --target-sdk-version, 28, --version-code, 2021407050, --version-name, 14.7.5, --no-version-vectors, -F, /tmp/APKTOOL14351557212148640520.tmp, -e, /tmp/APKTOOL6742344768126141054.tmp, -0, arsc, -I, /home/marc/.local/share/apktool/framework/1.apk, -S, /home/marc/androidDecomp/decoded/res, -M, /home/marc/androidDecomp/decoded/AndroidManifest.xml]

from apk-mitm.

54696d21 avatar 54696d21 commented on May 20, 2024

Ok the sdk version thing i suggested makes no sense. I guess the issue can be closed. Thank you very much :)

from apk-mitm.

shroudedcode avatar shroudedcode commented on May 20, 2024

No problem! Sorry I couldn't be more helpful here, but unfortunately there's not much I can do if Apktool can't decode or encode a certain APK. There's some issues about this Resource entry already has bag item error on the Apktool repository, so I'd recommend taking a look at those and up-voting the ones matching your problem. Maybe someone has even found a way to solve this problem.

from apk-mitm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.