[Android General] Lordify95:
Hello!

First, i would like to say "Thanks!" for this thread and the patches written here!

I have an older J7 (J730F) with stock Pie. I would like to patch the SecureFolder, WorkProfile to work. I followed the guide and i think as an additional extra i should patch also the "device status: custom" to "official".

All i know is that i have to modify the SysScope method in secSetteings.apk. I tried the search feature here, but found nothing, only mentions about "sysScope" and "secSettings".

Edit: i found a .smali called SyscopeStatusPreferenceController.smali.

Probably i should edit one of these methods, if not all of them...

.method private changeSysScopeStatus()V
.locals 8

.line 54
iget-object v0, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

const v1, 0x7f121af9

invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v0

.line 55
.local v0, "status":Ljava/lang/String;
const/4 v1, 0x0

.line 57
.local v1, "isAvoidRootVisible":Z
iget-object v2, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-static {v2}, Lcom/samsung/android/settings/deviceinfo/SecDeviceInfoUtils;->isSepLiteAvailable(Landroid/content/Context;)Z

move-result v2

const v3, 0x7f121a3b

const v4, 0x7f121a39

if-eqz v2, :cond_1

.line 58
const-string v2, "ro.boot.flash.locked"

invoke-static {v2}, Landroid/os/SystemProperties;->get(Ljava/lang/String;)Ljava/lang/String;

move-result-object v2

.line 59
.local v2, "deviceStatus":Ljava/lang/String;
const-string v5, "SyscopeStatusPreferenceController"

new-instance v6, Ljava/lang/StringBuilder;

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

const-string v7, "device status : "

invoke-virtual {v6, v7}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

invoke-virtual {v6, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

invoke-virtual {v6}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

move-result-object v6

invoke-static {v5, v6}, Lcom/samsung/android/settings/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

.line 60
const-string v5, "1"

invoke-virtual {v5, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

move-result v5

if-eqz v5, :cond_0

.line 61
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v3

invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

move-result-object v0

goto :goto_0

.line 63
:cond_0
iget-object v4, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-virtual {v4}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v4

invoke-virtual {v4, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

move-result-object v0

.line 65
:goto_0
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mPreference:Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;

invoke-virtual {v3, v0}, Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;->setSummary(Ljava/lang/CharSequence;)V

.line 66
return-void

.line 69
.end local v2 # "deviceStatus":Ljava/lang/String;
:cond_1
invoke-direct {p0}, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->getICDVerification()I

move-result v2

.line 70
.local v2, "sysScopeStatus":I
const/4 v5, -0x1

if-ne v2, v5, :cond_2

.line 71
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mPreference:Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;

invoke-virtual {v3, v0}, Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;->setSummary(Ljava/lang/CharSequence;)V

.line 72
const-string v3, "SyscopeStatusPreferenceController"

const-string v4, "Fail to get ICD Verification"

invoke-static {v3, v4}, Lcom/samsung/android/settings/Log;->i(Ljava/lang/String;Ljava/lang/String;)I

.line 73
return-void

.line 81
:cond_2
iget-boolean v5, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mIsSysscopeForChnRoot:Z

const/4 v6, 0x2

const/4 v7, 0x1

if-eqz v5, :cond_5

.line 82
if-eq v2, v6, :cond_4

.line 83
invoke-static {}, Lcom/samsung/android/settings/deviceinfo/SecDeviceInfoUtils;->checkRootingCondition()Z

move-result v3

if-eqz v3, :cond_3

goto :goto_1

.line 86
:cond_3
if-ne v2, v7, :cond_7

.line 87
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-virtual {v3, v4}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v0

.line 88
const/4 v1, 0x0

goto :goto_2

.line 84
:cond_4
:goto_1
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

move-result-object v3

const v4, 0x7f121a3c

new-array v5, v7, [Ljava/lang/Object;

const/4 v6, 0x0

const-string v7, "400-810-5858"

aput-object v7, v5, v6

invoke-virtual {v3, v4, v5}, Landroid/content/res/Resources;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

move-result-object v0

.line 85
const/4 v1, 0x1

goto :goto_2

.line 92
:cond_5
if-ne v2, v6, :cond_6

.line 93
iget-object v4, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-virtual {v4, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v0

goto :goto_2

.line 94
:cond_6
if-ne v2, v7, :cond_7

.line 95
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-virtual {v3, v4}, Landroid/content/Context;->getString(I)Ljava/lang/String;

move-result-object v0

.line 99
:cond_7
:goto_2
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mPreference:Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;

invoke-virtual {v3, v0}, Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;->setSummary(Ljava/lang/CharSequence;)V

.line 100
iget-boolean v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mIsSysscopeForChnRoot:Z

if-eqz v3, :cond_8

.line 101
iget-object v3, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mPreference:Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;

invoke-virtual {v3, v1}, Lcom/samsung/android/settings/deviceinfo/AvoidRootPreference;->setAvoidRootVisible(Z)V

.line 103
:cond_8
return-void
.end method

.method private getICDVerification()I
.locals 2

.line 110
new-instance v0, Lcom/sec/icdverification/ICDVerification;

invoke-direct {v0}, Lcom/sec/icdverification/ICDVerification;-><init>()V

.line 111
.local v0, "_ICDVerification":Lcom/sec/icdverification/ICDVerification;
nop

.line 112
invoke-static {}, Lcom/sec/icdverification/ICDVerification;->check()I

move-result v1

return v1
.end method

.method private isSysscopeForChnRoot()Z
.locals 1

.line 106
iget-object v0, p0, Lcom/samsung/android/settings/deviceinfo/status/SyscopeStatusPreferenceController;->mContext:Landroid/content/Context;

invoke-virtual {v0}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

move-result-object v0

invoke-static {v0}, Lcom/samsung/android/settings/deviceinfo/SecDeviceInfoUtils;->isSupportRootBadge(Landroid/content/Context;)Z

move-result v0

return v0
.end method