Skip to content

Commit

Permalink
【Delete】Third party modifications do not use redundant code (#129)
Browse files Browse the repository at this point in the history
  • Loading branch information
wwg135 authored Aug 5, 2023
1 parent a7a463f commit 7e1f55f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 76 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,8 @@ 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> - 同步官方最新代码更新" >> body.txt
echo -e "\n1.1的修改版功能如下:" >> body.txt
echo -e "\n> - 1.同步官方最新代码更新\n> - 2.删除多余无用第三方修改版添加进去的代码,建议更新\n> - 3.其他功能更新,请看前面版本更新说明" >> body.txt
echo -e "**注意:追求稳定,此版本无【桥接心浪】、【映射挂载】功能**" >> body.txt
echo -e "> - 1、新增【检查更新】功能,设置里面打开即可检查更新,默认关闭!!!" >> body.txt
echo -e "> - 2、新增初次越狱/重建越狱时,默认安装 【ElleKit_1.0】 、 【PreferenceLoader_2.2.6.1】、【Xinamine】。感谢liam0205大佬的代码!!!" >> body.txt
echo -e "> - 3、首页新增【系统运行时间】----越狱后显示,打开多巴胺即弹出!!!" >> body.txt
echo -e "> - 4、长按【重启用户空间】3Dtouch弹出的【重启】功能才是真正重启手机(此操作重启后处于非越狱状态,谨慎操作)。7/8新增弹出【更新越狱环境】,仅针对从trollstore更新安装dopamine有用,覆盖安装更新建议执行该操作,感谢liam0205大佬的代码!!!" >> body.txt
echo -e "> - 6、新增【自定义dopamine首页背景】--将图片命名为:Wallpaper.jpg放置在目录:/var/mobile/。感谢真皮大佬的代码!!!" >> body.txt
echo -e "> - 7、设置新增【清除越狱】确认。若处于越狱状态,提示确认重启设备后再清除操作,否则不允许清除越狱!!!" >> body.txt
echo -e "> - 8、新增越狱后默认配置底层屏蔽文件【zp.unject.plist】,路径为:/var/mobile/,可自定义app屏蔽越狱检测!!!" >> body.txt
echo -e "> - 9、新增一键启用【自定义app屏蔽越狱检测】(开关在越狱后设置里面)!!!" >> body.txt
echo -e "> - 10、新增【添加/删除App屏蔽】功能,功能和说明在设置里面!!!" >> body.txt
echo -e "> - 11、其他设置UI、显示细节优化。。。" >> body.txt
- name: Build ipa
run: |
Expand Down
63 changes: 1 addition & 62 deletions Dopamine/Dopamine/UI/Views/Jailbreak.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,53 +38,13 @@ func respring() {
}

func userspaceReboot() {
UIImpactFeedbackGenerator(style: .soft).impactOccurred()

// MARK: Fade out Animation

let view = UIView(frame: UIScreen.main.bounds)
view.backgroundColor = .black
view.alpha = 0

for window in UIApplication.shared.connectedScenes.map({ $0 as? UIWindowScene }).compactMap({ $0 }).flatMap({ $0.windows.map { $0 } }) {
window.addSubview(view)
UIView.animate(withDuration: 0.2, delay: 0, animations: {
view.alpha = 1
})
}

DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
_ = execCmd(args: [rootifyPath(path: "/basebin/jbctl")!, "reboot_userspace"])
})
_ = execCmd(args: [rootifyPath(path: "/basebin/jbctl")!, "reboot_userspace"])
}

func reboot() {
_ = execCmd(args: [CommandLine.arguments[0], "reboot"])
}

func doReboot() {
UIImpactFeedbackGenerator(style: .soft).impactOccurred()

// MARK: Fade out Animation
let view = UIView(frame: UIScreen.main.bounds)
view.backgroundColor = .black
view.alpha = 0

for window in UIApplication.shared.connectedScenes.map({ $0 as? UIWindowScene }).compactMap({ $0 }).flatMap({ $0.windows.map { $0 } }) {
window.addSubview(view)
UIView.animate(withDuration: 0.2, delay: 0, animations: {
view.alpha = 1
})
}

DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
guard let rebootPath = rootifyPath(path: "/usr/sbin/reboot") else {
return
}
_ = execCmd(args: [rebootPath])
})
}

func isJailbroken() -> Bool {
if isSandboxed() { return false } // ui debugging

Expand Down Expand Up @@ -221,27 +181,6 @@ func updateEnvironment() {
jbdUpdateFromBasebinTar(Bundle.main.bundlePath + "/basebin.tar", true)
}


func doUpdateEnvironment() {
UIImpactFeedbackGenerator(style: .soft).impactOccurred()

// MARK: Fade out Animation
let view = UIView(frame: UIScreen.main.bounds)
view.backgroundColor = .black
view.alpha = 0

for window in UIApplication.shared.connectedScenes.map({ $0 as? UIWindowScene }).compactMap({ $0 }).flatMap({ $0.windows.map { $0 } }) {
window.addSubview(view)
UIView.animate(withDuration: 0.2, delay: 0, animations: {
view.alpha = 1
})
}

DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
jbdUpdateFromBasebinTar(Bundle.main.bundlePath + "/basebin.tar", true)
})
}

// debugging
func isSandboxed() -> Bool {
!FileManager.default.isWritableFile(atPath: "/var/mobile/")
Expand Down
4 changes: 2 additions & 2 deletions Dopamine/Dopamine/UI/Views/JailbreakView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -299,9 +299,9 @@ struct JailbreakView: View {
.contextMenu(
option.id == "userspace"
? ContextMenu {
Button(action: doReboot,
Button(action: reboot,
label: {Label("Menu_Reboot_Title", systemImage: "arrow.clockwise.circle.fill")})
Button(action: doUpdateEnvironment,
Button(action: updateEnvironment,
label: {Label("Button_Update_Environment", systemImage: "arrow.counterclockwise.circle.fill")})
}
: nil
Expand Down

0 comments on commit 7e1f55f

Please sign in to comment.