iBotPeaches/Apktool

Apktool Generates Invalid Smali Code from Meitu APK

Closed this issue · 3 comments

Information

  1. Apktool Version (apktool -version) -
    $ apktool --version
    2.6.0

  2. Operating System (Mac, Linux, Windows) -
    $ cat /etc/issue
    Ubuntu 18.04.6 LTS \n \l

  3. APK From? (Playstore, ROM, Other) -
    Meitu Photo Editor obtained from APKMirror (a copy is NOT attached since github won't allow .apk files)
    https://www.apkmirror.com/apk/meitu/meitu-beauty-camera-selfie-drawing-photo-editor/meitu-beauty-camera-selfie-drawing-photo-editor-9-3-6-8-release/

Stacktrace/Logcat

No relevant stracktrace

Steps to Reproduce

  1. apktool d meitu.apk

  2. open ./meitu/smali_classes4/com/meitu/library/mtmediakit/widget/GestureScissorView.smali

  3. Observe the method .method private d(FF)Landroid/graphics/PointF;
    (line 1121)

  4. Observe the first few instructions which instantiate two 32-bit constants and then attempt to execute an invalid aget-object using them.

    .locals 12

    const/4 v6, 0x0`

    const/4 v7, 0x0

    .line 372
    aget-object v1, v6, v7

    const/4 v8, 0x1

It seems to me that this short sequence of instructions cannot be valid. Am I missing something?

Frameworks

N/A I believe

APK

If this APK can be freely shared, please upload/attach a link to it.
https://www.apkmirror.com/apk/meitu/meitu-beauty-camera-selfie-drawing-photo-editor/meitu-beauty-camera-selfie-drawing-photo-editor-9-3-6-8-release/

Version 9.3.6.8
I found this bug with the apk. I didn't test the bundle.

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? Not relevant, but yes I can/do re-sign it
  3. Are you using the latest apktool version? I believe so, yes.

This might be better suited in smali if you believe an issue in the generated instructions - https://github.com/JesusFreke/smali

@fmresearchnovak report the bug also to Google, their Android Studio shows the same thing изображение

Snap1

Closing this for an upstream issue in smali / aosp. There is nothing Apktool can do here sadly and my knowledge set is not strong enough to push an upstream fix either :/

https://github.com/JesusFreke/smali