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

Error when patching on Windows #4

Open
HermitOwO opened this issue Aug 6, 2024 · 5 comments
Open

Error when patching on Windows #4

HermitOwO opened this issue Aug 6, 2024 · 5 comments

Comments

@HermitOwO
Copy link

error: apply patch "coversize": apply patch "coversize": inst 2: patch "smali/com/faultexception/reader/BooksFragment.smali": patcher 0: could not find "\n    .line 167\n    invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getDimension(I)F\n\n    move-result v2\n\n    float-to-int v2, v2\n\n    add-int/2addr v2, p1\n\n    .line 166\n    invoke-virtual {v0, v2}, Lcom/faultexception/reader/widget/AutoFitRecyclerView;->setSpanWidth(I)V\n"
@pgaskin
Copy link
Owner

pgaskin commented Aug 7, 2024

Are you sure you're using the exact same version of Lithium?

@HermitOwO
Copy link
Author

Yes, I'm using Lithium 0.24.5.

@gozilla-paradise
Copy link

Got the same error as well

image

@gozilla-paradise
Copy link

Seems to fix the issue, it is due to windows reading smali will have \r\n while the patch only search for \n. To temporary fix the issue just change line 152 of patch.go with the following.

image

@HermitOwO

@pgaskin
Copy link
Owner

pgaskin commented Oct 17, 2024

Thanks for tracking that down. I'll make a fix for that.

On a side note, at some point, I'll get around to replacing the text-based smali patching with proper semantic pattern matching on the instructions themselves.

@pgaskin pgaskin changed the title Error when patching Error when patching on Windows Oct 17, 2024
@pgaskin pgaskin pinned this issue Oct 17, 2024
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