Closed jesec closed 8 years ago
(this sounds stupid from Samsung, is this for real?) I'm not a fan of that at all.
I see two possibilities:
yeah it's pretty stupid, here's how i do it for simplicity's sake: https://github.com/jcadduono/lazyflasher/commit/f7235f74394bebceee2253ce92e2d706ef834607
I don't extract properties at the moment, but that could be useful anyway Thanks
SELinux contexts of some CM-based ROMs won't contain KNOX. BL(not system) detect this string and pop warning. Hence, solution 1 is not effective.
About solution 2: if (is_samsung_phone && not_contain_seandroidenforce) problem_remained; /* Congratulations */
jcadduono's solution is effective but it needs "getprop". My solution is the most simple way.(and it won't brick support to other devices, as I mentioned.)
I've seen so many weird bootloaders I wouldn't bet on it. Especially, this place would be where bootloader put signatures. If it tries to read this as signature, it might well crash. Additionnally, since Samsung found clever to put something there, why wouldn't some other OEMs? I'm fairly confident you haven't tested this on both Allwinner, Mediatek, Rockchip and Spreadtrum devices. (Granted, rockchip devices aren't supported ATM)
@jcadduono Just to be sure, your getprop reads system/build.prop, not default.prop?
It reads default.prop (of TWRP) and getprop is included in TWRP.
I suppose you could also choose to check both default.prop in the boot ramdisk and /system/build.prop.
grep -iq 'ro.product.manufacturer=samsung' *.prop
would definitely do the trick in both those cases.
If you want to get really into the grep,
grep -iq '^\s*ro\.product\.\(brand\|manufacturer\)\s*=\s*samsung\s*$' *.prop
is nice too. (check both brand and manufacturer, at least one of them should be set! and ignore extra legal whitespace and dots who are not really dots)
That prop should be properly set on all Samsung devices I know of, and I maintain at least 60% of them lol. It is included by PRODUCT_MANUFACTURER := samsung in any of the mk files, usually omni_device.mk or cm.mk
I use grep -iq because some devs may have made it Samsung or SAMSUNG instead of samsung.
Oh right, nice, thanks
@phhusson That's possible, admittedly. I will submit another commit based on jcadd's way soon. Also i will submit a commit that adds LZ4-compressed ramdisk support.