ReVanced / revanced-patches

🧩 Patches for ReVanced
https://revanced.app
GNU General Public License v3.0
2.25k stars 261 forks source link

bug: Patch always error `Exception in thread "main" java.lang.IncompatibleClassChangeError:` #307

Closed cyberboh closed 12 months ago

cyberboh commented 12 months ago

Type

Error while patching

Bug description

Patch Tumblr (or any supported apps) with dev-branch of patches and integrations using CLI

Steps to reproduce

  1. Download app (e.g tumblr) : https://www.apkmirror.com/apk/tumblr-inc/tumblr/tumblr-31-3-0-110-release/tumblr-fandom-art-chaos-31-3-0-110-android-apk-download/
  2. Patch with CLI: java -jar revanced-cli-3.1.1-all.jar patch Tumblr_31.3.0.110.apk -r %temp%\revanced-cache -p -o Install\Tumblr_ReVanced_31.3.0.110.apk -b revanced-patches-2.191.0-dev.6.jar --keystore=ks.keystore -m revanced-integrations-0.118.0-dev.4.apk
  3. The error appear

Relevant log output

java -jar revanced-cli-3.1.1-all.jar patch Tumblr_31.3.0.110.apk -r %temp%\revanced-cache -p -o Install\Tumblr_ReVanced_31.3.0.110.apk -b revanced-patches-2.191.0-dev.6.jar --keystore=ks.keystore -m revanced-integrations-0.118.0-dev.4.apk
INFO: Loading patches
Exception in thread "main" java.lang.IncompatibleClassChangeError: class app.revanced.patches.spotify.layout.theme.CustomThemePatchGenerated has interface app.revanced.patcher.patch.ResourcePatch as super class
        at java.base/java.lang.ClassLoader.defineClass1(Native Method)
        at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1013)
        at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:150)
        at java.base/java.net.URLClassLoader.defineClass(URLClassLoader.java:524)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:427)
        at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:421)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:714)
        at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:420)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        at app.revanced.patcher.PatchBundleLoader$Jar$2$1$3.invoke(PatchBundleLoader.kt:50)
        at app.revanced.patcher.PatchBundleLoader$Jar$2$1$3.invoke(PatchBundleLoader.kt:50)
        at kotlin.sequences.TransformingSequence$iterator$1.next(Sequences.kt:210)
        at kotlin.collections.CollectionsKt__MutableCollectionsKt.addAll(MutableCollections.kt:129)
        at app.revanced.patcher.PatchBundleLoader$Jar.<init>(PatchBundleLoader.kt:84)
        at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:157)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:40)

Screenshots or videos

No response

Solution

The issue could be caused by version is null in patches.json See https://github.com/ReVanced/revanced-patches/releases/download/v2.191.0-dev.6/patches.json

Additional context

patches v2.191.0-dev.6 integrations v0.118.0-dev.4 cli v3.1.1

Acknowledgements

oSumAtrIX commented 12 months ago

You are using dev releases, not stable.

cyberboh commented 12 months ago

You are using dev releases, not stable.

i want to test new patches which meant new features with new version of patches.

oSumAtrIX commented 12 months ago

If you want to test dev patches, you will need dev cli

cyberboh commented 12 months ago

ooh thats makes sense, i'll try :)

cyberboh commented 12 months ago

If you want to test dev patches, you will need dev cli

error at aligning:

java -jar revanced-cli-4.0.0-dev.1-all.jar patch Tumblr_31.3.0.110.apk -r %temp%\revanced-cache -p -o Install\Tumblr_ReVanced_31.3.0.110.apk -b revanced-patches-2.191.0-dev.6.jar --keystore=ks.keystore -m revanced-integrations-0.118.0-dev.4.apk
INFO: Loading patches
INFO: Setting patch options
INFO: Decoding app manifest
INFO: Remove screen capture restriction excluded
INFO: Remove screenshot restriction excluded
INFO: Export all activities excluded
INFO: Spoof Wi-Fi connection excluded
INFO: Predictive back gesture excluded
INFO: Override certificate pinning excluded
INFO: Enable Android debugging excluded
INFO: Change package name excluded
INFO: Merging integrations
INFO: Executing patches
INFO: Disable Tumblr Live succeeded
INFO: Disable blog notification reminder succeeded
INFO: Disable dashboard ads succeeded
INFO: Disable gift message popup succeeded
INFO: Compiling modified dex files
INFO: Aligning Tumblr_31.3.0.110.apk
java.io.FileNotFoundException: %Temp%\revanced-cache\Tumblr_31.3.0.110.apk (The system cannot find the file specified)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:346)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:260)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:214)
        at app.revanced.library.zip.ZipFile.<init>(ZipFile.kt:16)
        at app.revanced.library.ApkUtils.copyAligned(ApkUtils.kt:30)
        at app.revanced.cli.command.PatchCommand.run(PatchCommand.kt:240)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2026)
        at picocli.CommandLine.access$1500(CommandLine.java:148)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2461)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2453)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2415)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2273)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2417)
        at picocli.CommandLine.execute(CommandLine.java:2170)
        at app.revanced.cli.command.MainCommandKt.main(MainCommand.kt:13)
oSumAtrIX commented 12 months ago

https://github.com/ReVanced/revanced-library/issues/4

cyberboh commented 12 months ago

ReVanced/revanced-library#4

i thought it resolved in dev cli 4.0.0-dev.1, bcs he mentioned the version of cli revanced-cli-4.0.0-dev.4-all.jar i'll wait then