Skip to content

Refactor Samsung devices install guide#7130

Merged
topjohnwu merged 2 commits intotopjohnwu:masterfrom
salvogiangri:docs
Aug 19, 2023
Merged

Refactor Samsung devices install guide#7130
topjohnwu merged 2 commits intotopjohnwu:masterfrom
salvogiangri:docs

Conversation

@salvogiangri
Copy link
Copy Markdown
Contributor

@salvogiangri salvogiangri commented Jun 29, 2023

close #7122

Signed-off-by: BlackMesa123 <giangrecosalvo9@gmail.com>
@osm0sis osm0sis added the documentation Relates to a documentation change label Jun 30, 2023
@yujincheng08 yujincheng08 linked an issue Jul 1, 2023 that may be closed by this pull request
@pndwal
Copy link
Copy Markdown
Contributor

pndwal commented Jul 4, 2023

Not sure if everything for Samsung SAR+ should now be under a general "Samsung" heading...

For example, are the extra wipes prescribed required for devices with launch versions less than Android 9? - I believe Vaultkeeper was only introduced with S10 series and A9...

If devices with launch versions less than A9 are upgrading to A10+, they are converted from "legacy SAR" to modern "2SI ramdosk SAR" however...

@salvogiangri
Copy link
Copy Markdown
Contributor Author

Not sure if everything for Samsung SAR+ should now be under a general "Samsung" heading...

There's nothing specific to SAR+ devices in the Samsung guide, it can be used on legacy devices as well since the steps are exactly the same, tested myself on my old Galaxy S8+ running Android 9.

For example, are the extra wipes prescribed required for devices with launch versions less than Android 9?

The two-steps bootloader unlock (RPMB) has been introduced since the S10 series with AVB 2.0 (iirc), on older devices you only have to enable "OEM unlocking" in Developer Options. However formatting the data partition is required the first time Magisk is installed if the device does have data encryption in place (both FDE or FBE) as I explained here.

I believe Vaultkeeper was only introduced with S10 series and A9...

KnoxGuard/RMM has been a thing in Samsung devices since 2018. The only thing you need to account is that the device is either not completely locked or temporarely locked, since the bootloader will refuse to load a custom kernel regardless of the bootloader lock state (you'll get the Custom binary blocked due to remaining installment balance error). There are various guides around the web (eg. XDA) that claim you can actually bypass the 168h timer in the device and restore KG State from Prenormal to Completed.

Signed-off-by: BlackMesa123 <giangrecosalvo9@gmail.com>
@pndwal
Copy link
Copy Markdown
Contributor

pndwal commented Jul 8, 2023

Does line 121 mean:
confirm that the OEM unlocking option exists, is enabled and is grayed out. ... Just a guess. 🙃

@salvogiangri
Copy link
Copy Markdown
Contributor Author

salvogiangri commented Jul 8, 2023

Does line 121 mean: confirm that the OEM unlocking option exists, is enabled and is grayed out. ... Just a guess. 🙃

I did copy back the original line I deleted in the first commit, so it's the same as before:

- Enable developer options, and **confirm that the OEM unlocking option exists and is grayed out.** This means the `VaultKeeper` service has unleashed the bootloader.

Didn't apply any modification to it since it is correct. The OEM Unlock toggle will not be visible if these conditions aren't respected:

@Override
public boolean isAvailable() {
    return showEnableOemUnlockPreference(mContext) && // Device supports OEM unlocking
    	!KnoxGuardManager.getInstance().shouldBlockCustomRom() && // KG is not Prenormal, Active or Locked
    	mOemLockManager != null; // Device is not LDU or has eng firmware
}

and will be grayed out if the bootloader has been unlocked in Download Mode:

@Override
public void updateState(Preference preference) {
    // ...
    // KG is Prenormal, Active or Locked
    // The toggle won't be visible anyway because this check is also in isAvailable()
    if (KnoxGuardManager.getInstance().shouldBlockCustomRom()) {
        mPreference.setEnabled(false);
    } else {
        mPreference.setEnabled(enableOemUnlockPreference()); // false if bootloader is unlocked
    }
    // ...
}

@pndwal
Copy link
Copy Markdown
Contributor

pndwal commented Jul 8, 2023

Ah, that's clear, thanks... I don't have Sammy device to check but assume toggle does show enabled though greyed out...

Still concerned about the wording if instructions are not just for 9+ Launch Version (SAR+) Samsung however...

"Enable developer options, and confirm that the OEM unlocking option exists and is grayed out. This means the VaultKeeper service has unleashed the bootloader" would have applied to all SAR devices, and you do now refer to KnoxGuard which covers Android 7+ LV devices if I understand you comments linked above correctly... 👍

Guess 9+ devices with VaultKeeper retain KnoxGuard too, and toggle behaviour is the same then...

I'm wondering if older devices get VaultKeeper or KnoxGuard with updates... Suspect it's LV dependant.

Seems a note to cover old devices running A6 (some devices will only have stock ROMs up to A6 available) will be needed as KnoxGuard reference won't apply to these and wipes may be superfluous as well as caveats about unrooting etc... You'll know if older devices updated to A7+ are affected by KnoxGuard etc, or prone to bricking if images are restored to stock.

Also, I know older devices had AP binary, but not all 4 binaries mentioned for SAR devices... 🙃

@salvogiangri
Copy link
Copy Markdown
Contributor Author

Ah, that's clear, thanks... I don't have Sammy device to check but assume toggle does show enabled though greyed out...

The fact the toggle is enabled while being grayed out is taken for granted since as I said in #7130 (comment) the toggle is grayed out when the bootloader is fully unlocked (it can't be disabled back if you first do not lock your bootloader again via Download mode).

Still concerned about the wording if instructions are not just for 9+ Launch Version (SAR+) Samsung however...

"Enable developer options, and confirm that the OEM unlocking option exists and is grayed out. This means the VaultKeeper service has unleashed the bootloader" would have applied to all SAR devices, and you do now refer to KnoxGuard which covers Android 7+ LV devices if I understand you comments linked above correctly... +1

Guess 9+ devices with VaultKeeper retain KnoxGuard too, and toggle behaviour is the same then...

I'm wondering if older devices get VaultKeeper or KnoxGuard with updates... Suspect it's LV dependant.

The wording in the current guide are wrong, which is what I've fixed with my PR (other than adding how to identify if your device is locked). VaultKeeper is actually a security system service used to read/write data in the device's RPMB, which is then used by other system services such as KnoxGuard. KnoxGuard is the actual security feature that prevents flashing unsigned firmware images, and it also does more than that, you can check Samsung Knox documentation for more info. Older versions of this feature are named RMM (Remote Mobile Manager), the name is different but it's the exact same. Again, this has nothing to do with the device having SAR, but with the current running Android and Knox version the device is running on.

Seems a note to cover old devices running A6 (some devices will only have stock ROMs up to A6 available) will be needed as KnoxGuard reference won't apply to these and wipes may be superfluous as well as caveats about unrooting etc... You'll know if older devices updated to A7+ are affected by KnoxGuard etc, or prone to bricking if images are restored to stock.

The main difference is that legacy devices might not have the "two-steps bootloader unlock" (devices shipped with Android 8 and below) or KG/RMM.

Also, I know older devices had AP binary, but not all 4 binaries mentioned for SAR devices... upside_down_face

Not really an issue since legacy devices with one tar file can be patched without any issue.

@AByakugans
Copy link
Copy Markdown

I am a little bit lost here. What is the correct way to root for example Samsung A51 which was already rooted before and I need to keep the data? (No wipe data) when Install/update official Samsung Firmware with Odin.

  1. Do I just need to patch AP with Magisk or do I need additional files like to put vbmeta_disabled file in USERDATA slot so AVB remains disabled and my data preserved (from https://forum.xda-developers.com/t/how-to-exynos-snapdragon-root-s20-series-and-upgrade-firmware.4079353/ )
  2. Do I need to use Canary or standard Magisk?

@topjohnwu topjohnwu merged commit 0ba573b into topjohnwu:master Aug 19, 2023
@salvogiangri salvogiangri deleted the docs branch August 19, 2023 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Relates to a documentation change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Magisk doesn't install on Samsung Galaxy Tab S6 Lite

6 participants