-
-
Notifications
You must be signed in to change notification settings - Fork 316
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(Third party Reddit clients): Spoof user agent to workaround Reddit API issues #3253
fix(Third party Reddit clients): Spoof user agent to workaround Reddit API issues #3253
Conversation
If you can extend this to Joey as well I'd be super-appreciative. Since Joey is based on Boost as far as I understand it I hope it is relatively similar. Great work regardless. |
...main/kotlin/app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch.kt
Show resolved
Hide resolved
...main/kotlin/app/revanced/patches/reddit/customclients/boostforreddit/api/SpoofClientPatch.kt
Outdated
Show resolved
Hide resolved
Sorry the approval was by mistake |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR was made because Reddit broke their oAuth API for the Android platform. In the past Reddit has caused the same issue and every time it resolved itself after a while. Sometimes a desktop browser user agent was required to bypass issues with logging in for example. For that reason this PR might be obsolete soon, if Reddit fixes their issue. Until then, Reddit should be contacted first and asked about the issue.
Perhaps make randomizing user-agent an option? In case reddit fixes it but then it might break it again which would require this PR again. |
That would be overengineering around a problem ReVanced isn't supposed to look at, which is why I'm even hesitant with this PR. Reddit can make any unpredictable change, not just to the user agent. |
https://old.reddit.com/r/redditdev/comments/1d3spoc/error_getting_submitted_with_mobile_useragent/ Docile-Alligator/Infinity-For-Reddit@07c9865 might be temp: ReVanced#3253 (review) "oSumAtrIX left a comment This PR was made because Reddit broke their oAuth API for the Android platform. In the past Reddit has caused the same issue and every time it resolved itself after a while. Sometimes a desktop browser user agent was required to bypass issues with logging in for example. For that reason this PR might be obsolete soon, if Reddit fixes their issue. Until then, Reddit should be contacted first and asked about the issue."
Implemented in e1754f3 |
RiF seems to be partially affected (#3256), although I haven't checked, if it is related to the user agent and can be fixed with this PR |
I'm getting "Invalid Request to Oauth API" even after patching with the updated patch from this PR (boost) |
I am having the same issues with Baconreader. Would this fix work there too? |
...revanced/patches/reddit/customclients/joeyforreddit/api/fingerprints/AuthUtilityUserAgent.kt
Outdated
Show resolved
Hide resolved
RIF needs line 55 changing from:
To:
|
RiF is not included in this PR, not sure what file you are referencing. |
Line 55 in 21f87db
Unsure why it wouldn't be included as the useragent from your previous patch includes "android" |
…lacklist # Conflicts: # src/main/kotlin/app/revanced/patches/reddit/customclients/redditisfun/api/SpoofClientPatch.kt
Thank you for the Joey fix! I think maybe an elegant solution to this would be to let the user specify their own user-agent instead of accepting a random one (just like client ID is currently a manual input). That would make it more future-proof as well. But I think there's a lot of people that would love it as-is simply to get their Reddit apps working on mobile working again. |
This definitely feels like the play. |
The way it is currently done is good enough. With patching your app, you compile a "new" application in context of Reddit oAuth applications which is why it receives your personal unique user agent. |
Thank you for contributing to ReVanced. Join us on Discord to receive a role for your contribution. |
## [4.8.3-dev.4](v4.8.3-dev.3...v4.8.3-dev.4) (2024-05-30) ### Bug Fixes * **3rd-party Reddit apps:** Spoof user agent to work around Reddit API issues ([#3253](#3253)) ([495e6d6](495e6d6))
@oSumAtrIX out of curiosity, is there a reason this PR went from waiting to see if Reddit will fix it to being merged in? Not that I'm complaining, just wondering if I missed anything! |
Because a lot of reports are coming in. It's easier to merge this and then revert if necessary, than keep it broken and wait until its fixed by Reddit. |
FYI, RIF just started working for me again. If this patch would have to be re-applied for this change to take place, I did not do that. So maybe it has been resolved upstream. |
As expected. Spoofing the user agent won't break it, but it's unnecessary if it doesn't fix anything. |
RIF is still not working for me, so I'm not sure if this has been adjusted by Reddit or not. I will update if it starts working. |
You're correct, I was wrong. Comments still aren't loading. I believe that when things originally broke, the app would not load a feed at all. When it started to do so, I thought the issue was resolved. |
Hi all, I'm just following [https://www.reddit.com/r/Android/comments/14niwgu/revanced_patches_for_boost_infinity_rif_is_fun/](this guide) but I imagine its out of date |
Forked the repo and forced a release live to test, working as expected for RIF with the new patch, thanks oSumAtrIX |
Thanks, I used revanced-cli and patched RiF. Works. Much appreciated. |
Awesome!! Can confirm this works, just have to use the same patch as before. Maybe adding a new name might be helpful (instead of just spoof client Id). Thanks a lot! |
Does this include a fix for baconreader? |
I'm confused. Could someone please explain how to apply this newest patch to RIF? |
The new patch hasn't been merged to main yet. See #3234. You won't be able to use the patch until it's merged and released. (Unless you use an advanced method such as the cli or a fork, but if you're not sure how to do this just wait for the release) |
Any chance we could also get Slide for Reddit updated? Many thanks! |
@ksnaden hello, could you please post your whole command for rif? thanks.. I am getting error.. i use jars and integration with latest version and rif apk from apkmirror
INFO: Aligning APK org.bouncycastle.jcajce.provider.keystore.bc.BcKeyStoreSpi$BCKeyStoreException: java.io.IOException: Error initialising store of key store: java.lang.SecurityException: JCE cannot authenticate the provider BC |
For For support, move to one of our links at https://revanced.app. |
Reddit started blocking all requests that contain word "android" in them: https://old.reddit.com/r/redditdev/comments/1d3spoc/error_getting_submitted_with_mobile_useragent/
Apps started getting 400 or 503, if they have "android" in their User-Agent header:
Weirdly, 400 requests get "Internal Server Error":
While it might be possible it is temporary outage, but it happens only with "android" in user-agent, which is suspicious, at least.