By checking whether the bootloader is unlocked or not. If the bootloader is unlocked, then all bets are off, but if the bootloader is locked, you can only run the original, unmodified firmware. Any alternation to the firmware will result in the dm-verity check failing, causing the system to not boot at all. The only data which can be altered is user data, which is wiped in a factory reset. So a factory ressr definitely gets rid of it.
If you’re paranoid though, you could always flash the stock firmware downloaded directly from the manufacturer’s website, which will override all system partitions, so you can be absolutely sure there’s no spyware - besides the spyware included by Google etc of course, or the spyware embedded into the hardware by the chip manufacturers…
None of this will save you. The boot loader can be replaced with one that merely pretends to be locked and merely pretends to flash the replacement operating system it’s sent over the USB port.
If the phone has ever been in the custody of someone you don’t trust, you can’t trust anything about it.
Yes it will. There’s no way to bypass it, if there is, that would be a serious security flaw - the kind that would get patched very quickly. There have been some phones which had a vulnerable bootloader that allowed this in the past (eg: OnePlus devices), but there’s no such exploit available for current generation devices
I’d like to see some sources backing up your claim, which is applicable to current generation phones.
There’s no way to bypass it, if there is, that would be a serious security flaw
Those do happen, but it is probably also possible to unlock the boot loader and then replace the boot loader itself with one that merely pretends to be locked. How would you know the difference?
the kind that would get patched very quickly.
Obviously criminals aren’t going to install security patches for vulnerabilities that they are exploiting.
Personally I’m worried to buy a phone that is filled with spyware and adware.
Factory reset, cousin.
On a phone with spyware installed that wouldn’t do anything. There are probably ways to get rid of it, but how can you be sure?
By checking whether the bootloader is unlocked or not. If the bootloader is unlocked, then all bets are off, but if the bootloader is locked, you can only run the original, unmodified firmware. Any alternation to the firmware will result in the dm-verity check failing, causing the system to not boot at all. The only data which can be altered is user data, which is wiped in a factory reset. So a factory ressr definitely gets rid of it.
If you’re paranoid though, you could always flash the stock firmware downloaded directly from the manufacturer’s website, which will override all system partitions, so you can be absolutely sure there’s no spyware - besides the spyware included by Google etc of course, or the spyware embedded into the hardware by the chip manufacturers…
None of this will save you. The boot loader can be replaced with one that merely pretends to be locked and merely pretends to flash the replacement operating system it’s sent over the USB port.
If the phone has ever been in the custody of someone you don’t trust, you can’t trust anything about it.
They said spyware and adware
And?
Those usually are made to persist after factory reset. The phone is rooted and factory reset is modified to not remove the bad software.
And rooting the phone requires an unlocked bootloader, which would present a warning when the phone is booted up.
If you know what you are doing, it won’t.
Yes it will. There’s no way to bypass it, if there is, that would be a serious security flaw - the kind that would get patched very quickly. There have been some phones which had a vulnerable bootloader that allowed this in the past (eg: OnePlus devices), but there’s no such exploit available for current generation devices
I’d like to see some sources backing up your claim, which is applicable to current generation phones.
Those do happen, but it is probably also possible to unlock the boot loader and then replace the boot loader itself with one that merely pretends to be locked. How would you know the difference?
Obviously criminals aren’t going to install security patches for vulnerabilities that they are exploiting.