diff --git a/.gitmodules b/.gitmodules
index 2c1a03b819..24e6e37bfb 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -4,7 +4,7 @@
url=../rlottie.git
[submodule "build-system/bazel-rules/rules_apple"]
path = build-system/bazel-rules/rules_apple
-url=https://github.com/ali-fareed/rules_apple.git
+url=https://github.com/bazelbuild/rules_apple.git
[submodule "build-system/bazel-rules/rules_swift"]
path = build-system/bazel-rules/rules_swift
url = https://github.com/bazelbuild/rules_swift.git
diff --git a/Telegram/BUILD b/Telegram/BUILD
index 2d0382e49e..7ab3a45fc6 100644
--- a/Telegram/BUILD
+++ b/Telegram/BUILD
@@ -874,6 +874,33 @@ genrule(
]
)
+genrule(
+ name = "GenerateAddAlternateIcons",
+ srcs = [
+ "Telegram-iOS/AddAlternateIcons.sh",
+ ],
+ cmd_bash =
+"""
+ cat $(location Telegram-iOS/AddAlternateIcons.sh) >> $(location AddAlternateIcons.sh)
+""",
+ outs = [
+ "AddAlternateIcons.sh",
+ ],
+ executable = True,
+ visibility = [
+ "//visibility:public",
+ ]
+)
+
+sh_binary(
+ name = "AddAlternateIcons",
+ data = [
+ "Telegram-iOS/AlternateIcons.plist",
+ "Telegram-iOS/AlternateIcons-iPad.plist",
+ ],
+ srcs = [":GenerateAddAlternateIcons"],
+)
+
ios_framework(
name = "DisplayFramework",
bundle_id = "{telegram_bundle_id}.Display".format(
@@ -1466,364 +1493,6 @@ plist_fragment(
)
)
-plist_fragment(
- name = "TelegramInfoIconsPlist",
- extension = "plist",
- template =
- """
- CFBundleIcons
-
- CFBundleAlternateIcons
-
- Black
-
- CFBundleIconFiles
-
- BlackIcon
- BlackNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackClassic
-
- CFBundleIconFiles
-
- BlackClassicIcon
- BlackClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackFilled
-
- CFBundleIconFiles
-
- BlackFilledIcon
-
- UIPrerenderedIcon
-
-
- Blue
-
- CFBundleIconFiles
-
- BlueIcon
- BlueNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueClassic
-
- CFBundleIconFiles
-
- BlueClassicIcon
- BlueClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueFilled
-
- CFBundleIconFiles
-
- BlueFilledIcon
-
- UIPrerenderedIcon
-
-
- WhiteFilled
-
- CFBundleIconFiles
-
- WhiteFilledIcon
-
- UIPrerenderedIcon
-
-
-
- CFBundlePrimaryIcon
-
- CFBundleIconFiles
-
- IconDefault-60
- IconDefault-76
- IconDefault-83.5
- IconDefault-Small-40
- IconDefault-Small
-
- UIPrerenderedIcon
-
-
-
- CFBundleIcons~ipad
-
- CFBundleAlternateIcons
-
- Black
-
- CFBundleIconFiles
-
- BlackIconIpad
- BlackIconLargeIpad
- BlackNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackClassic
-
- CFBundleIconFiles
-
- BlackClassicIconIpad
- BlackClassicIconLargeIpad
- BlackClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackFilled
-
- CFBundleIconFiles
-
- BlackFilledIconIpad
- BlackFilledIconLargeIpad
-
- UIPrerenderedIcon
-
-
- Blue
-
- CFBundleIconFiles
-
- BlueIconIpad
- BlueIconLargeIpad
- BlueNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueClassic
-
- CFBundleIconFiles
-
- BlueClassicIconIpad
- BlueClassicIconLargeIpad
- BlueClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueFilled
-
- CFBundleIconFiles
-
- BlueFilledIconIpad
- BlueFilledIconLargeIpad
-
- UIPrerenderedIcon
-
-
- WhiteFilled
-
- CFBundleIconFiles
-
- WhiteFilledIcon
-
- UIPrerenderedIcon
-
-
-
- CFBundlePrimaryIcon
-
- CFBundleIconFiles
-
- IconDefault-60
- IconDefault-76
- IconDefault-83.5
- IconDefault-Small-40
- IconDefault-Small
-
- UIPrerenderedIcon
-
-
-
-""")
-
-plist_fragment(
- name = "TelegramInfoIconAssetsPlist",
- extension = "plist",
- template =
- """
- CFBundleIcons
-
- CFBundleAlternateIcons
-
- Black
-
- CFBundleIconFiles
-
- BlackIcon
- BlackNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackClassic
-
- CFBundleIconFiles
-
- BlackClassicIcon
- BlackClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackFilled
-
- CFBundleIconFiles
-
- BlackFilledIcon
-
- UIPrerenderedIcon
-
-
- Blue
-
- CFBundleIconFiles
-
- BlueIcon
- BlueNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueClassic
-
- CFBundleIconFiles
-
- BlueClassicIcon
- BlueClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueFilled
-
- CFBundleIconFiles
-
- BlueFilledIcon
-
- UIPrerenderedIcon
-
-
- WhiteFilled
-
- CFBundleIconFiles
-
- WhiteFilledIcon
-
- UIPrerenderedIcon
-
-
-
- CFBundlePrimaryIcon
-
- CFBundleIconName
- AppIconLLC
- UIPrerenderedIcon
-
-
-
- CFBundleIcons~ipad
-
- CFBundleAlternateIcons
-
- Black
-
- CFBundleIconFiles
-
- BlackIconIpad
- BlackIconLargeIpad
- BlackNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackClassic
-
- CFBundleIconFiles
-
- BlackClassicIconIpad
- BlackClassicIconLargeIpad
- BlackClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlackFilled
-
- CFBundleIconFiles
-
- BlackFilledIconIpad
- BlackFilledIconLargeIpad
-
- UIPrerenderedIcon
-
-
- Blue
-
- CFBundleIconFiles
-
- BlueIconIpad
- BlueIconLargeIpad
- BlueNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueClassic
-
- CFBundleIconFiles
-
- BlueClassicIconIpad
- BlueClassicIconLargeIpad
- BlueClassicNotificationIcon
-
- UIPrerenderedIcon
-
-
- BlueFilled
-
- CFBundleIconFiles
-
- BlueFilledIconIpad
- BlueFilledIconLargeIpad
-
- UIPrerenderedIcon
-
-
- WhiteFilled
-
- CFBundleIconFiles
-
- WhiteFilledIcon
-
- UIPrerenderedIcon
-
-
-
- CFBundlePrimaryIcon
-
- CFBundleIconName
- AppIconLLC
- UIPrerenderedIcon
-
-
-
-""")
-
ios_application(
name = "Telegram",
bundle_id = "{telegram_bundle_id}".format(
@@ -1836,8 +1505,8 @@ ios_application(
infoplists = [
":TelegramInfoPlist",
":AdditionalInfoPlist",
- ":TelegramInfoIconAssetsPlist",
],
+ ipa_post_processor = ":AddAlternateIcons",
resources = [
":LaunchScreen",
":DefaultAppIcon",
diff --git a/Telegram/Telegram-iOS/AddAlternateIcons.sh b/Telegram/Telegram-iOS/AddAlternateIcons.sh
new file mode 100644
index 0000000000..5b8636e74f
--- /dev/null
+++ b/Telegram/Telegram-iOS/AddAlternateIcons.sh
@@ -0,0 +1,12 @@
+set -euo pipefail
+
+ADD_PLIST="${0}.runfiles/__main__/Telegram/Telegram-iOS/AlternateIcons.plist"
+ADD_PLIST_IPAD="${0}.runfiles/__main__/Telegram/Telegram-iOS/AlternateIcons-iPad.plist"
+
+INFO_PLIST="$1/Payload/Telegram.app/Info.plist"
+
+/usr/libexec/PlistBuddy -c "add :CFBundleIcons:CFBundleAlternateIcons dict" "$INFO_PLIST"
+/usr/libexec/PlistBuddy -c "add :CFBundleIcons~ipad:CFBundleAlternateIcons dict" "$INFO_PLIST"
+
+/usr/libexec/PlistBuddy -c "merge $ADD_PLIST :CFBundleIcons:CFBundleAlternateIcons" "$INFO_PLIST"
+/usr/libexec/PlistBuddy -c "merge $ADD_PLIST_IPAD :CFBundleIcons~ipad:CFBundleAlternateIcons" "$INFO_PLIST"
diff --git a/Telegram/Telegram-iOS/AlternateIcons-iPad.plist b/Telegram/Telegram-iOS/AlternateIcons-iPad.plist
new file mode 100644
index 0000000000..2d3b5e8409
--- /dev/null
+++ b/Telegram/Telegram-iOS/AlternateIcons-iPad.plist
@@ -0,0 +1,75 @@
+
+ Black
+
+ CFBundleIconFiles
+
+ BlackIconIpad
+ BlackIconLargeIpad
+ BlackNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlackClassic
+
+ CFBundleIconFiles
+
+ BlackClassicIconIpad
+ BlackClassicIconLargeIpad
+ BlackClassicNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlackFilled
+
+ CFBundleIconFiles
+
+ BlackFilledIconIpad
+ BlackFilledIconLargeIpad
+
+ UIPrerenderedIcon
+
+
+ Blue
+
+ CFBundleIconFiles
+
+ BlueIconIpad
+ BlueIconLargeIpad
+ BlueNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlueClassic
+
+ CFBundleIconFiles
+
+ BlueClassicIconIpad
+ BlueClassicIconLargeIpad
+ BlueClassicNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlueFilled
+
+ CFBundleIconFiles
+
+ BlueFilledIconIpad
+ BlueFilledIconLargeIpad
+
+ UIPrerenderedIcon
+
+
+ WhiteFilled
+
+ CFBundleIconFiles
+
+ WhiteFilledIcon
+
+ UIPrerenderedIcon
+
+
+
\ No newline at end of file
diff --git a/Telegram/Telegram-iOS/AlternateIcons.plist b/Telegram/Telegram-iOS/AlternateIcons.plist
new file mode 100644
index 0000000000..99a0e7039a
--- /dev/null
+++ b/Telegram/Telegram-iOS/AlternateIcons.plist
@@ -0,0 +1,69 @@
+
+ Black
+
+ CFBundleIconFiles
+
+ BlackIcon
+ BlackNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlackClassic
+
+ CFBundleIconFiles
+
+ BlackClassicIcon
+ BlackClassicNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlackFilled
+
+ CFBundleIconFiles
+
+ BlackFilledIcon
+
+ UIPrerenderedIcon
+
+
+ Blue
+
+ CFBundleIconFiles
+
+ BlueIcon
+ BlueNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlueClassic
+
+ CFBundleIconFiles
+
+ BlueClassicIcon
+ BlueClassicNotificationIcon
+
+ UIPrerenderedIcon
+
+
+ BlueFilled
+
+ CFBundleIconFiles
+
+ BlueFilledIcon
+
+ UIPrerenderedIcon
+
+
+ WhiteFilled
+
+ CFBundleIconFiles
+
+ WhiteFilledIcon
+
+ UIPrerenderedIcon
+
+
+
\ No newline at end of file
diff --git a/build-system/bazel-rules/rules_apple b/build-system/bazel-rules/rules_apple
index 5a0f87083a..21c0ca93b0 160000
--- a/build-system/bazel-rules/rules_apple
+++ b/build-system/bazel-rules/rules_apple
@@ -1 +1 @@
-Subproject commit 5a0f87083abe00d4b1442582847a535ca0cde914
+Subproject commit 21c0ca93b0cd44e7eb500a1c02729a08b496b6c2