settings.db is no more in 6. seems there are xml files. use an init script instead
authorGuillaume Castagnino <casta@xwing.info>
Sun, 17 Jan 2016 08:49:21 +0000 (09:49 +0100)
committerGuillaume Castagnino <casta@xwing.info>
Sun, 17 Jan 2016 08:49:21 +0000 (09:49 +0100)
cm-data/10-perso.sh.init [new file with mode: 0755]
cm-data/99-perso.sh.addon [moved from cm-data/99-perso.sh with 81% similarity]
cm.sh

diff --git a/cm-data/10-perso.sh.init b/cm-data/10-perso.sh.init
new file mode 100755 (executable)
index 0000000..e316961
--- /dev/null
@@ -0,0 +1,11 @@
+#!/system/bin/sh
+
+# disable goolge leaks (204 fetch for captive portal detection, google ntp)
+echo "Fix google data leaks and time configuration"
+settings put global captive_portal_server 127.0.0.1
+settings put global captive_portal_detection_enabled 0
+settings put global ntp_server 127.0.0.1
+
+echo "Fix date format"
+settings put system date_format dd-MM-yyyy
+
similarity index 81%
rename from cm-data/99-perso.sh
rename to cm-data/99-perso.sh.addon
index 22a97894b83f3c9e3a4b02d567d3b49af096563c..9cdfe8d7012b8c30cd7858134f937a8137cb608e 100755 (executable)
@@ -17,6 +17,8 @@ export PATH="${PATH}:$S/bin:$S/xbin"
 
 list_files() {
 cat <<EOF
+etc/init.d/10-perso.sh
+etc/init.d/afwallstart
 lib/libjni_latinimegoogle.so
 priv-app/FDroidPrivileged/FDroidPrivileged.apk
 usr/share/zoneinfo/tzdata
@@ -46,13 +48,6 @@ case "$1" in
     # Stub
   ;;
   post-restore)
-    # fix some settings (google data leak and date format)
-    LD_LIBRARY_PATH=$S/lib sqlite3 /data/data/com.android.providers.settings/databases/settings.db <<EOT
-UPDATE global SET value = '127.0.0.1' WHERE name = 'captive_portal_server';
-UPDATE global SET value = '0' WHERE name = 'captive_portal_detection_enabled';
-UPDATE global SET value = '127.0.0.1' WHERE name = 'ntp_server';
-UPDATE system SET value='dd-MM-yyyy' WHERE name='date_format';
-EOT
     # fix dir permissions
     chmod 755 $S/priv-app/FDroidPrivileged || echo "FDroidPrivileged not installed as a system app"
     # remove bloat
diff --git a/cm.sh b/cm.sh
index bcd949494af66ccc3819db880f9d76599b5d4f34..30a4cb81e9b168a994881ecd48215f8d4f581738 100755 (executable)
--- a/cm.sh
+++ b/cm.sh
@@ -19,9 +19,15 @@ cp cm-data/tzdata /system/usr/share/zoneinfo/tzdata
 chown root:root /system/usr/share/zoneinfo/tzdata
 chmod 644 /system/usr/share/zoneinfo/tzdata
 
+# install init script
+echo "Installing init script"
+cp cm-data/10-perso.sh.init /system/etc/init.d/10-perso.sh
+chown root:shell /system/etc/init.d/10-perso.sh
+chmod 755 /system/etc/init.d/10-perso.sh
+
 # install restore script
 echo "Installing restore script"
-cp cm-data/99-perso.sh /system/addon.d/99-perso.sh
+cp cm-data/99-perso.sh.addon /system/addon.d/99-perso.sh
 chown root:root /system/addon.d/99-perso.sh
 chmod 755 /system/addon.d/99-perso.sh