@@ -2,12 +2,13 @@ use crate::consts::{MAGISK_FULL_VER, MAGISK_PROC_CON, MAIN_CONFIG, ROOTMNT, ROOT
22use crate :: db:: Sqlite3 ;
33use crate :: ffi:: {
44 DbEntryKey , ModuleInfo , RequestCode , check_key_combo, exec_common_scripts, exec_module_scripts,
5- get_magisk_tmp, get_prop , initialize_denylist, set_prop , setup_magisk_env,
5+ get_magisk_tmp, initialize_denylist, setup_magisk_env,
66} ;
77use crate :: logging:: { magisk_logging, setup_logfile, start_log_daemon} ;
88use crate :: module:: disable_modules;
99use crate :: mount:: { clean_mounts, setup_preinit_dir} ;
1010use crate :: package:: ManagerInfo ;
11+ use crate :: resetprop:: { get_prop, set_prop} ;
1112use crate :: selinux:: restore_tmpcon;
1213use crate :: su:: SuInfo ;
1314use crate :: zygisk:: ZygiskState ;
@@ -121,8 +122,8 @@ impl MagiskD {
121122 . log ( )
122123 . ok ( ) ;
123124 let safe_mode = boot_cnt >= 2
124- || get_prop ( cstr ! ( "persist.sys.safemode" ) , true ) == "1"
125- || get_prop ( cstr ! ( "ro.sys.safemode" ) , false ) == "1"
125+ || get_prop ( cstr ! ( "persist.sys.safemode" ) ) == "1"
126+ || get_prop ( cstr ! ( "ro.sys.safemode" ) ) == "1"
126127 || check_key_combo ( ) ;
127128
128129 if safe_mode {
@@ -232,9 +233,9 @@ pub fn daemon_entry() {
232233 magisk_logging ( ) ;
233234 info ! ( "Magisk {} daemon started" , MAGISK_FULL_VER ) ;
234235
235- let is_emulator = get_prop ( cstr ! ( "ro.kernel.qemu" ) , false ) == "1"
236- || get_prop ( cstr ! ( "ro.boot.qemu" ) , false ) == "1"
237- || get_prop ( cstr ! ( "ro.product.device" ) , false ) . contains ( "vsoc" ) ;
236+ let is_emulator = get_prop ( cstr ! ( "ro.kernel.qemu" ) ) == "1"
237+ || get_prop ( cstr ! ( "ro.boot.qemu" ) ) == "1"
238+ || get_prop ( cstr ! ( "ro.product.device" ) ) . contains ( "vsoc" ) ;
238239
239240 // Load config status
240241 let magisk_tmp = get_magisk_tmp ( ) ;
@@ -265,7 +266,7 @@ pub fn daemon_entry() {
265266 }
266267 if sdk_int < 0 {
267268 // In case some devices do not store this info in build.prop, fallback to getprop
268- sdk_int = get_prop ( cstr ! ( "ro.build.version.sdk" ) , false )
269+ sdk_int = get_prop ( cstr ! ( "ro.build.version.sdk" ) )
269270 . parse :: < i32 > ( )
270271 . unwrap_or ( -1 ) ;
271272 }
@@ -278,13 +279,13 @@ pub fn daemon_entry() {
278279 switch_cgroup ( "/acct" , pid) ;
279280 switch_cgroup ( "/dev/cg2_bpf" , pid) ;
280281 switch_cgroup ( "/sys/fs/cgroup" , pid) ;
281- if get_prop ( cstr ! ( "ro.config.per_app_memcg" ) , false ) != "false" {
282+ if get_prop ( cstr ! ( "ro.config.per_app_memcg" ) ) != "false" {
282283 switch_cgroup ( "/dev/memcg/apps" , pid) ;
283284 }
284285
285286 // Samsung workaround #7887
286287 if cstr ! ( "/system_ext/app/mediatek-res/mediatek-res.apk" ) . exists ( ) {
287- set_prop ( cstr ! ( "ro.vendor.mtk_model" ) , cstr ! ( "0" ) , false ) ;
288+ set_prop ( cstr ! ( "ro.vendor.mtk_model" ) , cstr ! ( "0" ) ) ;
288289 }
289290
290291 // Cleanup pre-init mounts
@@ -346,14 +347,14 @@ fn check_data() -> bool {
346347 if !mnt {
347348 return false ;
348349 }
349- let crypto = get_prop ( cstr ! ( "ro.crypto.state" ) , false ) ;
350+ let crypto = get_prop ( cstr ! ( "ro.crypto.state" ) ) ;
350351 return if !crypto. is_empty ( ) {
351352 if crypto != "encrypted" {
352353 // Unencrypted, we can directly access data
353354 true
354355 } else {
355356 // Encrypted, check whether vold is started
356- !get_prop ( cstr ! ( "init.svc.vold" ) , false ) . is_empty ( )
357+ !get_prop ( cstr ! ( "init.svc.vold" ) ) . is_empty ( )
357358 }
358359 } else {
359360 // ro.crypto.state is not set, assume it's unencrypted
0 commit comments