From 2f83290a8986eaa56c21b72116d8f9520d22693a Mon Sep 17 00:00:00 2001 From: Simon Sickle Date: Sat, 25 Nov 2017 03:40:26 -0600 Subject: [PATCH] crypto from /system/ Signed-off-by: Simon Sickle --- recovery/root/init.recovery.qcom.rc | 28 +++------ recovery/root/sbin/qseecomd | Bin 14880 -> 14880 bytes recovery/root/sbin/setup_decrypt | 89 ---------------------------- 3 files changed, 7 insertions(+), 110 deletions(-) mode change 100755 => 100644 recovery/root/sbin/qseecomd delete mode 100644 recovery/root/sbin/setup_decrypt diff --git a/recovery/root/init.recovery.qcom.rc b/recovery/root/init.recovery.qcom.rc index 6abd135..cecd696 100644 --- a/recovery/root/init.recovery.qcom.rc +++ b/recovery/root/init.recovery.qcom.rc @@ -32,21 +32,11 @@ on init chmod 0664 /dev/ion chown system system /dev/ion -on early-fs - start setup-decrypt - on fs wait /dev/block/platform/soc/1da4000.ufshc symlink /dev/block/platform/soc/1da4000.ufshc /dev/block/bootdevice install_keyring -on boot - # save battery by switching to interactive once booted - write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive - write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive - write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive - write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive - service qseecomd /sbin/qseecomd oneshot disabled @@ -54,14 +44,10 @@ service qseecomd /sbin/qseecomd group root seclabel u:r:recovery:s0 -# use decryption libraries from /system if available -service setup-decrypt /sbin/setup_decrypt - oneshot - disabled - user root - group root - seclabel u:r:recovery:s0 - -on property:ro.crypto.state=encrypted - start qseecomd - +on boot + # save battery by switching to interactive once booted + write /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor interactive + write /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor interactive + write /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor interactive + write /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor interactive + start sbinqseecomd \ No newline at end of file diff --git a/recovery/root/sbin/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s);SxPC z&FO+f)A$_GSx%QFdLG{*dX-b?1onu#x{jX^{hiY)iOyn<=nAJT61|G$rFx(^Xjklz zsD_TX=3tqP?hi^}y?#rX@OrtwhCCmnC`> z`-o2R+^j^?Xb`=`>6%1mGxOeMXVLL`BYX`%D%X`R{HA=TlEqq0e|V+d$hLv8R1A>= zrg<`@KvV%phM^(TqwQ0Q${LKW&G?1y8Ma$MS4FqW(#jsgo{B9Vt-)|mc-J1Btf+H9 zBVPKSsQH-~_pfK^pW$AAok&0CuVrEsXZ%678^`bbI@>*kfB4(kZVsC&&#~Pu{H?N% z?LzpF9&EIx@IG!d0#szxU?ison>0E>7VHyPV}-4lReVwJ<`pLO>V%~of6~Yn2P4)0 zm?y2%7Gf8gneHcjW_0h`JC2fX_j}=UfD!FNH!R+Nv-8Yq&&AVo>dQag992IxtKlnm z+o|WbIa7DsuZT=h4?5vssRA#syW8AK zO(C*&pN6MTQA@!&)6^OJ#b&pO_0!?#hfZ1p!+699uSE=<7iI_Wwi#X9+l;IV#tpSH zQb7zH4_t=D2ip>b0IwCmzjxsV-lGC^Ge1y67u{^3VOf+l{F`(i4e*Be@UKMK@Hy2t zbD5aM+2CLQr(Yz^8p=B0U3Dik?YL*MpRCaI$P=vT4b|6lj)DqJoiQUk5i^!ZzeV~4 z-O8V|vIglEmh&OKQ}M{H%-excmvR_Ap=RZK+!P8HZT-tMm+_@gLzVlkX^xquIeyPH zzohk1BG+imOofh=W2QIOmWkY~w=SQK6UHK)7X^ z>%t#-S|Ja14D_KhQmbst)J5KRDjhf /dev/kmsg) 2> /dev/null -} - -abort() { - log "Error: $*" - setprop ro.crypto.using_system_libs 0 - exit 1 -} - -restart_crypto() { - crypto_state=$(getprop ro.crypto.state) - qsee_state=$(getprop init.svc.qseecomd) - - [ "$qsee_state" = "running" ] && { - log "Stopping qseecomd" - stop qseecomd - } - [ "$crypto_state" = "encrypted" ] && { - log "Starting qseecomd" - start qseecomd - } -} - -mountpoint -q /system || { - mkdir -p /system - log "Mounting /system read-only" - mount -t ext4 -o ro /dev/block/bootdevice/by-name/system /system -} -mountpoint -q /system || abort "Could not mount /system for crypto libs!" - -bin=/system/bin -lib=/system/vendor/lib64 -hw=$lib/hw - -ready=true - -for f in \ - "$bin/qseecomd" \ - "$hw/keystore.msm8998.so" \ - "$lib/libQSEEComAPI.so" \ - "$lib/libdiag.so" \ - "$lib/libdrmfs.so" \ - "$lib/libdrmtime.so" \ - "$lib/librpmb.so" \ - "$lib/libssd.so" \ - "$lib/libtime_genoff.so" -do - [ -f "$f" ] && continue - - log "Could not find crypto file: $f" - ready=false -done - -$ready || abort "Missing one or more decryption libraries!" - -mkdir -p /vendor/lib64/hw/ - -log "Copying decryption libraries from /system" -cp -f \ - "$bin/qseecomd" \ - "$hw/keystore.msm8998.so" \ - "$lib/libQSEEComAPI.so" \ - "$lib/libdiag.so" \ - "$lib/libdrmfs.so" \ - "$lib/libdrmtime.so" \ - "$lib/librpmb.so" \ - "$lib/libssd.so" \ - "$lib/libtime_genoff.so" \ - /sbin/ - -cp -f "$hw/keystore.msm8998.so" /vendor/lib64/hw/ -cp -f "$lib/libQSEEComAPI.so" /vendor/lib64/ - -chmod 0750 /sbin/qseecomd - -# we have to link qseecomd to /sbin/linker64 because /system is unmounted when it starts -sed -i "s|/system/bin/linker|///////sbin/linker|" /sbin/qseecomd - -setprop ro.crypto.using_system_libs 1 - -log "Using system decryption libraries!" - -restart_crypto - -exit 0 -- 2.20.1