mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-19 01:27:18 -04:00
(1/?) Move Session ID filter
This commit is contained in:
parent
20d7fa383a
commit
2af8f54687
@ -109,9 +109,8 @@ public class JREUtils
|
|||||||
jreReleaseReader.close();
|
jreReleaseReader.close();
|
||||||
return jreReleaseMap;
|
return jreReleaseMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean checkAccessTokenLeak = true;
|
public static void redirectAndPrintJRELog(final LoggableActivity act) {
|
||||||
public static void redirectAndPrintJRELog(final LoggableActivity act, final String accessToken) {
|
|
||||||
Log.v("jrelog","Log starts here");
|
Log.v("jrelog","Log starts here");
|
||||||
JREUtils.logToActivity(act);
|
JREUtils.logToActivity(act);
|
||||||
Thread t = new Thread(new Runnable(){
|
Thread t = new Thread(new Runnable(){
|
||||||
@ -143,16 +142,6 @@ public class JREUtils
|
|||||||
int len;
|
int len;
|
||||||
while ((len = p.getInputStream().read(buf)) != -1) {
|
while ((len = p.getInputStream().read(buf)) != -1) {
|
||||||
String currStr = new String(buf, 0, len);
|
String currStr = new String(buf, 0, len);
|
||||||
|
|
||||||
// Avoid leaking access token to log by replace it.
|
|
||||||
// Also, Minecraft will just print it once.
|
|
||||||
if (checkAccessTokenLeak) {
|
|
||||||
if (accessToken != null && accessToken.length() > 5 && currStr.contains(accessToken)) {
|
|
||||||
checkAccessTokenLeak = false;
|
|
||||||
currStr = currStr.replace(accessToken, "ACCESS_TOKEN_HIDDEN");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
act.appendToLog(currStr);
|
act.appendToLog(currStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user