mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-03-27 18:20:44 +01:00
Update content of files
This commit is contained in:
parent
47a2f6e0b1
commit
d916134a40
1 changed files with 31 additions and 235 deletions
|
@ -169,7 +169,7 @@ The part after the version number will help you know in which folder to look for
|
|||
<h2><a class="anchor" name="reproducible-builds-for-ios" href="#reproducible-builds-for-ios"><i class="anchor-icon"></i></a>Reproducible Builds for iOS</h2>
|
||||
<p>The verification process for iOS builds is, unfortunately, a lot more complex than for Android. The two main issues with Apple's current policies and infrastructure are as follows:</p>
|
||||
<ol>
|
||||
<li><p>Apple insists on using <strong>FairPlay</strong> encryption to “protect” even <strong>free</strong> apps from “app pirates” which makes obtaining the executable code of apps impossible without a jailbroken device. To solve this issue, Apple would simply need to allow submitting unencryptable binaries to the App Store. This would not affect security since the code would still be signed – and would enable anyone to check the integrity of apps supporting reproducible builds without endangering the integrity and security of their devices.</p>
|
||||
<li><p>Apple insists on using <strong>FairPlay</strong> encryption to “protect” even <strong>free</strong> and <strong>open source</strong> apps from “app pirates” which makes obtaining the executable code of apps impossible without a jailbroken device. To solve this issue, Apple would simply need to allow submitting unencryptable binaries to the App Store. This would not affect security since the code would still be signed – and would enable anyone to check the integrity of apps supporting reproducible builds without endangering the integrity and security of their devices.</p>
|
||||
</li>
|
||||
<li><p>Building your own reproducible binaries is difficult because macOS doesn't support containers like Docker. If Apple followed in the footsteps of Linux (and even Microsoft!) and added container support, it would eliminate the need for steps 1-3 in the guide below.</p>
|
||||
</li>
|
||||
|
@ -177,207 +177,44 @@ The part after the version number will help you know in which folder to look for
|
|||
<blockquote>
|
||||
<p>As things stand now, you'll need a <strong>jailbroken device</strong>, at least <strong>1,5 hours</strong> and approximately <strong>90GB</strong> of free space to properly set up a virtual machine for the verification process.</p>
|
||||
</blockquote>
|
||||
<p>To provide a stable and easily reproducible environment, Telegram iOS builds are compiled on a virtual machine. Parallels is used to verify the builds.</p>
|
||||
<p>To provide a stable and easily reproducible environment, Telegram iOS builds are compiled on a virtual machine.</p>
|
||||
<h3><a class="anchor" name="step-1-running-darwin-containers" href="#step-1-running-darwin-containers"><i class="anchor-icon"></i></a>Step 1. Running Darwin-Containers</h3>
|
||||
<ol>
|
||||
<li>Checkout the latest DarwinContainers code: <code>git clone https://github.com/ali-fareed/darwin-containers.git</code></li>
|
||||
<li>Open darwin-containers/DarwinContainers.xcodeproj</li>
|
||||
<li>Select DarwinContainersDaemon target</li>
|
||||
<li>In Signing & Capabilities select your team and set a unique bundle id</li>
|
||||
<li>Run</li>
|
||||
</ol>
|
||||
<h3><a class="anchor" name="step-2-creating-an-os-image" href="#step-2-creating-an-os-image"><i class="anchor-icon"></i></a>Step 2. Creating an OS image</h3>
|
||||
<blockquote>
|
||||
<p>Despite the compiler bugs introduced by Apple in <strong>Xcode 14</strong> (<a href="#troubleshooting-ios">read more</a>), we were able to restore deterministic builds using manually crafted linker flags. Use the steps below to verify builds compiled with XCode 13 and below, <a href="#ios-xcode-14">see here for XCode 14 instructions</a>.</p>
|
||||
<p>Check <a href="https://github.com/TelegramMessenger/Telegram-iOS/blob/master/versions.json">versions.json</a> for information on the relevant macOS and Xcode versions.</p>
|
||||
</blockquote>
|
||||
<h3><a class="anchor" name="step-1-install-the-parallels-virtual-machine" href="#step-1-install-the-parallels-virtual-machine"><i class="anchor-icon"></i></a>Step 1. Install the Parallels virtual machine</h3>
|
||||
<p>Parallels can be obtained <a href="https://www.parallels.com/">here</a>, it features a fully-functional trial version.</p>
|
||||
<h3><a class="anchor" name="step-2-install-the-latest-version-of-macos-big-sur" href="#step-2-install-the-latest-version-of-macos-big-sur"><i class="anchor-icon"></i></a>Step 2. Install the latest version of macOS Big Sur</h3>
|
||||
<p>To download an image that can be installed on the virtual machine, open the App Store, search for “Catalina” and click “View”.</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001442/2/kdNIHhlKvz4.940110/19c350a98ef2c2c164" target="_blank"><img src="/file/464001442/2/kdNIHhlKvz4.940110/19c350a98ef2c2c164" title="Search for macOS Catalina on App Store > View" /></a>
|
||||
<p>Search for macOS Catalina on App Store > View</p>
|
||||
</div>
|
||||
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001556/2/ZSibb9LRuCg.903011/8d1216a3b375d69651" target="_blank"><img src="/file/464001556/2/ZSibb9LRuCg.903011/8d1216a3b375d69651" title="macOS Catalina > Get" /></a>
|
||||
<p>macOS Catalina > Get
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<p>This will open a system pop-up offering to download the OS:</p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001021/1/zCJcO6j4L88.223192/6cccdc989a372734b0" target="_blank"><img src="/file/464001021/1/zCJcO6j4L88.223192/6cccdc989a372734b0" title="macOS Catalina > Download" /></a>
|
||||
</div>
|
||||
Choose “Download” and wait for the download to finish.
|
||||
|
||||
> If you were not using the latest version of the OS, your system may start updating instead. Please finish updating to download macOS Catalina.
|
||||
|
||||
When done, open Parallels and choose macOS Catalina:
|
||||
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001612/2/MX23LbMTi9s.387733/04fbf3e50047b87e99" target="_blank"><img src="/file/464001612/2/MX23LbMTi9s.387733/04fbf3e50047b87e99" title="Select 'Install Windows or another OS' > Continue" /></a>
|
||||
<p>Select 'Install Windows or another OS' > Continue</p>
|
||||
</div>
|
||||
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001694/1/WD85AiGle9A.404893/9c435d6582b9be04f6" target="_blank"><img src="/file/464001694/1/WD85AiGle9A.404893/9c435d6582b9be04f6" title="Select a file... > Applications (All files) > Install macOS Сatalina" /></a>
|
||||
<p>Select a file... > Applications (All files) > Install macOS Сatalina</p>
|
||||
</div>
|
||||
|
||||
<p>Before starting the installation, configure the virtual machine:</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001210/2/FVlrqHY_Vqw.231478/0167b02433bf413c67" target="_blank"><img src="/file/464001210/2/FVlrqHY_Vqw.231478/0167b02433bf413c67" title="Enable checkbox 'Customize settings before installation'" /></a>
|
||||
<p>Checkbox 'Customize settings before installation'</p>
|
||||
</div>
|
||||
|
||||
<p>Change the name of the virtual machine to <code>macos11_Xcode12_5_1</code></p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001398/1/SB22XXoAWTg.151444/8e479c26b30ceccc01" target="_blank"><img src="/file/464001398/1/SB22XXoAWTg.151444/8e479c26b30ceccc01" title="Name VM as macos10_15_Xcode11_2" /></a>
|
||||
<p>Name VM as macos10_15_Xcode12_2</p>
|
||||
</div>
|
||||
|
||||
<p>Hardware > Processors: 2-4<br>Memory > 4GB may suffice but 8GB is recommended</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001494/1/_BIf-UvwS3Q.239110/d52cb48ec3d6e76e84" target="_blank"><img src="/file/464001494/1/_BIf-UvwS3Q.239110/d52cb48ec3d6e76e84" title="At least 2 CPUs + 4 (8 recommended) GB Memory." /></a>
|
||||
<p>At least 2 CPUs + 4 (8 recommended) GB Memory.</p>
|
||||
</div>
|
||||
|
||||
<p>You will get something like this:</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001423/2/yoakfT7DemM.200481/2fbd4e1d1fcbe60c9a" target="_blank"><img src="/file/464001423/2/yoakfT7DemM.200481/2fbd4e1d1fcbe60c9a" title="Click Continue" /></a>
|
||||
<p>Click Continue</p>
|
||||
</div>
|
||||
|
||||
<p>Parallels may request access to your microphone and camera, this is not required – just press <strong>Close</strong>.</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001037/3/uPUYKKQ0JXY.1190506/9f9567853a1be5f194" target="_blank"><img src="/file/464001037/3/uPUYKKQ0JXY.1190506/9f9567853a1be5f194" title="Install macOS > Continue" /></a>
|
||||
<p>Install macOS > Continue</p>
|
||||
</div>
|
||||
|
||||
<p>Your Apple ID is also not required, you can choose <strong>Set Up Later</strong>.</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001885/3/-EDysKEKxN4.872188/4fd018cdc5b1e9f3f4" target="_blank"><img src="/file/464001885/3/-EDysKEKxN4.872188/4fd018cdc5b1e9f3f4" title="Skip Apple ID with 'Set Up Later'" /></a>
|
||||
<p>Skip Apple ID with 'Set Up Later'</p>
|
||||
</div>
|
||||
|
||||
<p>Use “telegram” for both the account name and password.</p>
|
||||
<blockquote>
|
||||
<p>Do not ever use the password “telegram” for <strong>anything</strong> else, it's cursed.</p>
|
||||
</blockquote>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001994/1/uhQTRCzmHj0.805076/9fe8aaf3ade46b3bbf" target="_blank"><img src="/file/464001994/1/uhQTRCzmHj0.805076/9fe8aaf3ade46b3bbf" title="Create a computer account with 'telegram' set both as account name and password" class="dev_page_image" /></a>
|
||||
<p>Create a computer account with 'telegram' set both as account name and password</p>
|
||||
</div>
|
||||
|
||||
<p>Now install Parallels tools from the menu bar:</p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001486/1/kvHNFzvxjA8.2491846/d75c7b01cb0d3e4115" target="_blank"><img src="/file/464001486/1/kvHNFzvxjA8.2491846/d75c7b01cb0d3e4115" title="Install Parallels Tools using menu bar > Parallels icon > Actions > Install (Reinstall) Parallels Tools" /></a>
|
||||
<a href="/file/464001061/5/Hiye9EUwr58.424786/543027492e073abd74" target="_blank"><img src="/file/464001061/5/Hiye9EUwr58.424786/543027492e073abd74" title="Install Parallels Tools" /></a>
|
||||
<p>Install Parallels Tools using menu bar > Parallels icon > Actions > Install (Reinstall) Parallels Tools...</p>
|
||||
</div>
|
||||
|
||||
<p>After the system restarts, log in.<br>Open <strong>Terminal</strong> and run:<br><code>sudo visudo</code><br>Enter the password “telegram”</p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001603/1/syuA7Rk-n2Q.40736/a5e73335e5c7d3a36c" target="_blank"><img src="/file/464001603/1/syuA7Rk-n2Q.40736/a5e73335e5c7d3a36c" title="Run Terminal on the VM, enter 'sudo visudo' > enter password (telegram)" /></a>
|
||||
</div>
|
||||
|
||||
<p>Find this line at the end of the file:<br><code>%admin ALL=(ALL) ALL</code><br>Press “i” on your keyboard, add “NOPASSWD:”<br><code>%admin ALL=(ALL) NOPASSWD: ALL</code><br>Press Escape.<br>Type in “:wq”<br>Press Enter</p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001750/1/T6mMRrNkTUY.105833/6c491ac94ba52c30a0" target="_blank"><img src="/file/464001750/1/T6mMRrNkTUY.105833/6c491ac94ba52c30a0" title="Press i to edit the highlighted string" class="dev_page_image" /></a>
|
||||
<p>Press i to edit the highlighted string.</p>
|
||||
<a href="/file/464001078/1/fvlwH44qF9A.87241/d994289fe3967fbcd0" target="_blank"><img src="/file/464001078/1/fvlwH44qF9A.87241/d994289fe3967fbcd0" title="Enter :wq > press Enter" /></a>
|
||||
<p>Enter :wq > press Enter.</p>
|
||||
</div>
|
||||
|
||||
<p>In the terminal, run:<br><code>sudo systemsetup -setcomputersleep Never</code></p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001368/3/4nNsEU8siSo.54459/fdccb77de26ce89c25" target="_blank"><img src="/file/464001368/3/4nNsEU8siSo.54459/fdccb77de26ce89c25" title="sudo systemsetup -setcomputersleep Never > press Enter" /></a>
|
||||
<p>sudo systemsetup -setcomputersleep Never > press Enter.</p>
|
||||
</div>
|
||||
|
||||
<h3><a class="anchor" name="step-3-install-ssh-keys-on-the-virtual-machine" href="#step-3-install-ssh-keys-on-the-virtual-machine"><i class="anchor-icon"></i></a>Step 3. Install SSH keys on the virtual machine</h3>
|
||||
<p>In the virtual machine, open System Settings > Sharing and enable <strong>Remote Login</strong>.</p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001585/1/PEomlV3X5tY.2043293/4945fabb3f0dbc3498" target="_blank"><img src="/file/464001585/1/PEomlV3X5tY.2043293/4945fabb3f0dbc3498" title="Go to macOS Settings > Sharing > enable Remote Login" /></a>
|
||||
</div>
|
||||
|
||||
<p>In the virtual machine, open Terminal and run:<br><code>mkdir -p .ssh; nano .ssh/authorized_keys</code></p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001545/2/D1m3uumpixY.80253/33723ae7bf268e4e7b" target="_blank"><img src="/file/464001545/2/D1m3uumpixY.80253/33723ae7bf268e4e7b" title="Enter mkdir -p .ssh; nano .ssh/authorized_keys > press Enter" /></a>
|
||||
</div>
|
||||
|
||||
<p>In your main OS, open Terminal and run:<br><code>if [ ! -e ~/.ssh/id_rsa.pub ]; then ssh-keygen -t rsa -b 4096; fi && cat ~/.ssh/id_rsa.pub | pbcopy</code></p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001768/1/UQHpZ06ximo.31911/c5244223a99661c5e9" target="_blank"><img src="/file/464001768/1/UQHpZ06ximo.31911/c5244223a99661c5e9" title="Terminal" /></a>
|
||||
</div>
|
||||
|
||||
<p>If you see the line “Enter file in which to save the key (/Users/…/.ssh/id_rsa):”, press Enter<br>In the virtual machine, press <strong>CMD+V</strong><br>Then <strong>Ctrl+O</strong>, <strong>Ctrl+X</strong></p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001578/2/jHqc2jci2Ck.54202/7a0014ad6fb0d1c173" target="_blank"><img src="/file/464001578/2/jHqc2jci2Ck.54202/7a0014ad6fb0d1c173" title="Press Cmd+V > Ctrl+O > Ctrl+X." /></a>
|
||||
</div>
|
||||
|
||||
<h3><a class="anchor" name="step-4-install-xcode-version-12-5-1" href="#step-4-install-xcode-version-12-5-1"><i class="anchor-icon"></i></a>Step 4. Install Xcode version 12.5.1</h3>
|
||||
<p>In the virtual machine, open Safari and go to https://developer.apple.com<br>Sign in to your Account:</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001443/2/LhmF4qgPgn4.501969/6edbc244d8b9f8298e" target="_blank"><img src="/file/464001443/2/LhmF4qgPgn4.501969/6edbc244d8b9f8298e" title="developer.apple.com > Account > sign in with your Apple ID" /></a>
|
||||
<p>developer.apple.com > Account > sign in with your Apple ID</p>
|
||||
</div>
|
||||
|
||||
<p>Go to <strong>Downloads > More</strong><br>Enter <strong>Xcode</strong> in the search field and find the version 12.5.1</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001260/1/njYJxQDnzzQ.664134/d4e8de0aed2d74d6e0" target="_blank"><img src="/file/464001260/1/njYJxQDnzzQ.664134/d4e8de0aed2d74d6e0" title="Downloads > More > 12.5.1" /></a>
|
||||
<p>Downloads > More > Xcode 12.5.1</p>
|
||||
</div>
|
||||
|
||||
<p>Once the installation is complete, open the file Xcode 12.5.1.xip. The system will unarchive the app into the same folder. Move it to the <strong>Applications</strong> folder using Finder.</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001707/1/GIIAXXifhbI.2058152/af989007034194b28b" target="_blank"><img src="/file/464001707/1/GIIAXXifhbI.2058152/af989007034194b28b" title="Unarchive Xcode > drag the app to Applications folder" /></a>
|
||||
<p>Unarchive Xcode > drag the app to Applications folder</p>
|
||||
</div>
|
||||
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001214/1/CZJfqS7Fhr8.2206987/d29e070d1cef8de8fb" target="_blank"><img src="/file/464001214/1/CZJfqS7Fhr8.2206987/d29e070d1cef8de8fb" title="Move Xcode to Applications using Finder > Run > Agree to install additional components" /></a>
|
||||
</div>
|
||||
|
||||
<p>On the virtual machine, run this command from the terminal:<br><code>sudo xcode-select -s /Applications/Xcode.app/Contents/Developer</code></p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001410/1/OZcFX2KwPrg.49547/a84ac3100d693a3982" target="_blank"><img src="/file/464001410/1/OZcFX2KwPrg.49547/a84ac3100d693a3982" title="sudo xcode-select -s /Applications/Xcode.app/Contents/Developer" /></a>
|
||||
</div>
|
||||
|
||||
<p>Shut down the virtual machine.</p>
|
||||
<div class="blog_image_wrap">
|
||||
<a href="/file/464001752/2/kos29MZFaJ0.3515145/88dff67ef53dbf4dcc" target="_blank"><img src="/file/464001752/2/kos29MZFaJ0.3515145/88dff67ef53dbf4dcc" title="Shut down the virtual machine" /></a>
|
||||
<p>Shut down the virtual machine</p>
|
||||
</div>
|
||||
|
||||
<h3><a class="anchor" name="step-4-1" href="#step-4-1"><i class="anchor-icon"></i></a>Step 4.1</h3>
|
||||
<p>Download the certificates at https://github.com/TelegramMessenger/Telegram-iOS/tree/master/build-system/fake-codesigning/certs/distribution and install them into the virtual machine.</p>
|
||||
<p>Launch Keychain Access and double-click the installed certificate. Under “Trust”, change “When using this certificate” to “Always Trust”.</p>
|
||||
<h3><a class="anchor" name="step-5-obtaining-the-source-code" href="#step-5-obtaining-the-source-code"><i class="anchor-icon"></i></a>Step 5. Obtaining the source code</h3>
|
||||
<p><code>./darwin-containers fetch</code></p>
|
||||
<p>Download the appropriate macOS restore image (e.g. 13.0):</p>
|
||||
<p><code>./darwin-containers fetch "macOS 13.0"</code></p>
|
||||
<p>Create a new OS image:</p>
|
||||
<p><code>./darwin-containers create --source "macOS 13.0" --tag "macos-13.0-xcode-{XCODE_VERSION}" --manual</code></p>
|
||||
<p>Follow the installation instructions. Set username to <code>containerhost</code> and password to <code>containerhost</code>.</p>
|
||||
<p>Enable Remote Login and allow full disk access for remote users.</p>
|
||||
<p>Connect to the guest VM using SSH with username <code>containerhost</code> and password <code>containerhost</code>.</p>
|
||||
<p>Create the directory <code>~/.ssh</code> and set up the <code>authorized_keys</code> using the public key string printed by the <code>darwin-containers create</code> command earlier.</p>
|
||||
<p>Upload the appropriate version of Xcode via <code>scp</code> and install to /Applications. Run it at least once to complete installation.</p>
|
||||
<p>Shut down the guest OS.</p>
|
||||
<h3><a class="anchor" name="step-3-obtaining-verification-ipa" href="#step-3-obtaining-verification-ipa"><i class="anchor-icon"></i></a>Step 3. Obtaining verification IPA</h3>
|
||||
<pre><code>python3 -u build-system/Make/Make.py remote-build --darwinContainers="path-to-darwin-containers-script" --darwinContainersHost="unix://$HOME/.darwin-containers.sock" --configurationPath="build-system/appstore-configuration.json" --codesigningInformationPath=build-system/fake-codesigning --configuration=release_arm64</code></pre>
|
||||
<p>For more information see:</p>
|
||||
<p><code>build-system/Make/RemoteBuild.py</code><br><code>.gitlab-ci.yml</code> lane <code>verify_beta_testflight</code></p>
|
||||
<h3><a class="anchor" name="step-4-obtaining-the-source-code" href="#step-4-obtaining-the-source-code"><i class="anchor-icon"></i></a>Step 4. Obtaining the source code</h3>
|
||||
<p><code>git clone --recursive https://github.com/TelegramMessenger/telegram-ios.git $HOME/telegram-ios</code><br><code>cd $HOME/telegram-ios</code><br><code>git checkout release-${VERSION_NUMBER}</code></p>
|
||||
<p>E.g., <code>git checkout release-7.3</code>. Please note that you need to check out the whole git history as the build version depends on the number of commits in the repository.</p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001402/3/U43d2T5SSGY.181052/c86e9e2a72b766e704" target="_blank"><img src="/file/464001402/3/U43d2T5SSGY.181052/c86e9e2a72b766e704" title="git clone" /></a>
|
||||
</div>
|
||||
|
||||
<h3><a class="anchor" name="step-6-downloading-bazel-3-7-0-to-home-bazel-bazel" href="#step-6-downloading-bazel-3-7-0-to-home-bazel-bazel"><i class="anchor-icon"></i></a>Step 6. Downloading Bazel 3.7.0 to $HOME/bazel/bazel</h3>
|
||||
<p><code>mkdir -p $HOME/bazel && cd $HOME/bazel</code><br><code>curl -O -L https://github.com/bazelbuild/bazel/releases/download/3.7.0/bazel-3.7.0-darwin-x86_64</code><br><code>mv bazel-3.7.0-darwin-x86_64 bazel</code></p>
|
||||
<p>Check that you have downloaded the correct version:<br><code>chmod +x bazel</code><br><code>./bazel --version</code></p>
|
||||
<h3><a class="anchor" name="step-7-building-the-app" href="#step-7-building-the-app"><i class="anchor-icon"></i></a>Step 7. Building the app</h3>
|
||||
<p>Open Terminal, run the commands:<br><code>cd $HOME/telegram-ios
|
||||
BAZEL="$HOME/bazel/bazel" sh buildbox/build-telegram.sh verify</code></p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001292/1/9vG9rIqfOK0.38309/7f7df70686fc4afc36" target="_blank"><img src="/file/464001292/1/9vG9rIqfOK0.38309/7f7df70686fc4afc36" title="Building the app" /></a>
|
||||
</div>
|
||||
|
||||
<p>If the environment has been set up correctly, this will start the building process. Note that this step can easily take <strong>30-40 minutes</strong>. The average build time on a MacBook Pro (i9 6 core) is 35 minutes.</p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001704/1/_aK7gK-aRW4.80595/696c8283fe53f291bc" target="_blank"><img src="/file/464001704/1/_aK7gK-aRW4.80595/696c8283fe53f291bc" title="Building started" /></a>
|
||||
<a href="/file/464001735/1/ymFowz-2P8c.33467/e29b2c4aaa736dc6a1" target="_blank"><img src="/file/464001735/1/ymFowz-2P8c.33467/e29b2c4aaa736dc6a1" title="Building completed" /></a>
|
||||
</div>
|
||||
|
||||
<p>Once the process is complete the resulting IPA file can be found in <code>build/artifacts/Telegram.ipa</code><br>All the following steps will be made via Terminal on your main system.</p>
|
||||
<h3><a class="anchor" name="step-8-downloading-a-decrypted-version-of-the-app-from-the-app-s" href="#step-8-downloading-a-decrypted-version-of-the-app-from-the-app-s"><i class="anchor-icon"></i></a>Step 8. Downloading a decrypted version of the app from the App Store</h3>
|
||||
<h3><a class="anchor" name="step-5-downloading-a-decrypted-version-of-the-app-from-the-app-s" href="#step-5-downloading-a-decrypted-version-of-the-app-from-the-app-s"><i class="anchor-icon"></i></a>Step 5. Downloading a decrypted version of the app from the App Store</h3>
|
||||
<p>This step requires a jailbroken device equipped with tools for decrypting apps. We‘d love to make this process more simple but that’s what you get for using Apple tech.</p>
|
||||
<h3><a class="anchor" name="step-9-comparing-the-appstore-build-and-the-version-built-in-the" href="#step-9-comparing-the-appstore-build-and-the-version-built-in-the"><i class="anchor-icon"></i></a>Step 9. Comparing the AppStore build and the version built in the virtual machine</h3>
|
||||
<p>Install the necessary tools:<br><code>if ! type brew > /dev/null;
|
||||
then /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"; fi && brew install python3</code></p>
|
||||
<div class="blog_wide_image">
|
||||
<a href="/file/464001225/1/X65KiZyxvdQ.41739/c7f65f76cc4c827c5d" target="_blank"><img src="/file/464001225/1/X65KiZyxvdQ.41739/c7f65f76cc4c827c5d" title="Installing python" /></a>
|
||||
</div>
|
||||
|
||||
<h3><a class="anchor" name="step-6-comparing-the-appstore-build-and-the-version-built-in-the" href="#step-6-comparing-the-appstore-build-and-the-version-built-in-the"><i class="anchor-icon"></i></a>Step 6. Comparing the AppStore build and the version built in the virtual machine</h3>
|
||||
<p><strong>Run</strong><br><code>python3 tools/ipadiff.py build/artifacts/Telegram.ipa PATH-TO-THE-IPA-FILE-FROM-STEP-9</code></p>
|
||||
<ol>
|
||||
<li>cd telegram-ios > Enter</li>
|
||||
|
@ -411,36 +248,10 @@ BAZEL="$HOME/bazel/bazel" sh buildbox/build-telegram.sh verify</code><
|
|||
<a href="/file/464001384/3/iSp-75NOtIU.58868/7b08b99752cdf7dd22" target="_blank"><img src="/file/464001384/3/iSp-75NOtIU.58868/7b08b99752cdf7dd22" title="Mismatching IPAs" /></a>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<h4><a class="anchor" name="ios-xcode-14" href="#ios-xcode-14"><i class="anchor-icon"></i></a>iOS, XCode 14</h4>
|
||||
<p>Due to compiler bugs introduced by Apple in <strong>Xcode 14</strong> (<a href="#troubleshooting-ios">read more</a>), you will need to use the modified instructions below to verify the latest builds:</p>
|
||||
<p><strong>Remove steps 6, 7</strong></p>
|
||||
<p><strong>Steps 1-4.1</strong> are replaced with:</p>
|
||||
<h5><a class="anchor" name="running-darwin-containers" href="#running-darwin-containers"><i class="anchor-icon"></i></a>Running Darwin-Containers:</h5>
|
||||
<ol>
|
||||
<li>Checkout the latest DarwinContainers code: <code>git clone https://github.com/ali-fareed/darwin-containers.git</code></li>
|
||||
<li>Open darwin-containers/DarwinContainers.xcodeproj</li>
|
||||
<li>Select DarwinContainersDaemon target</li>
|
||||
<li>In Signing & Capabilities select your team and set a unique bundle id</li>
|
||||
<li>Run</li>
|
||||
</ol>
|
||||
<h5><a class="anchor" name="creating-an-os-image" href="#creating-an-os-image"><i class="anchor-icon"></i></a>Creating an OS image:</h5>
|
||||
<p><code>./darwin-containers fetch</code></p>
|
||||
<p>Download the appropriate macOS restore image (e.g. 13.0):</p>
|
||||
<p><code>./darwin-containers fetch "macOS 13.0"</code></p>
|
||||
<p>Create a new OS image:</p>
|
||||
<p><code>./darwin-containers create --source "macOS 13.0" --tag "macos-13.0-xcode-14.1" --manual</code></p>
|
||||
<p>Follow the installation instructions. Set username to <code>containerhost</code> and password to <code>containerhost</code>.<br>Enable Remote Login and allow full disk access for remote users.<br>Connect to the guest VM using SSH with username <code>containerhost</code> and password <code>containerhost</code>.<br>Create directory <code>~/.ssh</code> and set up the <code>authorized_keys</code> using the public key string printed by the <code>darwin-containers create</code> command earlier.<br>Upload the appropriate version of Xcode via <code>scp</code> and install to /Applications. Run it at least once to complete installation.<br>Shutdown the guest OS.</p>
|
||||
<h5><a class="anchor" name="obtaining-verification-ipa" href="#obtaining-verification-ipa"><i class="anchor-icon"></i></a>Obtaining verification IPA:</h5>
|
||||
<p><code>python3 -u build-system/Make/Make.py remote-build --darwinContainers="path-to-darwin-containers-script" --darwinContainersHost="unix://$HOME/.darwin-containers.sock" --configurationPath="build-system/appstore-configuration.json" --codesigningInformationPath=build-system/fake-codesigning --configuration=release_arm64</code></p>
|
||||
<p>For more information see:</p>
|
||||
<p><code>build-system/Make/RemoteBuild.py</code><br><code>.gitlab-ci.yml</code> lane <code>verify_beta_testflight</code></p>
|
||||
<hr>
|
||||
<h3><a class="anchor" name="ios-notes" href="#ios-notes"><i class="anchor-icon"></i></a>iOS: Notes</h3>
|
||||
<ol>
|
||||
<li><p>You will get a warning if the archive created in <a href="#step-7-building-the-app">Step 7</a> contains encrypted files. If all these files are in the <code>PlugIns</code> subfolder, they represent various system extensions (e.g. external sharing, Siri, 3D touch). Decrypting such files using existing ways of receiving app archives via Jailbreak is non-trivial (but we're working on resolving this issue). If you do manage to decrypt them, e.g. on iOS 8, they will be matched.</p>
|
||||
</li>
|
||||
<li><p>You will be notified if the archive includes an <strong>Apple Watch app</strong>. The watch app will soon no longer be included in the archive.</p>
|
||||
<li><p>You will get a warning if the archive created in <a href="#step-5-downloading-a-decrypted-version-of-the-app-from-the-app-s">Step 5</a> contains encrypted files. If all these files are in the <code>PlugIns</code> subfolder, they represent various system extensions (e.g. external sharing, Siri). Decrypting such files using existing ways of receiving app archives via Jailbreak is non-trivial (but we're working on resolving this issue). If you do manage to decrypt them, e.g. on iOS 8, they will be matched.</p>
|
||||
</li>
|
||||
<li><p>Files with the <code>.car</code> extension are app resource archives (images, sounds) which were compiled and processed specifically for the target device. The App Store processes them in non-trivial ways, we're planning on getting rid of them in future versions.</p>
|
||||
</li>
|
||||
|
@ -459,21 +270,6 @@ BAZEL="$HOME/bazel/bazel" sh buildbox/build-telegram.sh verify</code><
|
|||
<li><p>If the gradle version used in the Dockerfile is not available anymore and building of the Docker image fails, wait for a Dockerfile update or update manually to lastest available version.</p>
|
||||
</li>
|
||||
</ol>
|
||||
<h3><a class="anchor" name="troubleshooting-ios" href="#troubleshooting-ios"><i class="anchor-icon"></i></a>Troubleshooting: iOS</h3>
|
||||
<blockquote>
|
||||
<p><strong>UPD:</strong> Despite the fact that the issue below persists, we were able to restore deterministic builds using manually crafted linker flags. See these updated <a href="#ios-xcode-14">steps for XCode 14</a>.</p>
|
||||
</blockquote>
|
||||
<p>Due to recent changes introduced in <strong>XCode 14</strong> by <strong>Apple</strong>, it is currently not possible to create <a href="#reproducible-builds-for-ios">reproducible builds for iOS</a> using tools officially supported by Apple. <strong>We will update this page as soon as Apple resolves the issue.</strong></p>
|
||||
<p>To confirm the issue for yourself, follow these steps:</p>
|
||||
<ol>
|
||||
<li>Unzip <a href="https://core.telegram.org/resources/link-issue.zip">link-issue.zip</a></li>
|
||||
<li><code>sh test-link.sh</code></li>
|
||||
<li>Compare <code>link1.output</code> and <code>link.output</code>. Specifically:</li>
|
||||
</ol>
|
||||
<ul>
|
||||
<li>With some probability, the ordering of the <code>LC_LOAD_DYLIB</code> commands will vary.</li>
|
||||
<li>The <code>__LIKEDIT</code> section will <strong>always vary</strong>.</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue