From eea549a661118252b1b327169c8887b08defa8e8 Mon Sep 17 00:00:00 2001 From: ACh Sulfate Date: Sun, 6 Aug 2023 17:56:46 +0800 Subject: [PATCH] fix: ChangeDpi: -ENOENT --- app/src/main/java/cc/ioctl/hook/ui/misc/ChangeDpi.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/src/main/java/cc/ioctl/hook/ui/misc/ChangeDpi.kt b/app/src/main/java/cc/ioctl/hook/ui/misc/ChangeDpi.kt index ebf50a3926..d0a006a4da 100644 --- a/app/src/main/java/cc/ioctl/hook/ui/misc/ChangeDpi.kt +++ b/app/src/main/java/cc/ioctl/hook/ui/misc/ChangeDpi.kt @@ -148,6 +148,9 @@ object ChangeDpi : CommonConfigFunctionHook() { var targetDpi: Int get() { val file = File(hostInfo.application.filesDir, KEY_TARGET_DPI) + if (!file.exists()) { + return 0; + } try { // read exact 4 bytes, little endian FileInputStream(file).use {