diff --git a/.gitea/workflows/debug.yml b/.gitea/workflows/debug.yml new file mode 100644 index 000000000..07fd67772 --- /dev/null +++ b/.gitea/workflows/debug.yml @@ -0,0 +1,211 @@ +name: "Debug Build" + +# Controls when the action will run. +on: + push: + branches: + - dev + paths-ignore: + - '**.md' + - '.github/**' + +jobs: + ffmpeg: + name: Native Build (FFmpeg) + runs-on: ndk21 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Fetch Status + run: | + sed -i 's/\/\///g' settings.gradle + + git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status + git submodule status TMessagesProj/jni/libvpx > libvpx_status + - name: FFmpeg Cache + id: cache + uses: actions/cache@v4 + with: + path: | + TMessagesProj/jni/ffmpeg/build + TMessagesProj/jni/libvpx/build + key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }} + - name: Install NDK + if: steps.cache.outputs.cache-hit != 'true' + run: | + echo "sdk.dir=${ANDROID_HOME}" > local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties + - name: Native Build + if: steps.cache.outputs.cache-hit != 'true' + run: | + sudo apt-get install yasm -y + ./run init libs libvpx + ./run init libs ffmpeg + boringssl: + name: Native Build (BoringSSL) + runs-on: ndk21 + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Fetch Status + run: | + sed -i 's/\/\///g' settings.gradle + git submodule status TMessagesProj/jni/boringssl > boringssl_status + - name: BoringSSL Cache + id: cache + uses: actions/cache@v4 + with: + path: | + TMessagesProj/jni/boringssl/build + key: ${{ hashFiles('boringssl_status') }} + - name: Install NDK + if: steps.cache.outputs.cache-hit != 'true' + run: | + echo "sdk.dir=${ANDROID_HOME}" > local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties + - name: Native Build + if: steps.cache.outputs.cache-hit != 'true' + run: | + apt install golang -y + ./run init action boringssl + ./run init libs boringssl + native: + name: Native Build (Telegram) + runs-on: ndk21 + needs: + - ffmpeg + - boringssl + strategy: + matrix: + flavor: + - armeabi-v7a + - arm64-v8a + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Fetch Status + run: | + sed -i 's/\/\///g' settings.gradle + git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status + git submodule status TMessagesProj/jni/libvpx > libvpx_status + git submodule status TMessagesProj/jni/boringssl > boringssl_status + - name: Native Cache + id: cache + uses: actions/cache@v4 + with: + path: | + TMessagesProj/src/main/libs + key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-${{ matrix.flavor }} + - name: Checkout Library + if: steps.cache.outputs.cache-hit != 'true' + run: | + git submodule update --init 'TMessagesProj/jni/*' + - name: FFmpeg Cache + uses: actions/cache@v4 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: | + TMessagesProj/jni/ffmpeg/build + TMessagesProj/jni/libvpx/build + key: ${{ hashFiles('ffmpeg_status', 'libvpx_status', 'TMessagesProj/jni/*ffmpeg*.sh', 'TMessagesProj/jni/*libvpx*.sh', 'TMessagesProj/jni/patches/ffmpeg/*') }} + - name: BoringSSL Cache + uses: actions/cache@v4 + if: steps.cache.outputs.cache-hit != 'true' + with: + path: | + TMessagesProj/jni/boringssl/build + key: ${{ hashFiles('boringssl_status') }} + - name: Install NDK + if: steps.cache.outputs.cache-hit != 'true' + run: | + echo "sdk.dir=${ANDROID_HOME}" > local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties + - name: Fix BoringSSL + if: steps.cache.outputs.cache-hit != 'true' + run: | + cd TMessagesProj/jni + ./patch_boringssl.sh + - name: Native Build + if: steps.cache.outputs.cache-hit != 'true' + run: | + export NATIVE_TARGET="${{ matrix.flavor }}" + ./run libs native + build: + name: Gradle Build + runs-on: ndk21 + needs: + - native + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Install NDK + run: | + echo "sdk.dir=${ANDROID_HOME}" > local.properties + echo "ndk.dir=${ANDROID_HOME}/ndk/21.4.7075529" >> local.properties + - name: Fetch Status + run: | + sed -i 's/\/\///g' settings.gradle + git submodule status TMessagesProj/jni/ffmpeg > ffmpeg_status + git submodule status TMessagesProj/jni/boringssl > boringssl_status + - name: Native Cache (armeabi-v7a) + uses: actions/cache@v4 + with: + path: | + TMessagesProj/src/main/libs + key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-armeabi-v7a + - name: Native Cache (arm64-v8a) + uses: actions/cache@v4 + with: + path: | + TMessagesProj/src/main/libs + key: ${{ hashFiles('TMessagesProj/jni/**', 'ffmpeg_status', 'boringssl_status') }}-arm64-v8a + - name: Configure Gradle + run: | + sed -i -e "s/16384/6144/g" gradle.properties + echo "sdk.dir=${ANDROID_HOME}" >> local.properties + - name: Gradle cache + uses: actions/cache@v4 + with: + path: ~/.gradle + key: gradle-${{ hashFiles('**/*.gradle') }} + - name: Debug Build + run: | + export LOCAL_PROPERTIES="${{ secrets.LOCAL_PROPERTIES }}" + ./gradlew TMessagesProj:assembleRelease + + APK=$(find TMessagesProj/build/outputs/apk -name '*arm64-v8a*.apk') + APK=$(dirname $APK) + echo "APK=$APK" >> $GITHUB_ENV + - uses: actions/upload-artifact@v3 + with: + name: Release + path: ${{ env.APK }} + upload: + name: Upload debug + if: github.event.inputs.upload != 'y' + runs-on: ndk21 + needs: + - build + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Donwload Artifacts + uses: actions/download-artifact@v3 + with: + path: artifacts + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.12 + - name: Send to Telegram + run: | + # send release via telegram bot api + export mini64=$(find artifacts -name "*arm64-v8a.apk") + export mini32=$(find artifacts -name "*armeabi-v7a.apk") + + echo $mini64 + echo $mini32 + + python -m pip install -r bin/scripts/requirements.txt + git log -1 --pretty=format:"%s%n%n%b" > artifacts/caption.txt + python bin/scripts/upload.py ${{ secrets.HELPER_BOT_TOKEN }} ${{ secrets.HELPER_BOT_TARGET }} test diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileChannelCell.java b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileChannelCell.java index c279adfa3..f56ade6cc 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileChannelCell.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Cells/ProfileChannelCell.java @@ -423,7 +423,7 @@ public class ProfileChannelCell extends FrameLayout { if (message != null) { if (!usersToLoad.isEmpty()) { - storage.getUsersInternal(TextUtils.join(",", usersToLoad), users); + storage.getUsersInternal(usersToLoad, users); } if (!chatsToLoad.isEmpty()) { storage.getChatsInternal(TextUtils.join(",", chatsToLoad), chats); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index 94bbe12ce..4104f5f95 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -9711,7 +9711,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not int maxActionBarItems = (int) (Math.ceil(displayMetrics.widthPixels / (double) AndroidUtilities.dp(54))) - 2; isActionBarTooNarrow = maxActionBarItems < 6; - actionModeViews.add(actionMode.addItemWithWidth(nkactionbarbtn_reply, R.drawable.msg_reply, AndroidUtilities.dp(54), LocaleController.getString("Reply", R.string.Reply))); + actionModeViews.add(actionMode.addItemWithWidth(nkactionbarbtn_reply, R.drawable.menu_reply, AndroidUtilities.dp(54), LocaleController.getString("Reply", R.string.Reply))); actionModeViews.add(actionMode.addItemWithWidth(edit, R.drawable.msg_edit, AndroidUtilities.dp(54), LocaleController.getString("Edit", R.string.Edit))); actionModeViews.add(actionMode.addItemWithWidth(nkactionbarbtn_selectBetween, R.drawable.ic_select_between, AndroidUtilities.dp(54), LocaleController.getString("SelectBetween", R.string.SelectBetween))); actionModeViews.add(actionMode.addItemWithWidth(copy, R.drawable.msg_copy, AndroidUtilities.dp(54), LocaleController.getString("Copy", R.string.Copy))); @@ -18581,7 +18581,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not tagItem.setVisibility(getUserConfig().isPremium() && ( (editItem != null && editItem.getVisibility() == View.VISIBLE ? 1 : 0) + (forwardItem != null && forwardItem.getVisibility() == View.VISIBLE ? 1 : 0) + - (saveItem != null && saveItem.getVisibility() == View.VISIBLE ? 1 : 0) + +// (saveItem != null && saveItem.getVisibility() == View.VISIBLE ? 1 : 0) + (copyItem != null && copyItem.getVisibility() == View.VISIBLE ? 1 : 0) + (deleteItem != null && deleteItem.getVisibility() == View.VISIBLE ? 1 : 0) + (starItem != null && starItem.getVisibility() == View.VISIBLE ? 1 : 0) + @@ -32976,7 +32976,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not searchItem.setSearchFieldText(hashtag.substring(1), false); searchItem.setSearchFieldHint(LocaleController.getString(R.string.SearchHashtagsHint)); } - getMediaDataController().searchMessagesInChat(searchingQuery, dialog_id, mergeDialogId, classGuid, 0, threadMessageId, false, searchingUserMessages, searchingChatMessages, false, searchingReaction); + getMediaDataController().searchMessagesInChat(searchingQuery, dialog_id, mergeDialogId, classGuid, 0, threadMessageId, false, searchingUserMessages, searchingChatMessages, false, searchingReaction, searchingType); updatePinnedMessageView(true); hashtagSearchEmptyView.showProgress(true); showMessagesSearchListView(true); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java index 13fab43c0..a9863517a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java @@ -2958,7 +2958,7 @@ public class ChatActivityEnterView extends BlurredFrameLayout implements Notific if (!hasRecordVideo || calledRecordRunnable) { startedDraggingX = -1; if (hasRecordVideo && isInVideoMode) { - delegate.needStartRecordVideo(1, true, 0, voiceOnce ? 0x7FFFFFFF : 0); + delegate.needStartRecordVideo(1, true, 0, voiceOnce ? 0x7FFFFFFF : 0, 0); } else { if (recordingAudioVideo && isInScheduleMode()) { AlertsCreator.createScheduleDatePickerDialog(parentActivity, parentFragment.getDialogId(), (notify, scheduleDate) -> MediaController.getInstance().stopRecording(1, notify, scheduleDate, voiceOnce), () -> MediaController.getInstance().stopRecording(0, false, 0, voiceOnce), null); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/DeleteMessagesBottomSheet.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/DeleteMessagesBottomSheet.java index ad0f4a77c..e9444d45a 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Components/DeleteMessagesBottomSheet.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/DeleteMessagesBottomSheet.java @@ -998,7 +998,7 @@ public class DeleteMessagesBottomSheet extends BottomSheetWithRecyclerListView { } }); - applyInCommonGroup.performAction((participant, i) -> { + applyInCommonGroup.forEachSelected((participant, i) -> { if (participant instanceof TLRPC.User) { boolean needBan = banOrRestrict.checkOption(participant); boolean needDelete = banOrRestrict.checkOption(participant); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/BaseNekoSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/BaseNekoSettingsActivity.java index b4ec71a9e..3efef5c6d 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/BaseNekoSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/BaseNekoSettingsActivity.java @@ -43,6 +43,7 @@ import org.telegram.ui.Components.RecyclerListView; import org.telegram.ui.Components.SizeNotifierFrameLayout; import org.telegram.ui.Components.URLSpanNoUnderline; +import java.util.ArrayList; import java.util.HashMap; import java.util.Locale; @@ -198,7 +199,7 @@ public abstract class BaseNekoSettingsActivity extends BaseFragment { } @Override - protected void drawList(Canvas blurCanvas, boolean top) { + protected void drawList(Canvas blurCanvas, boolean top, ArrayList views) { for (int j = 0; j < listView.getChildCount(); j++) { View child = listView.getChildAt(j); if (child.getY() < listView.blurTopPadding + AndroidUtilities.dp(100)) { diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoEmojiSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoEmojiSettingsActivity.java index f0e0ac6bf..c1cc0d13f 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoEmojiSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoEmojiSettingsActivity.java @@ -235,7 +235,7 @@ public class NekoEmojiSettingsActivity extends BaseNekoSettingsActivity implemen } @Override - public void didSelectFiles(ArrayList files, String caption, ArrayList fMessages, boolean notify, int scheduleDate) { + public void didSelectFiles(ArrayList files, String caption, ArrayList fMessages, boolean notify, int scheduleDate, long effectId, boolean invertMedia) { ArrayList filesToUpload = new ArrayList<>(); for (String file : files) { File f = new File(file); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/StickerSizePreviewMessagesCell.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/StickerSizePreviewMessagesCell.java index 6aa5bb00b..de4e8b96a 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/StickerSizePreviewMessagesCell.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/StickerSizePreviewMessagesCell.java @@ -111,7 +111,7 @@ public class StickerSizePreviewMessagesCell extends LinearLayout { messageObjects[1].replyMessageObject = messageObjects[0]; for (int a = 0; a < cells.length; a++) { - cells[a] = new ChatMessageCell(context); + cells[a] = new ChatMessageCell(context, UserConfig.selectedAccount); cells[a].setDelegate(new ChatMessageCell.ChatMessageCellDelegate() { }); cells[a].isChat = false; diff --git a/bin/scripts/upload.py b/bin/scripts/upload.py index fabafff84..2d90f6aa3 100644 --- a/bin/scripts/upload.py +++ b/bin/scripts/upload.py @@ -32,17 +32,18 @@ def get_caption() -> str: def get_document() -> list["InputMediaDocument"]: - return [ - InputMediaDocument( - media=str(find_apk("arm64-v8a")), - thumb=get_thumb(), - ), - InputMediaDocument( - media=str(find_apk("armeabi-v7a")), - thumb=get_thumb(), - caption=get_caption(), - ), - ] + documents = [] + abis = ["arm64-v8a", "armeabi-v7a"] + for abi in abis: + if apk := find_apk(abi): + documents.append( + InputMediaDocument( + media=str(apk), + thumb=get_thumb(), + ) + ) + documents[-1].caption = get_caption() + return documents def retry(func):