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

Can't decompil Samsung Browser apk ( error in ASSET : Not a valid dex magic value) #2239

Closed
edzamber opened this issue Nov 25, 2019 · 3 comments

Comments

@edzamber
Copy link

Information

  1. **Apktool Version (apktool -version) Apktool 2.4.1-SNAPSHOT
  2. **Operating System (Mac, Linux, Windows) Windows
  3. **APK From? (Playstore, ROM, Other) ApkMirror

Stacktrace/Logcat

--------------------------------------------------
Batch ApkTool DONATE         : 3.7.7
APKTOOL                      : apktool-2.4.1-b05f19b-SNAPSHOT.jar
Mode expert                  : NO
Signature                    : OUI
--------------------------------------------------

[*] Réglage du cadre AOSP_10.0_API29_framework-res.apk
I: Framework installed to: bin\framework\1.apk

[*] Décompilation SBrowser_11.0.00.73.apk
I: Using Apktool 2.4.1-SNAPSHOT on SBrowser_11.0.00.73.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: bin\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Cant find 9patch chunk in file: "drawable/sesl_action_bar_background_divider_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/sesl_toast_frame_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/sesl_tab_n_badge_mtrl.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/sesl_btn_switch_mtrl.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-desk-mdpi-v8/sesl_btn_switch_mtrl.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/sesl_btn_switch_mtrl.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/sesl_index_bar_bg.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/sesl_index_bar_bg.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/sesl_switch_track_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/sesl_spinner_picker_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/sesl_toast_frame_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxxhdpi-v4/sesl_spinner_picker_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xhdpi-v4/sesl_spinner_picker_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/sesl_btn_switch_mtrl.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/sesl_switch_track_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-tvdpi-v4/sesl_btn_switch_mtrl.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-hdpi-v4/sesl_switch_track_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-mdpi-v4/sesl_btn_switch_mtrl.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable-xxhdpi-v4/sesl_toast_frame_alpha.9.png". Renaming it to *.png.
W: Cant find 9patch chunk in file: "drawable/sesl_section_divider_default_alpha.9.png". Renaming it to *.png.
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Baksmaling classes2.dex...
I: Baksmaling assets/A3AEECD8.dex...
Exception in thread "main" org.jf.dexlib2.dexbacked.DexBackedDexFile$NotADexFile: Not a valid dex magic value: cf 77 4c c7 9b 21 01 cd
	at org.jf.dexlib2.util.DexUtil.verifyDexHeader(DexUtil.java:93)
	at org.jf.dexlib2.dexbacked.DexBackedDexFile.getVersion(DexBackedDexFile.java:111)
	at org.jf.dexlib2.dexbacked.DexBackedDexFile.<init>(DexBackedDexFile.java:78)
	at org.jf.dexlib2.dexbacked.DexBackedDexFile.<init>(DexBackedDexFile.java:138)
	at org.jf.dexlib2.dexbacked.ZipDexContainer$1.getDexFile(ZipDexContainer.java:181)
	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:90)
	at brut.androlib.src.SmaliDecoder.decode(SmaliDecoder.java:39)
	at brut.androlib.Androlib.decodeSourcesSmali(Androlib.java:96)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:164)
	at brut.apktool.Main.cmdDecode(Main.java:170)
	at brut.apktool.Main.main(Main.java:76)
[*] ---> Erreur décompilation SBrowser_11.0.00.73.apk

Steps to Reproduce

  1. apktool

Frameworks

If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files
(.apks that live in /system/framework or /system/priv-app)

AOSP_10.0_API29_framework-res.apk
http://www.mediafire.com/file/9q8ndvsupk6cs3u/AOSP_10.0_API29_framework-res.apk.apk/file

APK

SBrowser_11.0.00.73.apk
https://www.apkmirror.com/apk/samsung-electronics-co-ltd/samsung-internet-for-android/samsung-internet-for-android-11-0-00-73-release/samsung-internet-browser-11-0-00-73-android-apk-download/

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? No its original one
  3. Are you using the latest apktool version? Yes
@realityJie
Copy link

This is not a bug in apktool. In fact, A3AEECD8.dex is not a standard dex file. Please see the command below.

$ file classes.dex
classes.dex: Dalvik dex file version 035
$ file assets/A3AEECD8.dex
assets/A3AEECD8.dex: data

You can use apktool d --only-main-classes to salve the problem. But if you get an error:Unrecognized option: --only-main-classes, you can see #2226

@edzamber
Copy link
Author

Ok ! Many thanks, i will try to decompil only main classes

@iBotPeaches
Copy link
Owner

As mentioned above. The system is looking for .dex files and not finding one, so the param - --only-main-classes will isolate the search to only dex files in the root.

Closing as not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants