Skip to content

Commit

Permalink
Merge branch 'SideStore:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
polymo1 authored Apr 15, 2024
2 parents ea24d84 + 34a101b commit 54b598b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 23 deletions.
6 changes: 4 additions & 2 deletions AltStore/LaunchViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ final class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDeleg
fm.fileExists(atPath: appResourcePath.path),
let data = fm.contents(atPath: appResourcePath.path),
let contents = String(data: data, encoding: .utf8),
!contents.isEmpty {
!contents.isEmpty,
!UserDefaults.standard.isPairingReset {
print("Loaded ALTPairingFile from \(appResourcePath.path)")
return contents
} else if let plistString = Bundle.main.object(forInfoDictionaryKey: "ALTPairingFile") as? String, !plistString.isEmpty, !plistString.contains("insert pairing file here"){
} else if let plistString = Bundle.main.object(forInfoDictionaryKey: "ALTPairingFile") as? String, !plistString.isEmpty, !plistString.contains("insert pairing file here"), !UserDefaults.standard.isPairingReset{
print("Loaded ALTPairingFile from Info.plist")
return plistString
} else {
Expand All @@ -93,6 +94,7 @@ final class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDeleg
documentPickerController.shouldShowFileExtensions = true
documentPickerController.delegate = self
self.present(documentPickerController, animated: true, completion: nil)
UserDefaults.standard.isPairingReset = false
})

//Add OK button to a dialog message
Expand Down
14 changes: 4 additions & 10 deletions AltStore/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,18 @@
<key>Titles</key>
<array>
<string>SideStore</string>
<string>SideStore (.zip)</string>
<string>SideStore (.xyz)</string>
<string>Macley (US)</string>
<string>Macley (DE)</string>
<string>DrPudding</string>
<string>Sideloadly</string>
<string>Nick</string>
<string>Jawshoeadan</string>
<string>crystall1nedev</string>
</array>
<key>Values</key>
<array>
<string>https://ani.sidestore.io</string>
<string>https://ani.sidestore.zip</string>
<string>https://ani.846969.xyz</string>
<string>http://5.249.163.88:6969/</string>
<string>http://45.132.246.138:6969/</string>
<string>https://sign.rheaa.xyz</string>
<string>https://sideloadly.io/anisette/irGb3Quww8zrhgqnzmrx</string>
<string>http://45.33.29.114</string>
<string>https://anisette.jawshoeadan.me</string>
<string>https://anisette.crystall1ne.software/</string>
</array>
</dict>
<dict>
Expand Down
3 changes: 2 additions & 1 deletion AltStore/Settings/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -577,11 +577,12 @@ extension SettingsViewController

alertController.addAction(UIAlertAction(title: NSLocalizedString("Delete and Reset", comment: ""), style: .destructive){ _ in
if fm.fileExists(atPath: documentsPath.path), let contents = try? String(contentsOf: documentsPath), !contents.isEmpty {
UserDefaults.standard.isPairingReset = true
try? fm.removeItem(atPath: documentsPath.path)
NSLog("Pairing File Reseted")
}
self.tableView.deselectRow(at: indexPath, animated: true)
let dialogMessage = UIAlertController(title: NSLocalizedString("Pairing File Reseted", comment: ""), message: NSLocalizedString("Please restart SideStore", comment: ""), preferredStyle: .alert)
let dialogMessage = UIAlertController(title: NSLocalizedString("Pairing File Reset", comment: ""), message: NSLocalizedString("Please restart SideStore", comment: ""), preferredStyle: .alert)
self.present(dialogMessage, animated: true, completion: nil)
})
alertController.addAction(.cancel)
Expand Down
20 changes: 10 additions & 10 deletions AltStore/Sources/SourcesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private extension SourcesViewController
{
let alertController = UIAlertController(title: NSLocalizedString("Add Source", comment: ""), message: nil, preferredStyle: .alert)
alertController.addTextField { (textField) in
textField.placeholder = "https://apps.altstore.io"
textField.placeholder = "https://apps.sidestore.io"
textField.textContentType = .URL
}
alertController.addAction(.cancel)
Expand Down Expand Up @@ -545,19 +545,19 @@ extension SourcesViewController: UICollectionViewDelegateFlowLayout
footerView.textView.delegate = self

let attributedText = NSMutableAttributedString(
string: NSLocalizedString("SideStore has reviewed these sources to make sure they meet our safety standards.\n\nSupport for untrusted sources is currently in beta, but you can help test them out by", comment: ""),
string: NSLocalizedString("SideStore has reviewed these sources to make sure they meet our safety standards.", comment: ""),
attributes: [.font: font, .foregroundColor: UIColor.gray]
)
attributedText.mutableString.append(" ")
//attributedText.mutableString.append(" ")

let boldedFont = UIFont(descriptor: font.fontDescriptor.withSymbolicTraits(.traitBold)!, size: font.pointSize)
let openPatreonURL = URL(string: "https://SideStore.io/patreon")!
//let boldedFont = UIFont(descriptor: font.fontDescriptor.withSymbolicTraits(.traitBold)!, size: font.pointSize)
//let openPatreonURL = URL(string: "https://SideStore.io/")!

let joinPatreonText = NSAttributedString(
string: NSLocalizedString("joining our Patreon.", comment: ""),
attributes: [.font: boldedFont, .link: openPatreonURL, .underlineColor: UIColor.clear]
)
attributedText.append(joinPatreonText)
// let joinPatreonText = NSAttributedString(
// string: NSLocalizedString("", comment: ""),
// attributes: [.font: boldedFont, .link: openPatreonURL, .underlineColor: UIColor.clear]
//)
//attributedText.append(joinPatreonText)

footerView.textView.attributedText = attributedText
footerView.textView.textAlignment = .natural
Expand Down
2 changes: 2 additions & 0 deletions AltStoreCore/Extensions/UserDefaults+AltStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public extension UserDefaults

@NSManaged var isBackgroundRefreshEnabled: Bool
@NSManaged var isIdleTimeoutDisableEnabled: Bool
@NSManaged var isPairingReset: Bool
@NSManaged var isDebugModeEnabled: Bool
@NSManaged var presentedLaunchReminderNotification: Bool

Expand Down Expand Up @@ -74,6 +75,7 @@ public extension UserDefaults
let defaults = [
#keyPath(UserDefaults.isBackgroundRefreshEnabled): true,
#keyPath(UserDefaults.isIdleTimeoutDisableEnabled): true,
#keyPath(UserDefaults.isPairingReset): true,
#keyPath(UserDefaults.isLegacyDeactivationSupported): isLegacyDeactivationSupported,
#keyPath(UserDefaults.activeAppLimitIncludesExtensions): activeAppLimitIncludesExtensions,
#keyPath(UserDefaults.localServerSupportsRefreshing): localServerSupportsRefreshing,
Expand Down

0 comments on commit 54b598b

Please sign in to comment.