Skip to content

Commit

Permalink
Add uninstall instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
halo committed Aug 13, 2024
1 parent 7359d27 commit a00364e
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
59 changes: 57 additions & 2 deletions LinkLiar/Views/Settings/Sections/UninstallView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,63 @@ extension SettingsView {
@Environment(LinkState.self) private var state

var body: some View {
VStack {
Text("Preferences...")
ScrollView {
VStack(alignment: .center) {
Image(systemName: "trash.fill")
.resizable()
.aspectRatio(contentMode: .fill)
.frame(width: 60, height: 60)
.padding(.bottom, 3)
Text("Uninstall LinkLiar").bold()
}.padding()

if state.daemonRegistration == .notRegistered || state.daemonRegistration == .notFound {
HStack {
Text("""
There is no background service installed.
You can delete LinkLiar.app to uninstall.
""")
Spacer()
}.padding(.bottom)

} else {

VStack {
HStack {
Text("""
You can press this button \
to deactivate all background activity immediately:
""")
Spacer()
}.padding(.bottom)

Button(action: { Controller.unregisterDaemon(state: state) }) {
Text("Unregister Background Service")
}.padding(.bottom)

HStack {
Text("Then delete")
Text("LinkLiar.app").monospaced().bold()
Spacer()
}.padding(.bottom)

}
}

if state.daemonRegistration != .notFound {
HStack {
Text("""
Notice that LinkLiar may still appear in your "Allow in the Background" \
list of apps.
This is intended behavior by Apple. If it really bothers you, \
there is a command called `sfltool resetbtm`  which you can investigate \
to solve the problem.
""")
Spacer()
}.padding(.bottom)
}

}.padding()
}
}
Expand Down
3 changes: 3 additions & 0 deletions LinkLiar/Views/Settings/SettingsDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ struct SettingsDetailView: View {
case SettingsView.Pane.troubleshoot.rawValue:
SettingsView.TroubleshootView().environment(state)

case SettingsView.Pane.uninstall.rawValue:
SettingsView.UninstallView().environment(state)

default:
if let interface = state.allInterfaces.first(where: { $0.id == selectedFolder }) {
SettingsView.InterfacePolicyView().environment(state)
Expand Down

0 comments on commit a00364e

Please sign in to comment.