ReVanced / revanced-patches

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

bug: Check environment patch fails on Android 8 #3654

Closed oSumAtrIX closed 1 month ago

oSumAtrIX commented 1 month ago

Bug description

Check environment patch fails. See log below.

Error logs

An error occurred:
java.lang.NoSuchFieldError: No static field ODM_SKU of type Ljava/lang/String; in class Landroid/os/Build; or its superclasses (declaration of 'android.os.Build' appears in /system/framework/framework.jar!classes2.dex)
    at app.revanced.patches.shared.misc.checks.BaseCheckEnvironmentPatch.setPatchInfo$setBuildInfo(BaseCheckEnvironmentPatch.kt:68)
    at app.revanced.patches.shared.misc.checks.BaseCheckEnvironmentPatch.setPatchInfo(BaseCheckEnvironmentPatch.kt:84)
    at app.revanced.patches.shared.misc.checks.BaseCheckEnvironmentPatch.execute(BaseCheckEnvironmentPatch.kt:44)

Solution

Older versions probably don't have that field.

Additional context

No response

Acknowledgements

LisoUseInAIKyrios commented 1 month ago

Very strange why this does not show a compilation error, since Integrations is set to Android 6.0 and YT only supports 8.0+

Frosty-J commented 1 month ago

Can confirm. The patching works on some devices such as Galaxy A04s but not others such as Fire Tablet, Galaxy S5, and Mechen MP3 player, based on Android versions 11, 11, and 9 respectively. Full logs linked.

LisoUseInAIKyrios commented 1 month ago

@Frosty-J Can you patch using CLI and dev releases? It would be good to confirm it's fixed on those. Edit: can patch using Manager as usual.

Odd why they would leave out those fields, when they are part of Android (they could have left the fields blank if they needed to).

Frosty-J commented 1 month ago

This appears to have fixed it! It hasn't finished installing the new patches yet but it's got past that hurdle.