r/Infinity_For_Reddit • • Jun 17 '23

Tutorial Build your own .apk with your personal API key in 15 minutes online

Thanks to Oha_der_erste's help and ChatGPT (building app via CLI), I managed to create a Google Colab script where you input your own API token and it compiles an APK file with the token.

Maybe you want to do this after 1st of July or now, your choice.

  1. Backup your current settings in the App [Settings -> Advanced -> Backup settings (or so)]
  2. Open the Google Colab Script and run the snippets with the instructions (Please read it carefully, you don't need ANY coding experience as you don't touch the code)
  3. Uninstall old App
  4. Install the APK
  5. Login and restore your settings (if needed)
    If you see the name "{YourRedditUsername}-app" (or whatever you chose) while logging in, you were successful
  6. Restart the app for the settings to apply

It uses a Keystore file I created with the name, password, etc. "Infinity".

App tested on a phone and a VM.

Why do all of this? Reddit is limiting 3rd party apps and after July 1st, we will be forced to either pay for Infinity on a monthly basis (which will benefit only Reddits Admins), or use the original Reddit App. \ By doing this, you are using your own API Key which has a free allowance of 100 Requests/Minute. With basic usage of the app, you won't reach this limit and can still use Infinity without paying for it.

Update 2023/06/18: I added the changed Redirect URI and Useragent.
If anything else has to be updated, comment it.
Also I added a option to upload it directly to file.io with QR code

Important: If the build fails or you can't login in the App because of an Oauth error, try doing the whole process again in another browser (yes, generating a new API token)

Update 2023/06/22: Currently the App doesn't compile successfully. A solution is being looked for. Any help appreciated. \ Thanks to u/StudyGuidex and u/aman207, the script works again!

Update 2023/06/24: I made the Google Colab script a lot simpler.

Update 2023/07/04: I added anonfiles as another host.

2.5k Upvotes

866 comments sorted by

148

u/LankySeat Jun 18 '23 edited Jun 18 '23

Post from Dev.

OP, please fix this!!

redirect_uri = '' #@param {type:"string"}
user_agent = '' #@param {type:"string"}

and

apiutils_code = apiutils_code.replace("android:ml.docilealligator.infinityforreddit:v5.3.0 (by [/u/Hostilenemy](https://www.reddit.com/u/Hostilenemy))", user_agent) 
apiutils_code = apiutils_code.replace("infinity://localhost", redirect_uri)

I think is everything.

EDIT:

Just tried the above code changes with these parameters:

Appears to be working as expected!

- edited from Infinity App with my own API key.

60

u/AllMFHH Jun 18 '23

Updated!

49

u/LankySeat Jun 18 '23

Thank you for putting this together OP. Makes the entire process ridiculously easy! Going to save a lot of people tons of time.

→ More replies (1)
→ More replies (15)

6

u/shut_in007 Jun 18 '23

mine shows app not installed when installing the apk

6

u/AllMFHH Jun 18 '23

Try installing it with SAI Split APKs Installer

→ More replies (3)
→ More replies (2)

30

u/jensyboi08 Jun 18 '23

No option to change redirect url and user agent (and name). See Post by dev

14

u/AllMFHH Jun 18 '23

Got updated! (Posting it so users reading the comment don't think, I didn't update it)

→ More replies (6)

21

u/Games12367 Jun 18 '23

When I open the Google Collab script it requires that I request access. Is this correct?

26

u/AllMFHH Jun 18 '23

I was adding code and didn't want anybody to run not-tested code. It's now open again.

→ More replies (2)

11

u/Ok-Smoke-5653 Jun 17 '23

How do you get a token?

28

u/AllMFHH Jun 17 '23

It's written in Google Colab

5

u/Ok-Smoke-5653 Jun 17 '23

Sorry, I meant an API key. Absolute noob here.

33

u/AllMFHH Jun 17 '23

Still written in the Google Colab :) I used API key and API token, but both are the same thing...

→ More replies (2)

8

u/solidsnake911 Jun 18 '23

Thank you so much friend! But I tried, and I get an apk.zip file. I tried to change the name to .apk but not option of install, just RAR, copy to, move to, Mindomo and any random app more. Idk how can I do, help. Thank you in advance.

Pd: I have a Xiaomi with MIUI and Android 12.

11

u/AllMFHH Jun 18 '23

I really don't know how you'd get an "apk.zip" file as it should give you an "Infinity.apk".
The only thing you'd have to do it input your token, username and run the snippets one after the other... and everytime I tried, it worked flawlessly.

3

u/solidsnake911 Jun 18 '23

Yeah it's weird, the file result was .apk but after download it, .apk.zip and I can see all the files, and don't know what to do to make it work.

3

u/AllMFHH Jun 18 '23

Try another browser.

→ More replies (7)
→ More replies (4)
→ More replies (5)

6

u/stumu415 Jun 20 '23

Thanks for this post. Think it was successful but unsure. Do you mind two questions?

  1. If you see the name "{YourRedditUsername}-app" (or whatever you chose) while logging in, you were successful. Do you have a screenshot of this should look like? Nowhere do I see the name when I try to log in.
  2. In step 5. Change the API token.. Do I manually change these parameters or are they being copied from step 1 where I entered the details and got the API key?

Again, thank you for this tremendous effort. Makes it so easy for noobs like me.

6

u/AllMFHH Jun 20 '23
  1. After you have logged in, you have to grant permission to the API App. There you can see the name of the API.
  2. I stated that you don't have to touch the code at all, just input your Username and API token and then just click the run button on the codeblocks. Everything is done automatically.

No problem :)

2

u/RUEM_Jr Jun 24 '23

Some people was talking abt changing user agent etc. Don't use infinity name. What does that mean. Thanks in advance for the reply

4

u/AllMFHH Jun 24 '23

These are changes that make it so Reddit can't detect you are using Infinity.

These changes are automatically done when you are building the .apk file.

→ More replies (1)

4

u/PlsNoPornSubreddit Jun 24 '23
  1. What will happen after the July, 1st shutdown? Will the personal api key still have access to NSFW posts and subreddits?
  2. Can my personal api key be used to access other accounts? What is the scope of the key?

4

u/AllMFHH Jun 24 '23
  1. Probably, I can't say for sure
  2. Yes, you can have multiple accounts using the same API key. You as a person should just keep the api key private.
  3. Scope? I don't know. When you log in, it tells you everything it grants access to, so basically everything

4

u/voideaten Jun 25 '23

Is there a mirror of this tutorial stored off of Reddit, so that it can still be followed if admins remove it?

2

u/AllMFHH Jun 25 '23

Not from my side. You can copy the text somewhere else and the Google Colab Script to your Google Drive.

3

u/[deleted] Jun 18 '23

Sign-in does not work

1

u/AllMFHH Jun 18 '23

What error occures? Post a screenshot.

→ More replies (6)

3

u/[deleted] Jun 19 '23 edited Jun 19 '23

I have a solution for "Error fetching oauth client". For some reason, if we used the Google Colab script before and repeat the operation (even with new API token and all correct data this time) it will run much faster the second time, and we don't want that cause error be still there. In my case, all I had to do was go to another browser (I was using Firefox, so I choose Chrome), logged in there with another Google account then turn that script (it will work in his original tempo) and now the application with its own API works like charm. And if anyone it's interested i selected the option "apk direct download" as final result. There is also a big chance that clearing cookies in first browser will be enough, but I haven't tried that. I hope that helps. Cheers!

1

u/AllMFHH Jun 19 '23

It runs much faster because it already compiled the apk. I never intended for it to be compiled again in the same runtime. I could add another codeblock where it kills the runtime.

So doing it again works. Browser shouldn't matter since nothing compiles in your browser, everything is done in Googles VM. But thanks for letting me know.

→ More replies (1)

2

u/No-Aspect-2926 Jun 18 '23

Should we use this already or wait for 1st June?

3

u/AllMFHH Jun 18 '23

I'd recommend waiting first, you can always compile the app later

2

u/No-Aspect-2926 Jun 18 '23

Well I already compiled, what should I watch now since it's compiled? My api usage or something?

2

u/AllMFHH Jun 18 '23

Not really, you won't go over 100 requests per minute by simply using the app.

2

u/No-Aspect-2926 Jun 18 '23

Also, Play protect will not allow to install it

3

u/AllMFHH Jun 18 '23

While installing, it should ask if Play Protect should scan it. Try installing it with SAI Split APKs Installer.

2

u/cultsuperstar Jun 18 '23

So I'm assuming this will be the "final" version of Infinity? If there are updates, would we have to go through the process of rebuilding the apk (but still using previously generated API key)?

3

u/AllMFHH Jun 19 '23 edited Jun 19 '23

It shouldn't be the last version. Yes, if there are updates, it would mean rebuilding the app and installing it. But then you can just install it without uninstalling since the Keystore is the same.

2

u/d6cbccf39a9aed9d1968 Jun 21 '23

after accepting Authorization, im just stuck on Login. scr

2

u/AllMFHH Jun 21 '23

If uninstalling and installing a new build doesn't work, idk.

→ More replies (3)

2

u/lolariane Jun 21 '23 edited Jun 21 '23

What happens if I have multiple alt usernames? Will they all get permabanned for using the same API key? Or is the API key locked to the username we input in step 1 anyhow, preventing logging in from another username?

Edit: just finished using the notebook and have an APK sitting at the ready! Thanks for creating this!!

4

u/AllMFHH Jun 21 '23

You can use multiple accounts on the same API, that's not a problem.

→ More replies (1)

2

u/EliteAn0rak Jun 21 '23

How do I know it worked?

2

u/AllMFHH Jun 21 '23

After you have logged in, you have to authorize the API Token. That's when you see the API Apps name.

2

u/zero_chan1 Jun 23 '23

not working anymore. Reddid won't let you follow the link to make an api token... at least on Windows. I tried firefox, chrome and edge. I'll be redirected to log-in

2

u/RUEM_Jr Jun 24 '23

Thanks. Successfully shown my username instead of "infinity" in login page. Btw how do i use my secondary acc?

3

u/AllMFHH Jun 24 '23

Just add your second account.

The API Key is not bound to your account, but bound to your build .apk.

2

u/Colonelex Jun 24 '23

Hi thanks for this it worked perfectly for me. One thing I noticed is that the app is still recognized in google playstore but we can't update from there in the future right?

3

u/AllMFHH Jun 24 '23

Updating it from the Google Playstore would overwrite it, yes. You'd need to get a new .apk from the Google Colab. When you already installed a version from Google Colab and get updated one from there, you can just install the apk and it will update.

2

u/rpgsniper4 Jun 28 '23

If I understand correctly, to update the app all someone has to do is navigate to the Colab file, generate a new APK (with their API token), and install the new file over their existing app?

Your guide and Colab sheet worked perfectly for me on mobile Firefox (Android 10 OS). People like you, the problem solvers, are what make communities on reddit great!

3

u/AllMFHH Jun 28 '23

Exactly. Happy to be helpful!

→ More replies (1)

2

u/Actual_Beer Jun 24 '23 edited Nov 24 '24

removed

3

u/AllMFHH Jun 25 '23

100 per minute. You won't reach this with the app, even with extensive use.

2

u/MiniBus93 Jun 27 '23

Thank you, thank you, thank you, THANK YOU!

Words aren't enough to express my gratitude for this!

From the bottom of my heart, thank you!

2

u/derday Jun 29 '23

this worked at the first runthrough for me, great thanks to u/AllMFHH

and as I read some posts along, with every new infinity version at github, we/I have to generate a new apk for me (which I can install over the existing one)?!

2

u/AllMFHH Jun 29 '23

Yes, exactly.

2

u/[deleted] Jul 01 '23

FileNotFoundError Traceback (most recent call last) <ipython-input-3-965e377ae2df> in <cell line: 14>() 25 26 url = 'https://file.io' ---> 27 with open("/content/Infinity.apk", 'rb') as file: 28 files = {'file': file} 29 response = requests.post(url, files=files).json()

FileNotFoundError: [Errno 2] No such file or directory: '/content/Infinity.apk'

1

u/AllMFHH Jul 01 '23

What was the output of Step 2?

→ More replies (1)

89

u/[deleted] Jun 18 '23

I AM HAPPY WE NOW HAVE A TUTORIAL FOR THIS SHIT

13

u/GruenCool Jun 18 '23 edited Jun 19 '23

Thanks for the post and for making it possible to use Infinity after June.

Two question though: Is this process necessary every time I want to update Infinity? And, why is it not possible to have a version of Infinity which can have the API token loaded "dynamically" instead of compile my own version of it?

Edit: Typo

26

u/Kotaless Jun 17 '23

Very easy to use, thank you.

I still don't understand why Reddit didn't give Infinity free API access.

→ More replies (7)

7

u/StudyGuidex Jun 22 '23 edited Jun 22 '23

For everyone who is having compile issues and is unable to setup the app, I have fixed it and created a solution.

Before all these steps. First you need to download the source code located here:https://github.com/Docile-Alligator/Infinity-For-Reddit/releases/tag/v6.0.2

Step 1. Download the .aar module and import it as a module. Place it in the app folder.https://github.com/Rajagopalr3/CustomizedTextView/raw/rajgopalr3/customtextview-2.1.aar

Step 2. Inside android studio once you have opened up the source code, HEAD OVER TO BUILD.GRADLE.

inside BUILD.GRADLE. Go to line 176. Change the implementation from implementation 'com.libRG:customtextview:2.4' To implementation files("E:/Infinity-For-Reddit-5.4.2/app/customtextview-2.1.aar"); <-- this is just an example, just locate where you download the .aar and change what is inside the ("").https://imgur.com/a/aOCMCFZ

Step 3. Build and generate as a signed APK and that is it!

EDIT: Just a reminder, you do need to know how to change the Client ID(API KEY), App name, Redirect_URI and User_AGENT before you should compile it as well.

If you are confused on how to do that, feel free to comment on here and ill explain, but i do believe their is an example in this thread somewhere on how to do it.

4

u/aman207 Jun 22 '23

You should submit a PR to the infinity github repo. Would make their lives easier. Also would allow us to use a temporary fork in AllMFHH's google colab script.

→ More replies (1)
→ More replies (6)

5

u/BillyCoolTomari Jun 22 '23

Hi there, trying to follow the guide but I can't get past Step 6 (Build). It fails with 2 errors:

Execution failed for task ':app:dataBindingMergeDependencyArtifactsRelease'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not find com.libRG:customtextview:2.4.
Required by:
project :app

java.lang.StackOverflowError (no error message)

Tried on Firefox and Edge with same results. Any ideas what I'm doing wrong?

→ More replies (3)

5

u/Kheldar215 May 23 '24

hi, i have an error on step 3, others dowload type do the same :

mv: cannot stat '/content/Infinity-For-Reddit/app/build/outputs/apk/release/app*.apk': No such file or directory


---------------------------------------------------------------------------


FileNotFoundError                         Traceback (most recent call last)


 in <cell line: 14>()
     14 if dl == "[.apk Direct Download]":
     15   from google.colab import files
---> 16   files.download('/content/Infinity.apk')
     17 else:
     18   get_ipython().system('pip install requests pyqrcode pypng')

<ipython-input-10-103d42b982d7>

 in download(filename)
    223   if not _os.path.exists(filename):
    224     msg = 'Cannot find file: {}'.format(filename)
--> 225     raise FileNotFoundError(msg)  # pylint: disable=undefined-variable
    226 
    227   comm_manager = _IPython.get_ipython().kernel.comm_manager

/usr/local/lib/python3.10/dist-packages/google/colab/files.py

FileNotFoundError: Cannot find file: /content/Infinity.apkmv: cannot stat '/content/Infinity-For-Reddit/app/build/outputs/apk/release/app*.apk': No such file or directory
---------------------------------------------------------------------------

FileNotFoundError                         Traceback (most recent call last)

<ipython-input-10-103d42b982d7> in <cell line: 14>()
     14 if dl == "[.apk Direct Download]":
     15   from google.colab import files
---> 16   files.download('/content/Infinity.apk')
     17 else:
     18   get_ipython().system('pip install requests pyqrcode pypng')


/usr/local/lib/python3.10/dist-packages/google/colab/files.py in download(filename)
    223   if not _os.path.exists(filename):
    224     msg = 'Cannot find file: {}'.format(filename)
--> 225     raise FileNotFoundError(msg)  # pylint: disable=undefined-variable
    226 
    227   comm_manager = _IPython.get_ipython().kernel.comm_manager


FileNotFoundError: Cannot find file: /content/Infinity.apk
→ More replies (2)

4

u/KajoBluemane Jun 22 '23

Hello.

"6. Build the APK" failed for me. I tried with two different browsers and both fail at the same part.

"1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsRelease'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not find com.libRG:customtextview:2.4.
Required by:
project :app

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0."

→ More replies (5)

4

u/extod2 Jun 23 '23

How long until Reddit makes it so that you can't do this?

4

u/TheComradeTom Oct 10 '23

Every time i reboot the phone the app breaks for some reason... It keeps crashing. I'm on Redmi note 12, with xiaomi.eu 14

4

u/Undernown May 30 '24 edited May 30 '24

Do you need to generate a new API-key every time you want to download a newer version?

Cause I'm trying to use my old API, and the build script says it's successful. But some of the build script progress bars don't go to 100% and some give a few errors.

When I try to proceed with step 3 and dowload the APK, there is an immediate error that there is no APK available at the expect file location.

Edit: Nevermind, trying to run the scripts in Brave browser was the issue. Tried in Chrome and it's working fine.

4

u/Andynr May 30 '24

Seems like the script uses 7.2.2beta 1 and not the newly released 7.2.3

→ More replies (2)

6

u/GRRemlin Aug 22 '24 edited Aug 25 '24

Is anyone getting "older" versions from the GitHub Repo? 7.3.2 is out, but I am still getting the 7.3.0 from the Colab script.

EDIT: Ugh, I think I found the "issue": build.gradle in Github still says 7.3.0 even though the actual app code was updated yesterday. So I think we're getting the latest features and fixes, but the Play Store will still pester about updating it.

EDIT #2: Well, the build.gradle in Github was updated to 7.3.3, but I am still getting 7.3.0... AllMFHH, can you please check if there's an issue with the script or is it my ID10T issue?

→ More replies (10)

4

u/DioTheSuperiorWaifu Jun 02 '26

apiutils_code = apiutils_code.replace("NO------A", api_token) will have to be modified, as the old pattern has changed with the recent release

Maybe something like apiutils_code = re.sub(r'public static final String CLIENT_ID = ".*?";', f'public static final String CLIENT_ID = "{api_token}";', apiutils_code)?

→ More replies (3)

1

u/Voiceroy_18 Jun 18 '23

Will we be charged for our own api key?

4

u/AllMFHH Jun 18 '23

No, but you can donate to the App creator on Patreon :)

2

u/Voiceroy_18 Jun 18 '23 edited Jun 18 '23

Is it specified anywhere that we won't be charged for the api key?

3

u/AllMFHH Jun 18 '23

If you were to be charged, it would have been specified somewhere. If you go over 100 requests/minute, you get rate limited. But you won't go over that.

→ More replies (11)

1

u/giulgu17 Jul 01 '23 edited Jul 01 '23

Hello, when I try to log in with the .apk it gives me this error:

` Error: Error fetching oauth client at requestOauthApp (/src/packages/applications/monolith/bin/index.cjs:145599:16)

at async Proxy.renderAfterQuery (/src/packages/applications/monolith/bin/index.cjs:185751:26)

at async /src/packages/applications/monolith/bin/index.cjs:142702:21

at async withLocalSpanGeneratorAsync (/src/packages/applications/monolith/bin/index.cjs:136312:18)

at async Proxy.<anonymous> (/src/packages/applications/monolith/bin/index.cjs:142700:17)

at async renderFeature (/src/packages/applications/monolith/bin/index.cjs:142972:21)

at async renderFeatureTree (/src/packages/applications/monolith/bin/index.cjs:143117:5)

at async StreamingRenderer.renderAsGenerator (/src/packages/applications/monolith/bin/index.cjs:143212:13)`

3

u/AllMFHH Jul 01 '23

Try building the .apk file again with a new API token and read everything carefully. I don't know what's causing this to happen. Wrong API token? Did you mistake the Username field with the API field?

→ More replies (1)

1

u/Good_Temperature_685 May 12 '24

The Colab script currently fails in step 2 because Gradle now requires Java 17 but the script builds the environment with Java 11. This is pretty easy to fix.

  1. In step 1, click "show code"
  2. Look for the line
!apt-get --quiet install openjdk-11-jdk

and change "11" to "17", so it looks like this:

!apt-get --quiet install openjdk-17-jdk
  1. Look for the line
os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64"

and again, just change "11" to "17"

  1. Now you can follow all the original steps and it should succeed.

2

u/AllMFHH May 12 '24

The script got updated, so it should work fine now. But thanks. ^^

→ More replies (1)

1

u/K1ngsGambit May 14 '24

So I am getting this error after following the steps to compile an APK with the above Google Colab Script. I made the app, using infinite://localhost as the REDIRECT URI and with an API key Reddit gave me. It looks like the whole process completes, and I download and install the app. But when I try to log in I get this error. I have tried three times with two browsers and once with revanced.app manager, downloading the infinity apk to my phone and patching it there. Same thing :-(

3

u/AllMFHH May 15 '24

The Redirect URI should be http://127.0.0.1 tho

→ More replies (2)

1

u/shut_in007 Jun 18 '23

What to do with this 'add your keystore ' ?

1

u/AllMFHH Jun 18 '23

Where does it say that?

→ More replies (7)

1

u/goomahmarone Jun 18 '23

Would you be able to do this with Sync for reddit please, would be a massive help

2

u/AllMFHH Jun 18 '23

Since Sync for Reddit isn't open source, no.

→ More replies (1)

9

u/jensyboi08 Jun 18 '23 edited Jun 18 '23

Revanced made a patch for it. Install Revanced manager. Download the latest Sync for reddit apk( not bundle) from ApkMirror. Create a txt file named reddit_client_id_revanced.txt in your internal storage( not a subfolder like Downloads). Now you need to create your api key go to https://old.reddit.com/prefs/apps/ and make a new key with the following settings:

  • application type: installed app
  • Redirect url: http://redditsync/auth

Copy the the api key should be under the name of the key you created, and paste it in the txt file you made.

Now the only thing left is to open the revanced manager go to the patcher tab, click select application and select the Sync for reddit apk file from Storage. Select the oAuth change client id patch and click on done. Then simply install, but make sure the old installed version was deleted. If you login to your account then you will be using your own api. You can check this if the api name is different when it asks for permission plus in prefs/app should now have an authorized api(with a bunch of permissions) with your name as developer.

*Select disable ads patch as well if you experience crash after setup.

→ More replies (10)

1

u/shut_in007 Jun 19 '23

Hey dude didn't work the first time , so i tried with my previous api key where it is set as web app.

It worked. I was logged in..

Can I continue using the app with that api key(the one I created with web app as request)

1

u/AllMFHH Jun 19 '23

I don't know. I also just follow instructions I read somewhere...

→ More replies (1)

1

u/Thefaccio Jun 22 '23

I tried it on firefox and chrome but I always get to this point and it fails:

<=------------> 9% EXECUTING [1m 9s]> IDLE> IDLE1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsRelease'.
> Could not resolve all files for configuration ':app:releaseCompileClasspath'.
> Could not find com.libRG:customtextview:2.4.
Required by:
project :app
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1m 17s
1 actionable task: 1 executed

1

u/AllMFHH Jun 22 '23

It's currently broken and as I am not an Android dev, I don't know how to fix it.

u/hostilenemy, could you help out here? Thanks.

→ More replies (7)
→ More replies (1)

1

u/Kustu05 Jun 24 '23

I'm getting this error while trying to sign in:

Error: Error fetching oauth client

Should I try with a different browser?

1

u/AllMFHH Jun 24 '23

"If the build fails or you can't login in the App because of an Oauth error, try doing the whole process again in another browser (yes, generating a new APl token)"

→ More replies (5)

1

u/Steven1958 Jun 25 '23

Works perfectly, this maybe a daft qestion but can the script be used for other Reddit 3rd party apps other than Infinty??

2

u/AllMFHH Jun 25 '23

Since most other Clients aren't Open Source, no.

There are other ways to get other clients running, but they are more annoying than just pushing some buttons and getting an .apk.

→ More replies (1)

1

u/Higira Jun 25 '23

im getting "app not installed as package conflicts with an existing package."

i already uninstalled the old infinity...

edit: nvm... it was still installed in my secure folder. works now~

1

u/AllMFHH Jun 25 '23

Maybe it still is in Secure Folder or an virtual/dual app? You'd have to uninstall that, too

→ More replies (2)

1

u/enter_user_name Jun 25 '23

I got everything to work, step 4 to delete the VM, doesn't execute all the way and always fails. Is it ok to close the window?

1

u/Xav1erM Jun 25 '23

Is there any chance you'd be willing to post a YouTube video showing this? Sorry, am dumb

2

u/AllMFHH Jun 25 '23

Maybe in the next few days.

1

u/Gillauino Jun 26 '23

Is it possible to have multiple accounts using this method?

1

u/AllMFHH Jun 26 '23

Yes, you can just add more accounts in the app.

The API key is not bound to your account, rather to you personally.

→ More replies (3)

1

u/HappySilveon Jun 26 '23

Hey there, thanks for this, it seems to work. However I saw this post saying reddit still knows you're using the same app if you only change the API key/token, if I understand correctly (i'm no expert pls bare) this doesn't change all of the 3 mentioned things and can get you banned?

If so how do I change them myself / will there be an updated colab?

3

u/AllMFHH Jun 26 '23

By using the Google Colab and creating your own API Key with the shown settings, all 3 mentioned things are changed automatically.

1

u/robotkoer Jun 26 '23

For the sake of everyone, please write and maintain this tutorial outside Reddit.

1

u/AllMFHH Jun 26 '23

You can just copy the text and make a copy of the Google Colab Notebook. I am not bothering to do this outside of Reddit, for now.

1

u/MoraGrubber Jun 26 '23

Do i need a PC to do this?

1

u/AllMFHH Jun 27 '23

No, you can do this on your phone, too. But I'd recommend using a computer.

→ More replies (4)

1

u/marinluv Jun 30 '23 edited Jun 30 '23

I build the APK and its working with my API. I have three queries:-

  1. Would anonymous mode work with API or with API?
  2. As NSFW would be restricted, so all subs which are NSFW (non-pornographic ones) would also be restricted from the API?
  3. What is API limit? 100? How does it translate to real world usage?

3

u/AllMFHH Jun 30 '23
  1. I don't know what happens with anonymous mode after 1st od July.
  2. NSFW shouldn't be restricted for private APIs.
  3. 100 per Minute, you won't reach this limit even with extensive usage.

2

u/marinluv Jun 30 '23

Okay, thanks for answering. Much appreciated the work here.

So, NSFW is restricted for public API like in Infinity paid app?

→ More replies (4)

1

u/Black_DemonSk Jun 30 '23

Downloaded the app using thsi method unfortunetaly when i log in it does not return me back to the app but instead opens reddit in browser mode. am i doing something wrong?

1

u/-Rhialto- Jun 30 '23

Just curious, is it like you create an app with your credentials built-in so anyone else who grab that APK can act as you?

1

u/AllMFHH Jun 30 '23

Not act as you, but use your API token to interact with Reddits API.

Basically, they don't have access to your account with just the API key.

1

u/TilmitderBrill Jun 30 '23

Logging in inside the app throws "The webpage at reddit://reddit[...] could not be loaded because:
net::ERR_UNKOWN_URL_SCHEME

1

u/AllMFHH Jul 01 '23

it seems like you messed up the return URI in the process of creating the API token. You should do it exactly like in the example image in Google Colab (except change my name with yours)

→ More replies (1)

1

u/queestionnacc Jun 30 '23

Does this allow searching for comments?

1

u/AllMFHH Jun 30 '23

If the old Infinity app could do it, probably.

1

u/throwingverbalrocks Jun 30 '23

Hey, just wanted to say thank you so much! The process has been completely painless and worked on the first try. Thanks for providing us with such clear instructions!

1

u/AllMFHH Jun 30 '23

You're welcome :)

1

u/knitrex Jun 30 '23

Hi, I tried to do this and I got an error. It says to post here if it fails.

I have a screenshot if needed.

1

u/AllMFHH Jun 30 '23
  1. What error? Screenshot appreciated
  2. Where did the error occur? In the Google Colab? In the app? Logging in? Or somewhere else?
→ More replies (6)

1

u/DonaldYaYa Jun 30 '23

Hello,

May I please ask for help.

I keep getting Error retrieving the token when I try to log into Infinity.

I open infinity, and it takes me to the Reddit official front page,

I log in but it doesn't log me in saying 'error retrieving the token.

I followed the instructions.

https://bashify.io/images/z18asx

Thank you

2

u/AllMFHH Jun 30 '23

Could you try this?

Maybe updating Webview via PlayStore and doing Method 1 here for Infinity will do the trick:
https://gadgetstouse.com/blog/2022/01/28/open-facebook-instagram-twitter-links-in-app-not-browser/?utm_content=cmp-true

→ More replies (3)

1

u/[deleted] Jul 01 '23 edited Jul 01 '23

I have tried too many times, but, for some reason, I still get an oauth error when logging in, tried on different browsers, with different API keys, different names, different redirect urls incase they may work, nothing still works, I have tried like 6 different API keys and have built the app too many times, I guess this is a bug of mine because I haven't seen too many people with it.

1

u/AllMFHH Jul 01 '23

Maybe try updating WebView from Playstore + Chrome + Your standars browser. Try disabling VPN (even though I didn't have problems with mine), if any. Maybeee that will help...

→ More replies (1)

1

u/ArdenArnold Jul 01 '23

Hey , the guide was really helpful and hopped on here to give my thanks also few things I would like to ask you if you don't mind

  1. I browse reddit a lot , opening few posts and reading comment threads and whatnot for hours , will I hit my API limit and what are the consequences of it?
  2. Will there be any trouble in doing this method ?

Once again huge thank you to you and others who have helped in creating this guide.

3

u/AllMFHH Jul 01 '23
  1. No you won't, even with extensive usage. For example you'd need to open a post 100 times in a minute, and you probably don't do that... I hope
  2. Probably not, but I can't promise anything since Reddit is so unpredictable with these API changes
→ More replies (1)

1

u/BlackGirlNerd Jul 01 '23

When attempting step 3 of the Google Colab portion (download apk directly to phone), I get a file not found error. All prior steps ran flawlessly.

mv: cannot stat '/content/Infinity-For-Reddit/app/build/outputs/apk/release/app*.apk': No such file or directory

FileNotFoundError Traceback (most recent call last) <ipython-input-8-01bbe44f6ee1> in <cell line: 14>() 14 if dl == "[.apk Direct Download]": 15 from google.colab import files ---> 16 files.download('/content/Infinity.apk') 17 else: 18 get_ipython().system('pip install requests pyqrcode pypng')

/usr/local/lib/python3.10/dist-packages/google/colab/files.py in download(filename) 220 if not _os.path.exists(filename): 221 msg = 'Cannot find file: {}'.format(filename) --> 222 raise FileNotFoundError(msg) # pylint: disable=undefined-variable 223 224 comm_manager = _IPython.get_ipython().kernel.comm_manager

FileNotFoundError: Cannot find file: /content/Infinity.apk

1

u/AllMFHH Jul 01 '23

Did step 2 fail? Did it say Build Successful?

→ More replies (2)

1

u/windowsseven Jul 01 '23

I made my own apk and installed the same one on Personal as well as Work Profile and both work. Thanks a lot. Much better than browsing Reddit through their app. Now can keep connected on Reddit as well as try Lemmy till it grows substantially. But if everyone does this won't it defeat the purpose of Reddit's API changes? Will they put an end to this method?

1

u/AllMFHH Jul 01 '23

I don't know what's happening in the minds of the Reddit Admins.

1

u/LevelUpRizz Jul 01 '23

Thanks a lot for this! It worked perfectly, but it feels like I'm using the actual Infinity app. The built app didn't show the app name I specified, nor asked for API auth. It just started working normally..

Did I do something wrong?

1

u/AllMFHH Jul 02 '23

I don't think so, Reddit is weird.

1

u/Its_PlanB Jul 01 '23

Dumb question: what happens in the future? Will infinity work like it worked now? What if an infinity update will be released?

Do we have to update the api key every time?

THX!

2

u/AllMFHH Jul 02 '23

If infinity gets an update, you should build a new .apk file with the same API key. Just install it over the old app without uninstalling.

1

u/thesameoldmanure Jul 01 '23

For the life of me I can't find the downloaded apk file, every thing was successful though

1

u/AllMFHH Jul 02 '23

What do you mean with you can't find tbe apk file? What happens? Any errors in step 3? Did you try file.io upload in step 3?

1

u/Anomalousity Jul 01 '23

Why isn't this post stickied to the front page? Technically it's not the dev doing this so i don't think he'll have any implications against him but still. This was too too easy to do if you can follow directions exactly and it truly does work and preserves the legacy of infinity without capitulating to the new policy's goal$.

1

u/AllMFHH Jul 02 '23

I don't think Reddit would like it if Hostilenemy pins it. Reddit doesn't like this post either, but it's totally legal and shouldn't break any ToS.

→ More replies (4)

1

u/sandynt92 Jul 02 '23

i got an error "name 'api_token' is not defined", but already input the API token and username. have anyone got the same?

1

u/AllMFHH Jul 02 '23

You need to run the first cell, too.

→ More replies (1)

1

u/brezhnervous Jul 02 '23

One very dumb question from someone utterly clueless who has never done anything like this before

What exactly does "Run snippet on the top left" mean?

Thanks in embarrassment lol

1

u/AllTheMedicine Jul 02 '23

Will the app auto-update if updates are released on the app store?

There is a notice on the infinity app that none of the previous versions will work after july 1st.

1

u/AllMFHH Jul 04 '23

I don't think so, but I can't assure you that.

1

u/TheSameTrain Jul 03 '23

This is awesome. Small bug I found, the files.io option will download as apk.txt. All I had to do was re-name it to just .apk to install but it might be worth calling out in the script or something

1

u/AllMFHH Jul 04 '23

Wrote it into the faq, thanks :)

1

u/Bless_This_Parish Jul 04 '23 edited Jul 04 '23

So for some reason the direct download didn't seem to work. The file. io "indirect" option did work though.

I clicked the play button ("snippet" is not very descriptive, given that there's five of them in the top left(s)), it did the download animation and gave me the checkmark that meant it was done, and then checked the "download" tab and found nothing. I did it again and still found nothing. I restarted the process, made the file .io thing, which worked, and tried and failed to use the direct download one last time for good measure.

1

u/AllMFHH Jul 04 '23

That's very weird. I will try to add another way to download the .apk file. Direct Download is a bit slow.

→ More replies (1)

1

u/NurseStimpy Jul 04 '23

Thank you so much. I am no where near tech savvy enough to do this. Instructions were straightforward and easily done. Now I can keep using infinity, thanks!

Only one question, I see where if we want to update the app we do the whole thing over, with the same api token, but unless something big changes with the app or it stops working, there shouldn't be much need to update regularly, right?

Thanks again!

1

u/AllMFHH Jul 04 '23

Exactly. Have fun!

1

u/PrincessKaylee Jul 04 '23

This worked, thanks! Was on Slide, but their method to build seems a bit more of a hassle than I would have liked...

2

u/AllMFHH Jul 04 '23

I looked at the guide... I didn't understand it... \ That's why I like tutorials where you just let the user press some buttons and magically a file appears, like my tutorial :)

1

u/OmniscientApizza Aug 09 '23

is it necessary to put "s-app" when inputting username?

3

u/septor Jun 18 '23

Thanks, buddy. Works a treat and saves me the trouble of doing it myself!

3

u/nogills Jun 18 '23

This worked perfectly. Thank you!

3

u/TheMidniteprophet Jun 18 '23

I got it to work! Thanks op.

3

u/Poudlardo Jun 20 '23

useful thanks a lot, it worked 100%

3

u/golgi42 Jun 21 '23

Just want to say thanks. This worked perfectly. My favorite thing about infinity is that the app attracts a great community. Donated to dev and will do so with each update if they have the time to upkeep.

3

u/XxswifterxX Jun 27 '23

Thanks! just made my own apk :)

3

u/mcburgs Jun 29 '23

Legend. Thanks for this.

Let's see if it works after the Event Horizon lol

3

u/FedorByChoke Jul 01 '23

This is amazing. This is way beyond entry level programming in the job market.

3

u/[deleted] Jul 01 '23

Worked perfectly without problems for all my devices. Thank you very much <3

3

u/ryabs07 Sep 08 '23

Is this method still working? I tried it a couple of times already, but i get "Error: Error fetching oauth client" when logging in. I did all the steps correctly afaik.

→ More replies (4)

3

u/EpicSimon Oct 08 '23

Hey u/AllMFHH, I'm getting a "page not found" error after logging in. Ran the script multiple times and tried adding new API-keys too, yet Im getting the same error.

→ More replies (3)

3

u/Spontanemoose May 31 '24

I'm able to get to step 3: download the APK, but this always fails. I get this; any suggestions?

mv: cannot stat '/content/Infinity-For-Reddit/app/build/outputs/apk/release/app*.apk': No such file or directory


---------------------------------------------------------------------------


FileNotFoundError                         Traceback (most recent call last)


 in <cell line: 14>()
     14 if dl == "[.apk Direct Download]":
     15   from google.colab import files
---> 16   files.download('/content/Infinity.apk')
     17 else:
     18   get_ipython().system('pip install requests pyqrcode pypng')

<ipython-input-6-103d42b982d7>

 in download(filename)
    223   if not _os.path.exists(filename):
    224     msg = 'Cannot find file: {}'.format(filename)
--> 225     raise FileNotFoundError(msg)  # pylint: disable=undefined-variable
    226 
    227   comm_manager = _IPython.get_ipython().kernel.comm_manager

/usr/local/lib/python3.10/dist-packages/google/colab/files.py

FileNotFoundError: Cannot find file: /content/Infinity.apkmv: cannot stat '/content/Infinity-For-Reddit/app/build/outputs/apk/release/app*.apk': No such file or directory
---------------------------------------------------------------------------

FileNotFoundError                         Traceback (most recent call last)

<ipython-input-6-103d42b982d7> in <cell line: 14>()
     14 if dl == "[.apk Direct Download]":
     15   from google.colab import files
---> 16   files.download('/content/Infinity.apk')
     17 else:
     18   get_ipython().system('pip install requests pyqrcode pypng')


/usr/local/lib/python3.10/dist-packages/google/colab/files.py in download(filename)
    223   if not _os.path.exists(filename):
    224     msg = 'Cannot find file: {}'.format(filename)
--> 225     raise FileNotFoundError(msg)  # pylint: disable=undefined-variable
    226 
    227   comm_manager = _IPython.get_ipython().kernel.comm_manager


FileNotFoundError: Cannot find file: /content/Infinity.apk
→ More replies (3)

3

u/PerceptionGeneral988 Aug 12 '25

This still works. Massive kudos for the extremely straightforward instructions (speaking as a complete coding novice)

1

u/Reeonimus May 08 '24

Have been using this since its release and looks like now it finally stopped working.

 > Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
      Your current JDK is located in /usr/lib/jvm/java-11-openjdk-amd64
      You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`. Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 17 to run. You are currently using Java 11.
      Your current JDK is located in /usr/lib/jvm/java-11-openjdk-amd64
      You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

3

u/felipeplz May 08 '24

What worked for me:

  • On Step 1, press "Show code" at the bottom of the step, and make the following changes to the code:

    • !apt-get --quiet install openjdk-11-jdk -> !apt-get --quiet install openjdk-17-jdk
    • os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-11-openjdk-amd64" -> os.environ["JAVA_HOME"] = "/usr/lib/jvm/java-17-openjdk-amd64"
  • Run Step 1.
  • Once Step 1 is done, go to "Files" (folder icon on the left sidebar) and open the file Infinity-For-Reddit/app/build.gradle.
  • Find inside the file:
    lint {
        disable 'MissingTranslation'
    }
  • And add baseline = file("lint-baseline.xml"), so that you end up with this:
    lint {
        disable 'MissingTranslation'
        baseline = file("lint-baseline.xml")
    }
  • On Step 2, press "Show code" and add !./gradlew updateLintBaseline right before !./gradlew assembleRelease, so the whole code ends up like this:
#@title 2. Build the APK. This can take up to 10 minutes. (Just click run)
if not api_token or not your_reddit_username:
  print("")
  print("\x1b[31m[IMPORTANT]")
  print("No settings have been set. Please input your token and username in Step 1.\x1b[0m")
  sys.exit()
!./gradlew updateLintBaseline
!./gradlew assembleRelease
  • Run Step 2 and 3 and that should be it!

2

u/AllMFHH May 12 '24

I was sick and had no time to look into this. I added the changes, thanks :)

→ More replies (1)
→ More replies (3)

2

u/uberafc Jun 18 '23

This is excellent. Thank you so much, it will make future upgrades easy to make as well.

2

u/zarte13 Jun 19 '23

worked great! thanks a lot

2

u/blandge Jun 24 '23

What is the purpose of this?

4

u/Asmuni Jun 24 '23

The free limit for an API key is enough for one user. So with your own key you can still browse Reddit on the infinity app for free.

2

u/alolan_weavile Jun 24 '23

Thank you so much, worked perfectly. Wish they would pin your post!

2

u/arandommudkip Jun 25 '23

Thank you for this post, the steps were easy to follow and thanks to the app developer for open-sourcing this app. I hope this solution will continue to work for a long time from now on.

2

u/Mistahmo Jun 25 '23

This is awesome OP, worked perfectly for me on the first go

2

u/El3ktroHexe Jun 26 '23

Thank you so much for this. Works perfectly now :)

2

u/Firm-Craft Jun 30 '23

K on profile pics being a force for good in this world 🥰🥰✅✅

2

u/[deleted] Jul 01 '23 edited Jul 01 '23

https://www.reddit.com/prefs/apps

You must also register to use the API.

When you are ready, you must register in order to use the Reddit API. Select “I’m a Developer” and “I want to register to use the Reddit API.”

I assume that's an old requirement? Does this actually matter, is it just to harvest data or red flag obvious commercial usage? The form wants to know the name of the app, its function etc. and OAuth ID(s).

→ More replies (3)

2

u/Anomalousity Jul 01 '23

OP you and everybody involved with this are absolute LEGENDS. I really thought i was gonna have to sunset my mobile reddit use after tomorrow but as it stands i followed everything in this guide and so far, so good. We will see how well it works beyond this API apocalypse...If it does you can expect a fatass reward coming your way. o7 sir!

2

u/FDisk80 Jul 01 '23

Ok it logged in. But it shows just my regular username not "{YourRedditUsername}-app". With the app at the end I mean.

Is this fine, or I missed a step?

→ More replies (4)

2

u/0siribix Jul 01 '23

Very well done! If I was willing to give reddit money, you would be the recipient of my first reward. TYVM

2

u/LosdaVS Jul 02 '23

i came across this post after wondering that the infinity app was still working after 1.July, this is just the best. i count myself lucky that i always preferred the infinity app for years after trying ALL others. infinity has exactly the features and GUI i want and i am happy that i can continue to use it thanks to an amazing dev and this awesome community :)

2

u/DroidTweeker Jul 05 '23

how do i download it, sorry hella confused

→ More replies (3)

2

u/Infunsionist Jul 18 '23

mv: cannot stat '/content/Infinity-For-Reddit/app/build/outputs/apk/release/app*.apk': No such file or directory

---------------------------------------------------------------------------

FileNotFoundError Traceback (most recent call last)

<ipython-input-10-a1659de042d3> in <cell line: 14>()

14 if dl == "[.apk Direct Download]":

15 from google.colab import files

---> 16 files.download('/content/Infinity.apk')

17 else:

18 get_ipython().system('pip install requests pyqrcode pypng')

/usr/local/lib/python3.10/dist-packages/google/colab/files.py in download(filename)

223 if not _os.path.exists(filename):

224 msg = 'Cannot find file: {}'.format(filename)

--> 225 raise FileNotFoundError(msg) # pylint: disable=undefined-variable

226

227 comm_manager = _IPython.get_ipython().kernel.comm_manager

FileNotFoundError: Cannot find file: /content/Infinity.apk

Got this error when trying downloading the apk ? what should i do ? the 1st and 2nd step proceed successfully

→ More replies (1)

2

u/amenotef Aug 28 '23

Thanks for this. It worked fine here. Now I'll wait for official Infinity api to go down and then I guess I'll switch from Infinity+ to this apk created by this tutorial.

I already shifted 70% of old Reddit time to Lemmy (using Eternity which is an Infinity fork for Lemmy). But still use Reddit every day.

2

u/survivalking4 Sep 02 '23

Has anyone gotten this to work on Google pixel? It keeps saying "something went wrong, app not installed" when I open the apk

2

u/Chair42 Sep 06 '23

Just went through this process after they finally put up the paywall. It works great! Thank you!

2

u/CrabDistinct8361 Sep 08 '23

Could you please tell me why the 4th step is intended to fail and what does it mean?

→ More replies (1)

2

u/DesperateEmphasis340 Sep 08 '23

: name 'api_token' is not defined

2

u/delete_this_nephew Sep 10 '23

Is this still working? I'm getting "Error loading posts"

→ More replies (1)