下载并启动

项目地址https://github.com/TelegramMessenger/Telegram-iOS.

  1. Install the brew package manager, if you haven’t already.
  2. Install the packages yasm, cmake:
brew install yasm cmake
  1. Clone the project from GitHub:
git clone --recursive https://github.com/TelegramMessenger/Telegram-iOS.git
  1. Open Telegram-iOS.workspace.
  2. Open the Telegram-iOS-Fork scheme.
  3. Start the compilation process.
  4. 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? {
    // 
    // return self.application.value(forKey: "statusBarWindow") as? 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 {
        // Fallback on earlier versions
        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