Skip to content
This repository has been archived by the owner on May 20, 2023. It is now read-only.

Commit

Permalink
Release 2.6 Final
Browse files Browse the repository at this point in the history
1. Enable ooi options.
2. Add the ability to custom proxy.
  • Loading branch information
ming900518 committed Nov 18, 2020
1 parent fe6a23d commit 83f2f7f
Show file tree
Hide file tree
Showing 8 changed files with 212 additions and 94 deletions.
4 changes: 2 additions & 2 deletions KanColleCommand.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -978,7 +978,7 @@
INFOPLIST_FILE = KanColleCommand/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = "1.0 (TW.CHT-R2.6Beta5)";
MARKETING_VERSION = "1.0 (TW.CHT-Release2.6)";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = tw.mingchang.ikancollecmd;
PRODUCT_NAME = iKanColleCmd;
Expand Down Expand Up @@ -1012,7 +1012,7 @@
INFOPLIST_FILE = KanColleCommand/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.4;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
MARKETING_VERSION = "1.0 (TW.CHT-R2.6Beta5)";
MARKETING_VERSION = "1.0 (TW.CHT-Release2.6)";
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = tw.mingchang.ikancollecmd;
PRODUCT_NAME = iKanColleCmd;
Expand Down
Binary file not shown.
147 changes: 96 additions & 51 deletions KanColleCommand/Page/SettingVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,17 @@ extension SettingVC: UITableViewDelegate {
if (indexPath.row == 0) {
var connection = String()
if Setting.getconnection() == 1{
connection = "官方DMM網站(VPN/日本)"
connection = "日本地區直連/使用VPN"
} else if Setting.getconnection() == 2 {
connection = "官方DMM網站(Proxy)"
// } else if Setting.getconnection() == 3 {
// connection = "ooi緩存系統(手動登入)"
// } else if Setting.getconnection() == 4 {
// connection = "ooi緩存系統(自動登入)"
connection = "大陸地區以外專用Proxy"
} else if Setting.getconnection() == 3 {
connection = "自定義Proxy"
} else if Setting.getconnection() == 4 {
connection = "ooi緩存系統(手動登入)"
} else if Setting.getconnection() == 5 {
connection = "ooi緩存系統(自動登入)"
} else if Setting.getconnection() == 6 {
connection = "自定義Proxy(烤餅乾)"
} else {
connection = "未知"
}
Expand All @@ -127,47 +131,84 @@ extension SettingVC: UITableViewDelegate {
popoverController.permittedArrowDirections = []
}
info.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil))
info.addAction(UIAlertAction(title: "官方DMM網站(VPN/日本)", style: .default) { action in
info.addAction(UIAlertAction(title: "日本地區直連/使用VPN", style: .default) { action in
Setting.saveconnection(value: 1)
self.close()
self.settingTable.reloadData()
})
info.addAction(UIAlertAction(title: "官方DMM網站(Proxy)", style: .default) { action in
let beta = UIAlertController(title: "Beta測試功能", message: "發現任何Bug請聯繫修改者", preferredStyle: .alert)
beta.addAction(UIAlertAction(title: "我瞭解了", style: .default) { action in
info.addAction(UIAlertAction(title: "大陸地區以外專用Proxy", style: .default) { action in
let thanksSV = UIAlertController(title: "使用條款說明及感謝", message: "1. 本服務由OOI開發者@SenkaViewer無償提供,在此感謝他的貢獻!\n2. 如在使用本服務上遇到任何問題,請加入Discord群@App相關服務開發者以獲得支援。\n3. iKanColleCommand Tweaked Version修改者不對使用這項服務所造成的任何問題負責。", preferredStyle: .alert)
thanksSV.addAction(UIAlertAction(title: "我已詳閱並同意以上內容", style: .default) { action in
Setting.saveconnection(value: 2)
self.close()
self.settingTable.reloadData()
})
self.present(beta, animated: true)
thanksSV.addAction(UIAlertAction(title: "不同意,退出", style: .destructive, handler: nil))
self.present(thanksSV, animated: true)
})
info.addAction(UIAlertAction(title: "自定義Proxy", style: .default) { action in
let proxyInfo = UIAlertController(title: "輸入Proxy資訊", message: "請輸入Proxy IP及Port號\n(僅支持HTTP Proxy,HTTPS Proxy未測試)", preferredStyle: .alert)
proxyInfo.addTextField { (textField) in
textField.placeholder = "Proxy IP"
textField.keyboardType = UIKeyboardType.URL
}
proxyInfo.addTextField { (textField) in
textField.placeholder = "Port"
textField.keyboardType = UIKeyboardType.decimalPad
}
proxyInfo.addAction(UIAlertAction(title: "取消", style: .cancel) { action in
Setting.saveconnection(value: 2)
self.settingTable.reloadData()
})
proxyInfo.addAction(UIAlertAction(title: "完成", style: .default) { action in
Setting.saveCustomProxyIP(value: proxyInfo.textFields?[0].text ?? "")
Setting.saveCustomProxyPort(value: proxyInfo.textFields?[1].text ?? "")
self.settingTable.reloadData()
})
let cookieNeeded = UIAlertController(title: "烤餅乾?", message: "是否使用解除DMM地域限制Cookies?\n(僅大陸地區以外用戶有效)", preferredStyle: .alert)
cookieNeeded.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil))
cookieNeeded.addAction(UIAlertAction(title: "", style: .default) { action in
self.present(proxyInfo, animated: true)
Setting.saveconnection(value: 6)
})
cookieNeeded.addAction(UIAlertAction(title: "", style: .default) { action in
self.present(proxyInfo, animated: true)
Setting.saveconnection(value: 3)

})
self.present(cookieNeeded, animated: true)
self.settingTable.reloadData()
})
info.addAction(UIAlertAction(title: "ooi緩存系統", style: .default) { action in
let autoLogin = UIAlertController(title: "自動登入", message: "是否使用自動登入功能?", preferredStyle: .alert)
autoLogin.addAction(UIAlertAction(title: "", style: .cancel) { action in
Setting.saveconnection(value: 4)
self.settingTable.reloadData()
})
autoLogin.addAction(UIAlertAction(title: "", style: .default) { action in
let loginInfo = UIAlertController(title: "輸入登入資訊", message: "請輸入DMM帳號及密碼\n(不支援Google、Twitter及Facebook登入)", preferredStyle: .alert)
loginInfo.addTextField { (textField) in
textField.placeholder = "輸入帳號"
textField.keyboardType = UIKeyboardType.emailAddress
}
loginInfo.addTextField { (textField) in
textField.placeholder = "輸入密碼"
textField.isSecureTextEntry = true
}
loginInfo.addAction(UIAlertAction(title: "取消", style: .cancel) { action in
Setting.saveconnection(value: 4)
self.settingTable.reloadData()
})
loginInfo.addAction(UIAlertAction(title: "完成", style: .default) { action in
Setting.saveLoginAccount(value: loginInfo.textFields?[0].text ?? "")
Setting.saveLoginPasswd(value: loginInfo.textFields?[1].text ?? "")
Setting.saveconnection(value: 5)
self.settingTable.reloadData()
})
self.present(loginInfo, animated: true)
self.settingTable.reloadData()
})
self.present(autoLogin, animated: true)
self.settingTable.reloadData()
})
// info.addAction(UIAlertAction(title: "ooi緩存系統", style: .default) { action in
// let autoLogin = UIAlertController(title: "自動登入", message: "是否使用自動登入功能?", preferredStyle: .alert)
// autoLogin.addAction(UIAlertAction(title: "否", style: .cancel) { action in
// Setting.saveconnection(value: 3)
// })
// autoLogin.addAction(UIAlertAction(title: "是", style: .default) { action in
// let loginInfo = UIAlertController(title: "輸入登入資訊", message: "請輸入DMM帳密", preferredStyle: .alert)
// loginInfo.addTextField { (textField) in
// textField.placeholder = "輸入帳號"
// textField.keyboardType = UIKeyboardType.emailAddress
// }
// loginInfo.addTextField { (textField) in
// textField.placeholder = "輸入密碼"
// textField.isSecureTextEntry = true
// }
// loginInfo.addAction(UIAlertAction(title: "取消", style: .cancel) { action in
// Setting.saveconnection(value: 3)
// })
// loginInfo.addAction(UIAlertAction(title: "完成", style: .default) { action in
// Setting.saveLoginAccount(value: loginInfo.textFields?[0].text ?? "")
// Setting.saveLoginPasswd(value: loginInfo.textFields?[1].text ?? "")
// Setting.saveconnection(value: 4)
// })
// self.present(loginInfo, animated: true)
// self.settingTable.reloadData()
// })
// self.present(autoLogin, animated: true)
// self.settingTable.reloadData()
// })
self.present(info, animated: true)
print("Selected: ", Setting.getconnection())
self.settingTable.reloadData()
Expand All @@ -181,15 +222,15 @@ extension SettingVC: UITableViewDelegate {
info.addAction(UIAlertAction(title: "取消", style: .cancel, handler: nil))
info.addAction(UIAlertAction(title: "1. 增強型(警告視窗)", style: .default) { action in
Setting.savewarningAlert(value: 1)
self.close()
self.settingTable.reloadData()
})
info.addAction(UIAlertAction(title: "2. 增強型(推播通知)", style: .default) { action in
Setting.savewarningAlert(value: 2)
self.close()
self.settingTable.reloadData()
})
info.addAction(UIAlertAction(title: "3. 一般型(僅有畫面紅框)", style: .default) { action in
Setting.savewarningAlert(value: 3)
self.close()
self.settingTable.reloadData()
})
self.present(info, animated: true)
print("Selected: ", Setting.getwarningAlert())
Expand Down Expand Up @@ -373,13 +414,17 @@ extension SettingVC: UITableViewDataSource, UIPickerViewDelegate, UIPickerViewDa
if (indexPath.row == 0) {
var connection = String()
if Setting.getconnection() == 1{
connection = "官方DMM網站(VPN/日本)"
connection = "日本地區直連/使用VPN"
} else if Setting.getconnection() == 2 {
connection = "官方DMM網站(Proxy)"
// } else if Setting.getconnection() == 3 {
// connection = "ooi緩存系統(手動登入)"
// } else if Setting.getconnection() == 4 {
// connection = "ooi緩存系統(自動登入)"
connection = "大陸地區以外專用Proxy"
} else if Setting.getconnection() == 3 {
connection = "自定義Proxy"
} else if Setting.getconnection() == 4 {
connection = "ooi緩存系統(手動登入)"
} else if Setting.getconnection() == 5 {
connection = "ooi緩存系統(自動登入)"
} else if Setting.getconnection() == 6 {
connection = "自定義Proxy(烤餅乾)"
} else {
connection = "未知"
}
Expand Down
20 changes: 20 additions & 0 deletions KanColleCommand/Util/Setting.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,24 @@ class Setting {
static func saveAttemptTime(value: Int) {
UserDefaults.standard.set(value, forKey: kAttemptTime)
}

private static let kCustomProxyIP = "CustomProxyIP"

static func getCustomProxyIP() -> String {
return UserDefaults.standard.string(forKey: kCustomProxyIP) ?? ""
}

static func saveCustomProxyIP(value: String) {
UserDefaults.standard.set(value, forKey: kCustomProxyIP)
}

private static let kCustomProxyPort = "CustomProxyPort"

static func getCustomProxyPort() -> String {
return UserDefaults.standard.string(forKey: kCustomProxyPort) ?? ""
}

static func saveCustomProxyPort(value: String) {
UserDefaults.standard.set(value, forKey: kCustomProxyPort)
}
}
Loading

0 comments on commit 83f2f7f

Please sign in to comment.