Fix adbd on devices with integrity check
Some devices (Like Samsung Galaxy J6) has integrity check. This means that all files outside of /system are signed by the OEM. Since we replaced /sbin/adbd, that's an issue. Workaround this by creating a new service, called adbd_system, which will called instead of /sbin/adbd when needed
This commit is contained in:
parent
c2b6687a5a
commit
82aeb3d402
3
base.mk
3
base.mk
@ -101,3 +101,6 @@ SELINUX_IGNORE_NEVERALLOWS := true
|
||||
# Universal NoCutoutOverlay
|
||||
PRODUCT_PACKAGES += \
|
||||
NoCutoutOverlay
|
||||
|
||||
PRODUCT_COPY_FILES += \
|
||||
device/phh/treble/files/adbd.rc:system/etc/init/adbd.rc
|
||||
|
8
files/adbd.rc
Normal file
8
files/adbd.rc
Normal file
@ -0,0 +1,8 @@
|
||||
service adbd_system /system/bin/adbd --root_seclabel=u:r:su:s0
|
||||
class core
|
||||
socket adbd stream 660 system system
|
||||
disabled
|
||||
seclabel u:r:adbd:s0
|
||||
|
||||
on property:sys.usb.state=adb && property:sys.phh.five=true
|
||||
start adbd_system
|
@ -19,3 +19,6 @@ allow vndk_detect self:capability { sys_admin };
|
||||
#mount -o bind /system/etc/usb_audio_policy_configuration.xml /vendor/etc/usb_audio_policy_configuration.xml
|
||||
allow init vendor_configs_file:file { getattr mounton };
|
||||
|
||||
#/sys/module/five
|
||||
allow vndk_detect sysfs:file r_file_perms;
|
||||
allow vndk_detect sysfs:dir r_dir_perms;
|
||||
|
@ -9,7 +9,12 @@ while read version;do
|
||||
setprop persist.sys.vndk $version
|
||||
done
|
||||
|
||||
mount -o bind /system/bin/adbd /sbin/adbd
|
||||
if [ -d /sys/module/five ];then
|
||||
mount -o bind /system/phh/empty /sbin/adbd
|
||||
setprop sys.phh.five true
|
||||
else
|
||||
mount -o bind /system/bin/adbd /sbin/adbd
|
||||
fi
|
||||
if ( getprop ro.hardware | grep -qE '(kirin970|hi3660|hi6250|hi3670)' );then
|
||||
FOUND_HUAWEI=1
|
||||
setprop persist.sys.bt_acl_bypass true
|
||||
|
Loading…
Reference in New Issue
Block a user