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

[BUG]baksmali repack output jar failed to verify #3735

Open
wcedla opened this issue Nov 27, 2024 · 1 comment
Open

[BUG]baksmali repack output jar failed to verify #3735

wcedla opened this issue Nov 27, 2024 · 1 comment

Comments

@wcedla
Copy link

wcedla commented Nov 27, 2024

Information

  1. Apktool Version (apktool -version) - 2.10.1-dirty
  2. Operating System (Mac, Linux, Windows) - Windows
  3. APK From? (Playstore, ROM, Other) - ROM
  4. Java Version (java --version) - 17.0.9

Stacktrace/Logcat

it's dex2oat64 logcat output of baksmali services.jar with apktool 2.10.1-dirty

method_verifier.cc:5114] Verification error in boolean com.android.server.BinaryTransparencyService$Digest.equals(java.lang.Object)

method_verifier.cc:5114] boolean com.android.server.BinaryTransparencyService$Digest.equals(java.lang.Object) failed to verify: boolean com.android.server.BinaryTransparencyService$Digest.equals(java.lang.Object): [0x0] invalid argument count (2) exceeds outsSize (0)

method_verifier.cc:5114] Verification error in int com.android.server.BinaryTransparencyService$Digest.hashCode()

method_verifier.cc:5114] int com.android.server.BinaryTransparencyService$Digest.hashCode() failed to verify: int com.android.server.BinaryTransparencyService$Digest.hashCode(): [0x0] invalid argument count (1) exceeds outsSize (0)

method_verifier.cc:5114] Verification error in java.lang.String com.android.server.BinaryTransparencyService$Digest.toString()

method_verifier.cc:5114] java.lang.String com.android.server.BinaryTransparencyService$Digest.toString() failed to verify: java.lang.String com.android.server.BinaryTransparencyService$Digest.toString(): [0x0] invalid argument count (1) exceeds outsSize (0)

compiler_driver.cc:903] Had a hard failure verifying all classes, and was asked to abort in such situations. Please check the log.
                                                                                                    

Steps to Reproduce

  1. apktool d -r ./services.jar
  2. apktool b -r ./services.jar.out
  3. adb shell dex2oat64 --abort-on-hard-verifier-error --no-abort-on-soft-verifier-error --compilation-reason=prebuilt --instruction-set=arm64 --instruction-set-features=default --instruction-set-variant=generic --dex-file=/data/local/tmp/3/services.jar(location of source jar) --boot-image=/data/misc/apexdata/com.android.art/dalvik-cache/boot.art:/data/misc/apexdata/com.android.art/dalvik-cache/boot-framework-adservices.art --oat-file=/data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@[email protected]@classes.odex(output oat target location) --app-image-file=/data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@[email protected]@classes.art(output image target location) --profile-file=/system/framework/services.jar.prof --compiler-filter=speed-profile

dex2oat will first to verify dex file and if add args of ''--abort-on-hard-verifier-error --no-abort-on-soft-verifier-error" that will throw exception

the source of verify failed code location is https://cs.android.com/android/platform/superproject/main/+/main:frameworks/base/services/core/java/com/android/server/BinaryTransparencyService.java;l=1710;drc=999a4bd19623527972619f517f408252762bbde5;bpv=1;bpt=1

it is a record of java

the services.jar pull from Android15 ROM which is ColorOS 15.0

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)

use the default one

APK

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

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, but it does't matter
  3. Are you using the latest apktool version? -yeah ,even the dirty version,but it is alse failed to verify
@wcedla
Copy link
Author

wcedla commented Nov 27, 2024

relate to this issue google/smali#79

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

1 participant