[Android Q&A, Help & Troubleshooting] saulin78:
Hey guys,

I have modded 2-3 Android Apps for Root check and I was able to use them without problem on my rooted device. However this app is giving me a lot of issues. I believe I have found the 2 smali files that have the root check. Does anyone know what needs to be modded or how it needs to be modded on these 2 smali files to bypass the root detection or to make the app believe the device is not rooted?

AppStartMeasurement.smali

.class public Lcom/comscore/applications/AppStartMeasurement;
.super Lcom/comscore/applications/ApplicationMeasurement;

# direct methods
.method protected constructor <init>(Lcom/comscore/analytics/Core;Lcom/comscore/applications/EventType;Ljava/lang/String;Z)V
.locals 5

const/4 v4, 0x0

invoke-direct {p0, p1, p2, p3, p4}, Lcom/comscore/applications/ApplicationMeasurement;-><init>(Lcom/comscore/analytics/Core;Lcom/comscore/applications/EventType;Ljava/lang/String;Z)V

new-instance v0, Lcom/comscore/measurement/Label;

const-string v1, "ns_ap_gs"

invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getFirstInstallId()J

move-result-wide v2

invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

move-result-object v2

invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

move-result-object v3

invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V

invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V

new-instance v0, Lcom/comscore/measurement/Label;

const-string v1, "ns_ap_install"

invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getInstallId()J

move-result-wide v2

invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

move-result-object v2

invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

move-result-object v3

invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V

invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V

new-instance v0, Lcom/comscore/measurement/Label;

const-string v1, "ns_ap_runs"

invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getRunsCount()I

move-result v2

invoke-static {v2}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;

move-result-object v2

invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

move-result-object v3

invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V

invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V

if-eqz p4, :cond_0

new-instance v0, Lcom/comscore/measurement/Label;

const-string v1, "ns_ap_csf"

const-string v2, "1"

invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

move-result-object v3

invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V

invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V

:cond_0
const-string v0, "0"

invoke-static {}, Lcom/comscore/utils/RootDetector;->isDeviceRooted()Z

move-result v1

if-eqz v1, :cond_1

const-string v0, "1"

:cond_1
new-instance v1, Lcom/comscore/measurement/Label;

const-string v2, "ns_ap_jb"

invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

move-result-object v3

invoke-direct {v1, v2, v0, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V

invoke-virtual {p0, v1}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V

new-instance v0, Lcom/comscore/measurement/Label;

const-string v1, "ns_ap_lastrun"

invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getPreviousGenesis()J

move-result-wide v2

invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

move-result-object v2

invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

move-result-object v3

invoke-direct {v0, v1, v2, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V

invoke-virtual {p0, v0}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V

invoke-virtual {p1}, Lcom/comscore/analytics/Core;->getPreviousVersion()Ljava/lang/String;

move-result-object v0

if-eqz v0, :cond_2

invoke-virtual {v0}, Ljava/lang/String;->length()I

move-result v1

if-lez v1, :cond_2

new-instance v1, Lcom/comscore/measurement/Label;

const-string v2, "ns_ap_updated"

invoke-static {v4}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;

move-result-object v3

invoke-direct {v1, v2, v0, v3}, Lcom/comscore/measurement/Label;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)V

invoke-virtual {p0, v1}, Lcom/comscore/applications/AppStartMeasurement;->setLabel(Lcom/comscore/measurement/Label;)V

:cond_2
return-void
.end method

RootDetector.smali

.class public Lcom/comscore/utils/RootDetector;
.super Ljava/lang/Object;

# direct methods
.method public constructor <init>()V
.locals 0

invoke-direct {p0}, Ljava/lang/Object;-><init>()V

return-void
.end method

.method private static a()Z
.locals 2

sget-object v0, Landroid/os/Build;->TAGS:Ljava/lang/String;

if-eqz v0, :cond_0

const-string v1, "test-keys"

invoke-virtual {v0, v1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

move-result v0

if-eqz v0, :cond_0

const/4 v0, 0x1

:goto_0
return v0

:cond_0
const/4 v0, 0x0

goto :goto_0
.end method

.method private static b()Z
.locals 2

:try_start_0
new-instance v0, Ljava/io/File;

const-string v1, "/system/app/Superuser.apk"

invoke-direct {v0, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

invoke-virtual {v0}, Ljava/io/File;->exists()Z
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

move-result v0

if-eqz v0, :cond_0

const/4 v0, 0x1

:goto_0
return v0

:catch_0
move-exception v0

:cond_0
const/4 v0, 0x0

goto :goto_0
.end method

.method public static isDeviceRooted()Z
.locals 2

const/4 v0, 0x1

invoke-static {}, Lcom/comscore/utils/RootDetector;->a()Z

move-result v1

if-eqz v1, :cond_1

:cond_0
:goto_0
return v0

:cond_1
invoke-static {}, Lcom/comscore/utils/RootDetector;->b()Z

move-result v1

if-nez v1, :cond_0

const/4 v0, 0x0

goto :goto_0
.end method