Skip to content

Commit

Permalink
【improve】Optimized the logic of enabling App Mask jailbreak detection
Browse files Browse the repository at this point in the history
  • Loading branch information
wwg135 authored Aug 2, 2023
1 parent 9e250d9 commit 432d2fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
echo -e "[点击当前版本下载](https://github.com/wwg135/Dopamine/releases/download/${{ env.msT }}/Dopamine.ipa)" >> body.txt
echo -e "\n更新时间:${{ env.logT }}" >> body.txt
echo -e "\n**当前更新日志如下:**" >> body.txt
echo -e "\n> - 1.维护1.0.5_2更新,1.1以上版本可忽略更新\n> - 2.添加删除自定义App屏蔽越狱检测" >> body.txt
echo -e "\n> - 1.维护1.0.5_2更新,1.1以上版本可忽略更新\n> - 2.优化启用App越狱屏蔽功能逻辑,之前的逻辑有误,建议务必更新" >> body.txt
echo -e "\n1.0.5的修改版功能如下:" >> body.txt
echo -e "**注意:追求稳定,此版本无【桥接心浪】、【映射挂载】、【重建环境】功能**" >> body.txt
echo -e "> - 1、新增【检查更新】功能,设置里面打开即可检查更新,默认关闭!!!" >> body.txt
Expand Down
22 changes: 15 additions & 7 deletions Dopamine/Dopamine/UI/Views/Jailbreak.swift
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,24 @@ func clearTmpDirectory() {
}
}

func changBoolean() {
func changBoolean(_ toggleOn: Bool) {
let fileManager = FileManager.default
let filePath = "/var/mobile/zp.unject.plist"
if fileManager.fileExists(atPath: filePath) {
if var dict = NSMutableDictionary(contentsOfFile: filePath) {
for (key, value) in dict {
if let boolValue = value as? Bool {
dict[key] = !boolValue
}
}
if var dict = NSMutableDictionary(contentsOfFile: filePath) {
for (key, value) in dict {
if let boolValue = value as? Bool {
if toggleOn {
if !boolValue {
dict[key] = true
}
} else {
if boolValue {
dict[key] = false
}
}
}
}
dict.write(toFile: filePath, atomically: true)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Dopamine/Dopamine/UI/Views/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct SettingsView: View {
if isJailbroken() {
Toggle("Options_Enble_Bottom_Forbid_Unject", isOn: $bottomforbidUnject)
.onChange(of: bottomforbidUnject) { newValue in
changBoolean()
changBoolean(newValue)
}
}
if !isJailbroken() {
Expand Down

0 comments on commit 432d2fb

Please sign in to comment.