下载并启动
项目地址https://github.com/TelegramMessenger/Telegram-iOS.
- Install the brew package manager, if you haven’t already.
- Install the packages yasm, cmake:
- Clone the project from GitHub:
git clone --recursive https://github.com/TelegramMessenger/Telegram-iOS.git
- Open Telegram-iOS.workspace.
- Open the Telegram-iOS-Fork scheme.
- Start the compilation process.
- To run the app on your device, you will need to set the correct values for the signature, .entitlements files and package IDs in accordance with your developer account values.
截止到今天(2020-04-24),新版的分支需要自行使用buck生成workspace文件,比较麻烦。
为了方便,笔者切换到分支release-5.8
,直接运行AppStoreLLC scheme
,不过代码需要稍微适配下iOS13,如下。
var statusBarWindow: UIView? {
if #available(iOS 13.0, *) {
#if swift(>=5.1)
if let statusBarManager = UIApplication.shared.keyWindow?.windowScene?.statusBarManager,
let localStatusBar = statusBarManager.perform(Selector(("createLocalStatusBar")))?.takeRetainedValue()
as? UIView,
let statusBar = localStatusBar.perform(Selector(("statusBar")))?.takeRetainedValue() as? UIView,
let _statusBar = statusBar.value(forKey: "_statusBar") as? UIView {
return _statusBar
}
#endif
} else {
if let statusBarWindow = UIApplication.shared.value(forKey: "statusBarWindow") as? UIWindow {
return self.application.value(forKey: "statusBarWindow") as? UIView
}
}
return nil
}
参考资料
build Telegram Messenger iOS App
官方使用说明 https://core.telegram.org/reproducible-builds#reproducible-builds-for-ios