Skip to content

Commit

Permalink
is persistance helper in bundle ?
Browse files Browse the repository at this point in the history
  • Loading branch information
c22dev committed Nov 28, 2023
1 parent 578b579 commit 3c478a9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Binary file not shown.
2 changes: 1 addition & 1 deletion TipsGotTrolled/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ struct ContentView: View {
UIApplication.shared.alert(title: "Error", body: "Error: \(error)")
}
}


try AbsoluteSolver.copy(at: URL(fileURLWithPath: ts.getTipsPath()!), to: documentsDirectoryURL!.appendingPathComponent("Tips")) // backup previous binary just in case
try MacDirtyCow.overwriteFileWithDataImpl(originPath: ts.getTipsPath()!, replacementData: Data(contentsOf: Bundle.main.url(forResource: "PersistenceHelper_Embedded", withExtension: "")!))
Expand Down
7 changes: 7 additions & 0 deletions TipsGotTrolled/TipsGotTrolledApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ struct TipsGotTrolledApp: App {
UIApplication.shared.alert(title: "Please delete Tips app then (re)install it before proceeding", body: "Hi ! It looks like it's the first time you come here. To avoid any corruption, please delete Tips app from Home Screen then reinstall it. Thanks for using this tool!", withButton: true)
isFirstLaunch = false
}
if let url = Bundle.main.url(forResource: "PersistenceHelper_Embedded", withExtension: nil) {
let filePath = url.path

if FileManager.default.fileExists(atPath: filePath) {
print("persistence binary found in bundle (good!)")
}
}
}
}
}
Expand Down

0 comments on commit 3c478a9

Please sign in to comment.