Merge remote-tracking branch 'cyanogenmod/cm-13.0' into replicant-6.0
Signed-off-by: Wolfgang Wiedmeyer <wolfgit@wiedmeyer.de> Conflicts: config/common.mk
This commit is contained in:
commit
f55a720155
@ -15,14 +15,71 @@ if [ $? -eq 0 ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f /data/system/packages.xml -a -f /tmp/releasekey ]; then
|
||||
relCert=$(grep -A3 'package name="com.android.htmlviewer"' /data/system/packages.xml | grep "cert index" | head -n 1 | sed -e 's|.*"\([[:digit:]][[:digit:]]*\)".*|\1|g')
|
||||
if [ -f "/data/system/packages.xml" -a -f "/tmp/releasekey" ]; then
|
||||
relkey=$(cat "/tmp/releasekey")
|
||||
OLDIFS="$IFS"
|
||||
IFS=""
|
||||
while read line; do
|
||||
params=${line# *<package *}
|
||||
if [ "$line" != "$params" ]; then
|
||||
kvp=${params%% *}
|
||||
params=${params#* }
|
||||
while [ "$kvp" != "$params" ]; do
|
||||
key=${kvp%%=*}
|
||||
val=${kvp#*=}
|
||||
vlen=$(( ${#val} - 2 ))
|
||||
val=${val:1:$vlen}
|
||||
if [ "$key" = "name" ]; then
|
||||
package="$val"
|
||||
fi
|
||||
kvp=${params%% *}
|
||||
params=${params#* }
|
||||
done
|
||||
continue
|
||||
fi
|
||||
params=${line# *<cert *}
|
||||
if [ "$line" != "$params" ]; then
|
||||
keyidx=""
|
||||
keyval=""
|
||||
kvp=${params%% *}
|
||||
params=${params#* }
|
||||
while [ "$kvp" != "$params" ]; do
|
||||
key=${kvp%%=*}
|
||||
val=${kvp#*=}
|
||||
vlen=$(( ${#val} - 2 ))
|
||||
val=${val:1:$vlen}
|
||||
if [ "$key" = "index" ]; then
|
||||
keyidx="$val"
|
||||
fi
|
||||
if [ "$key" = "key" ]; then
|
||||
keyval="$val"
|
||||
fi
|
||||
kvp=${params%% *}
|
||||
params=${params#* }
|
||||
done
|
||||
if [ -n "$keyidx" ]; then
|
||||
if [ "$package" = "com.android.htmlviewer" ]; then
|
||||
cert_idx="$keyidx"
|
||||
fi
|
||||
fi
|
||||
if [ -n "$keyval" ]; then
|
||||
eval "key_$keyidx=$keyval"
|
||||
fi
|
||||
continue
|
||||
fi
|
||||
done < "/data/system/packages.xml"
|
||||
IFS="$OLDIFS"
|
||||
|
||||
# Tools missing? Err on the side of caution and exit cleanly
|
||||
if [ "z$relCert" == "z" ]; then exit 0; fi
|
||||
if [ -z "$cert_idx" ]; then
|
||||
echo "Package cert index not found; skipping signature check..."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
grep "cert index=\"$relCert\"" /data/system/packages.xml | grep -q `cat /tmp/releasekey`
|
||||
if [ $? -ne 0 ]; then
|
||||
varname="key_$cert_idx"
|
||||
eval "pkgkey=\$$varname"
|
||||
|
||||
if [ "$pkgkey" != "$relkey" ]; then
|
||||
echo "You have an installed system that isn't signed with this build's key, aborting..."
|
||||
exit 124
|
||||
fi
|
||||
|
@ -139,6 +139,9 @@ service bugreport /system/bin/dumpstate -d -p -B \
|
||||
keycodes 114 115 116
|
||||
|
||||
# adb over network
|
||||
on property:adb.network.port=*
|
||||
setprop service.adb.tcp.port ${adb.network.port}
|
||||
|
||||
on property:service.adb.tcp.port=5555
|
||||
stop adbd
|
||||
start adbd
|
||||
|
@ -1 +0,0 @@
|
||||
allow adbd adbtcp_prop:property_service set;
|
@ -14,6 +14,9 @@
|
||||
/system/etc/init.d/90userinit u:object_r:userinit_exec:s0
|
||||
/data/local/userinit.sh u:object_r:userinit_data_exec:s0
|
||||
|
||||
# For F2FS partitions marked "formattable"
|
||||
/system/bin/mkfs\.f2fs u:object_r:mkfs_exec:s0
|
||||
|
||||
# For minivold in recovery
|
||||
/sbin/minivold u:object_r:vold_exec:s0
|
||||
|
||||
|
4
sepolicy/init.te
Normal file
4
sepolicy/init.te
Normal file
@ -0,0 +1,4 @@
|
||||
# Allow formatting userdata or cache partitions
|
||||
allow init block_device:dir search;
|
||||
allow init userdata_block_device:blk_file rw_file_perms;
|
||||
allow init cache_block_device:blk_file rw_file_perms;
|
9
sepolicy/mkfs.te
Normal file
9
sepolicy/mkfs.te
Normal file
@ -0,0 +1,9 @@
|
||||
type mkfs, domain;
|
||||
type mkfs_exec, exec_type, file_type;
|
||||
|
||||
init_daemon_domain(mkfs)
|
||||
|
||||
# Allow formatting userdata or cache partitions
|
||||
allow mkfs block_device:dir search;
|
||||
allow mkfs userdata_block_device:blk_file rw_file_perms;
|
||||
allow mkfs cache_block_device:blk_file rw_file_perms;
|
@ -1,4 +1,4 @@
|
||||
service.adb.tcp.port u:object_r:adbtcp_prop:s0
|
||||
adb.network.port u:object_r:adbtcp_prop:s0
|
||||
recovery.perf.mode u:object_r:recovery_prop:s0
|
||||
adb.secure u:object_r:recovery_prop:s0
|
||||
cm.userinit.active u:object_r:userinit_prop:s0
|
||||
|
@ -1 +0,0 @@
|
||||
allow shell adbtcp_prop:property_service set;
|
Loading…
Reference in New Issue
Block a user