@@ -38,6 +38,7 @@ public class AndroidacyRepoData extends RepoData {
3838 }
3939 // Avoid spamming requests to Androidacy
4040 private long androidacyBlockade = 0 ;
41+ private String token = null ;
4142
4243 public AndroidacyRepoData (String url , File cacheRoot ,
4344 SharedPreferences cachedPreferences ) {
@@ -82,7 +83,7 @@ protected boolean prepare() {
8283 }
8384 if (token != null ) {
8485 try {
85- Http .doHttpGet ("https://api.androidacy.com/auth/me" , true );
86+ Http .doHttpGet ("https://api.androidacy.com/auth/me?token=" + token , true );
8687 } catch (Exception e ) {
8788 if ("Received error code: 419" .equals (e .getMessage ()) ||
8889 "Received error code: 429" .equals (e .getMessage ())) {
@@ -99,7 +100,7 @@ protected boolean prepare() {
99100 Http .getCookieJar ().saveFromResponse (
100101 OK_HTTP_URL , Collections .emptyList ());
101102 }
102- token = null ;
103+ this . token = token = null ;
103104 }
104105 }
105106 if (token == null ) {
@@ -130,6 +131,7 @@ protected boolean prepare() {
130131 return false ;
131132 }
132133 }
134+ this .token = token ;
133135 return true ;
134136 }
135137
@@ -250,4 +252,10 @@ public boolean tryLoadMetadata(RepoModule repoModule) {
250252 ModuleInfo .FLAG_METADATA_INVALID ;
251253 return false ;
252254 }
255+
256+ @ Override
257+ public String getUrl () {
258+ return this .token == null ? this .url :
259+ this .url + "?token=" + this .token ;
260+ }
253261}
0 commit comments