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

fix: Fix SMALI compilation on devices with RTL language #242

Merged

Conversation

LisoUseInAIKyrios
Copy link
Contributor

@LisoUseInAIKyrios LisoUseInAIKyrios commented Sep 29, 2023

If the device uses a RTL language then patching fails with a syntax error:

Caused by: java.lang.IllegalStateException: Encountered 1 parser syntax errors and 0 lexer syntax errors!
	at app.revanced.patcher.util.smali.InlineSmaliCompiler$Companion.compile(InlineSmaliCompiler.kt:49)
	at app.revanced.patcher.util.smali.InlineSmaliCompilerKt.toInstructions(InlineSmaliCompiler.kt:72)
	at app.revanced.patcher.util.smali.InlineSmaliCompilerKt.toInstruction(InlineSmaliCompiler.kt:84)
	at app.revanced.patcher.extensions.InstructionExtensions.addInstruction(InstructionExtensions.kt:92)
	at app.revanced.patches.shared.integrations.AbstractIntegrationsPatch$IntegrationsFingerprint.invoke(AbstractIntegrationsPatch.kt:43)
	at app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.execute(AbstractIntegrationsPatch.kt:61)
	at app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.execute(AbstractIntegrationsPatch.kt:13)

This bug can be reproduced by specifying a RTL language:
java -Duser.language=ar -jar revanced-cli-*-all.jar ...

This bug affects both CLI and Manger.

The fix is to format all strings using a LTR locale.

@oSumAtrIX oSumAtrIX changed the title fix: Patch syntax error when patching on device with RTL language fix: Fix SMALI compilation on devices with RTL language Sep 29, 2023
@oSumAtrIX oSumAtrIX merged commit 356f1f1 into ReVanced:dev Sep 29, 2023
2 checks passed
revanced-bot pushed a commit that referenced this pull request Sep 29, 2023
## [15.0.3-dev.1](v15.0.2...v15.0.3-dev.1) (2023-09-29)

### Bug Fixes

* Fix SMALI compilation on devices with RTL language ([#242](#242)) ([356f1f1](356f1f1))
revanced-bot pushed a commit that referenced this pull request Oct 1, 2023
## [15.0.3](v15.0.2...v15.0.3) (2023-10-01)

### Bug Fixes

* Fix SMALI compilation on devices with RTL language ([#242](#242)) ([356f1f1](356f1f1))
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

Successfully merging this pull request may close these issues.

None yet

2 participants