notrack patch

This commit is contained in:
clienthax 2020-12-21 23:15:21 +00:00
parent bcdb9e8766
commit 3efcb96735
7 changed files with 237 additions and 1 deletions

View File

@ -25,6 +25,7 @@ public class PatchConfig {
// Can't be changed at runtime
public static final boolean PSEUDONITRO_VIEWER_ENABLED = true;
public static final boolean LITECORD_ENABLED = false; // TODO
public static final boolean NOTRACK_ENABLED = true;
}

View File

@ -0,0 +1,44 @@
package com.discord.utilities.analytics;
import android.app.Activity;
import com.PatchConfig;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexIgnore;
import lanchon.dexpatcher.annotation.DexReplace;
import lanchon.dexpatcher.annotation.DexWrap;
@DexEdit
public class AdjustConfig {
// notrack patches
@DexEdit
private static final String ADJUST_APP_TOKEN = "aaaaaaaaaaaa"; // TODO toggle
@DexEdit
public static final class AdjustLifecycleListener {
@DexWrap
public void onActivityPaused(Activity activity) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
onActivityPaused(activity);
return;
}
}
@DexWrap
public void onActivityResumed(Activity activity) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
onActivityResumed(activity);
return;
}
}
}
}

View File

@ -10,7 +10,7 @@ import lanchon.dexpatcher.annotation.DexWrap;
@DexEdit
public final class AnalyticSuperProperties {
// disable-mobileindicator patch
// disable-mobileindicator patches
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
@ -22,6 +22,7 @@ public final class AnalyticSuperProperties {
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
private final synchronized void updateSuperProperties(Map map) {
if (!PatchConfig.DISABLE_MOBILE_INDICATOR_ENABLED) {
@ -31,4 +32,44 @@ public final class AnalyticSuperProperties {
}
}
// end of disable-mobileindicator patches
// notrack patches
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
private final void setBaselineProperties() {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
setBaselineProperties();
return;
}
// TODO do we need anything in here?
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final void setAdvertiserId(String str) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
setAdvertiserId(str);
return;
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final void setCampaignProperties(String str) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
setCampaignProperties(str);
return;
}
}
// end of notrack patches
}

View File

@ -0,0 +1,41 @@
package com.discord.utilities.analytics;
import com.PatchConfig;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexWrap;
@DexEdit
public class AnalyticsTracker {
// notrack patches - TODO toggle
@DexEdit
public static final class AdjustEventTracker {
@DexEdit
private static final String EVENT_TOKEN_LOGIN = "aaaaaa";
@DexEdit
private static final String EVENT_TOKEN_REGISTER = "aaaaaa";
@DexWrap
public final void trackLogin() {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
trackLogin();
}
}
@DexWrap
public final void trackRegister() {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
trackRegister();
}
}
}
}

View File

@ -0,0 +1,95 @@
package com.discord.utilities.analytics;
import com.PatchConfig;
import java.util.Map;
import kotlin.Pair;
import kotlin.jvm.functions.Function0;
import lanchon.dexpatcher.annotation.DexEdit;
import lanchon.dexpatcher.annotation.DexWrap;
@DexEdit
public class AnalyticsUtils {
// start of notrack patches
@DexEdit
public static final class Tracker {
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
private final synchronized void drainEventsQueue() {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
drainEventsQueue();
return;
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final synchronized void setTrackingData$default(Tracker tracker, String str, boolean z, int i, Object obj) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
setTrackingData$default(tracker, str, z, i, obj);
return;
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final synchronized void track$default(Tracker tracker, String str, Map map, int i, Object obj) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
track$default(tracker, str, map, i, obj);
return;
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final synchronized void setTrackingData(String str, boolean z) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
setTrackingData(str, z);
return;
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final void track(String str, Map map) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
track(str, map);
return;
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final void track(Pair pair, long j, Function0 function0) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
track(pair, j, function0);
return;
}
}
@SuppressWarnings("UnnecessaryReturnStatement")
@DexWrap
public final void trackFireBase(String str, Map map) {
if (!PatchConfig.NOTRACK_ENABLED) {
// Patch not enabled
trackFireBase(str, map);
return;
}
}
}
// end of notrack patches
}

View File

@ -0,0 +1,7 @@
package kotlin;
import lanchon.dexpatcher.annotation.DexIgnore;
@DexIgnore
public class Pair {
}

View File

@ -0,0 +1,7 @@
package kotlin.jvm.functions;
import lanchon.dexpatcher.annotation.DexIgnore;
@DexIgnore
public class Function0 {
}