Fix F2FS crashes on SQLite 3.21.0

This commit is contained in:
topjohnwu
2018-02-18 18:12:12 +08:00
parent 74379150a1
commit c1423ca9ad
3 changed files with 57 additions and 42 deletions
+14 -3
View File
@@ -3,17 +3,28 @@ sudb_clean() {
local DIR="/sbin/.core/db-${USERID}"
umount -l /data/user*/*/*/databases/su.db $DIR $DIR/*
rm -rf $DIR
[ "$USERID" = "*" ] && rm -f /data/adb/magisk.db
}
sudb_init() {
ADB_CONTEXT=`/system/bin/ls -dZ /data/adb | awk '{print $1}'`
chcon u:object_r:su_file:s0 /data/adb
chmod 777 /data/adb
}
sudb_restore() {
chcon $ADB_CONTEXT /data/adb
chmod 700 /data/adb
}
sudb_setup() {
local USER=$1
local GLOBAL_DB=$2
local USERID=$(($USER / 100000))
local DIR=/sbin/.core/db-${USERID}
touch $GLOBAL_DB
mkdir -p $DIR
touch $DIR/magisk.db
mount -o bind $GLOBAL_DB $DIR/magisk.db
mount -o bind /data/adb/magisk.db $DIR/magisk.db
rm -f /data/adb/magisk.db-journal
chcon u:object_r:su_file:s0 $DIR $DIR/*
chmod 700 $DIR
chown $USER.$USER $DIR