INNER CODE UNIT · Kotlin
restoreBlurSettings
Mahmud0808/Iconify · app/src/main/java/com/drdisagree/iconify/helpers/BackupRestore.kt:85
private fun restoreBlurSettings() {
if (isBlurEnabled) {
enableBlur()
}
}
private val isBlurEnabled: Boolean
get() {
val outs = Shell.cmd(
"if grep -q \"ro.surface_flinger.supports_background_blur=1\" $TEMP_MODULE_DIR/system.prop; then echo yes; else echo no; fi"
).exec().out
return outs[0] == "yes"
}
private fun disableBlur() {
Shell.cmd(
"mv $TEMP_MODULE_DIR/system.prop $TEMP_MODULE_DIR/system.txt; grep -v \"ro.surface_flinger.supports_background_blur\" $TEMP_MODULE_DIR/system.txt > $TEMP_MODULE_DIR/system.txt.tmp; rm -rf $TEMP_MODULE_DIR/system.prop; mv $TEMP_MODULE_DIR/system.txt.tmp $TEMP_MODULE_DIR/system.prop; rm -rf $TEMP_MODULE_DIR/system.txt; rm -rf $TEMP_MODULE_DIR/system.txt.tmp"
).exec()