From 9ede636931bee96ab98e80477edf4adc7333460e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Thu, 25 Jun 2020 16:44:36 +0000 Subject: [PATCH] Fixes --- TMessagesProj/build.gradle | 11 +------- TMessagesProj/debug.keystore | Bin 2513 -> 0 bytes .../messenger/SendMessagesHelper.java | 2 +- .../java/org/telegram/ui/CallLogActivity.java | 2 +- .../telegram/ui/ChannelCreateActivity.java | 1 + .../telegram/ui/ChatRightsEditActivity.java | 2 +- .../tw/nekomimi/nekogram/utils/FileUtil.kt | 24 ++++++++++++++++-- update_jni.sh | 12 +++++---- 8 files changed, 34 insertions(+), 20 deletions(-) delete mode 100644 TMessagesProj/debug.keystore diff --git a/TMessagesProj/build.gradle b/TMessagesProj/build.gradle index 10025372b..f88e4bd4c 100644 --- a/TMessagesProj/build.gradle +++ b/TMessagesProj/build.gradle @@ -210,14 +210,6 @@ android { keyPassword pwd } - debug { - - storeFile project.file('debug.keystore') - storePassword "android" - keyAlias "androiddebugkey" - keyPassword "android" - - } } buildTypes { @@ -225,7 +217,7 @@ android { debuggable true jniDebuggable true multiDexEnabled true - signingConfig signingConfigs.debug + signingConfig signingConfigs.release proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } @@ -235,7 +227,6 @@ android { jniDebuggable false minifyEnabled true shrinkResources true - signingConfig signingConfigs.release } release { diff --git a/TMessagesProj/debug.keystore b/TMessagesProj/debug.keystore deleted file mode 100644 index 87a727d3fe94243866ae898ff7a722c5c8fbc040..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2513 zcmY+EX*kpi8^-@*#=afXsE~cH!4Srhkwha-LdU)x8L|!8Dq9*%wq$8+H8KoFmTXbB z5ZT7qvt%q0*%c{E<9Ofeeb2ehhv&MV>%Q;j`S?TN*!!43U<8gG&%%BdkH-Jt2C;&2 zaqM>>IQD>J+ZTaj4*gfe>{~qQlYjq+4-HydVq*dW@2*2|kglU*E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IKlapb+gCN)`llu<-=gWbrt96tWPt}OjaIwHz@}c@+{Kv1LBthN*qRqnN-=;9b zEgLX`tO9QYb LY8ew4gwOp8uBWE3 diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java index 6604c3af6..044e10a50 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/SendMessagesHelper.java @@ -6036,7 +6036,7 @@ public class SendMessagesHelper extends BaseController implements NotificationCe if (forceDocument) { videoEditedInfo = null; } else { - videoEditedInfo = info.videoEditedInfo; + videoEditedInfo = info.videoEditedInfo != null ? info.videoEditedInfo : createCompressionSettings(info.path); } if (!forceDocument && (videoEditedInfo != null || info.path.endsWith("mp4"))) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/CallLogActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/CallLogActivity.java index d86d07dd4..78de519ba 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/CallLogActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/CallLogActivity.java @@ -451,7 +451,7 @@ public class CallLogActivity extends BaseFragment implements NotificationCenter. BottomBuilder builder = new BottomBuilder(getParentActivity()); builder.addTitle(LocaleController.getString("ConfirmDeleteCallLog", R.string.ConfirmDeleteCallLog)); - builder.addItem(LocaleController.getString("Delete", R.string.Delete), R.drawable.baseline_delete_24, (dialog, which) -> { + builder.addItem(LocaleController.getString("Delete", R.string.Delete), R.drawable.baseline_delete_24, (cell) -> { ArrayList ids = new ArrayList<>(); for (TLRPC.Message msg : row.calls) { ids.add(msg.id); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChannelCreateActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChannelCreateActivity.java index b99c737c8..db05a7c2b 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChannelCreateActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChannelCreateActivity.java @@ -16,6 +16,7 @@ import android.content.Context; import android.content.Intent; import android.graphics.Canvas; import android.graphics.Paint; +import android.graphics.PorterDuff; import android.graphics.PorterDuffColorFilter; import android.os.Bundle; import android.os.Vibrator; diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatRightsEditActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatRightsEditActivity.java index 2319140fd..06ed4bfc8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatRightsEditActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatRightsEditActivity.java @@ -974,7 +974,7 @@ public class ChatRightsEditActivity extends BaseFragment { int left = MAX_RANK_LENGTH - (currentRank != null ? currentRank.codePointCount(0, currentRank.length()) : 0); if (left <= MAX_RANK_LENGTH - MAX_RANK_LENGTH * 0.7f) { headerCell.setText2(String.format("%d", left)); - SimpleTextView textView = headerCell.getTextView2(); + TextView textView = headerCell.getTextView2(); String key = left < 0 ? Theme.key_windowBackgroundWhiteRedText5 : Theme.key_windowBackgroundWhiteGrayText3; textView.setTextColor(Theme.getColor(key)); textView.setTag(key); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/FileUtil.kt b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/FileUtil.kt index a12998d3e..2809ceab7 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/FileUtil.kt +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/utils/FileUtil.kt @@ -192,17 +192,37 @@ object FileUtil { if (!newFile.isFile) { + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.M) { + + Build.SUPPORTED_ABIS.forEachIndexed { index, abi -> + + runCatching { + + saveNonAsset("lib/$abi/${execFile.name}", execFile) + + FileLog.d("lib extracted with default abi$index ($abi): $execFile") + + } + + } + + error("library not found ${execFile.name}") + + } + + } else { + runCatching { saveNonAsset("lib/${Build.CPU_ABI}/${execFile.name}", execFile) - FileLog.d("lib extracted with default abi: $execFile, ${Build.CPU_ABI}") + FileLog.d("lib extracted with default abi (${Build.CPU_ABI}): $execFile") }.recover { saveNonAsset("lib/${Build.CPU_ABI2}/${execFile.name}", execFile) - FileLog.d("lib extracted with abi2: $execFile, ${Build.CPU_ABI2}") + FileLog.d("lib extracted with abi2 (${Build.CPU_ABI2}): $execFile") } diff --git a/update_jni.sh b/update_jni.sh index dcf42c10e..26ac6f018 100755 --- a/update_jni.sh +++ b/update_jni.sh @@ -1,6 +1,6 @@ #!/bin/bash -rm TMessagesProj/libs/*.aar +rm -f TMessagesProj/libs/*.aar ./gradlew ss-rust:assembleRelease @@ -31,14 +31,16 @@ cd ../.. OUT=TMessagesProj/build/intermediates/ndkBuild/fullFoss/obj/local DIR=TMessagesProj/src/main/libs -rm $DIR/armeabi-v7a/* +rm -rf $DIR + +mkdir -p $DIR/armeabi-v7a cp $OUT/armeabi-v7a/*.so $DIR/armeabi-v7a -rm $DIR/arm64-v8a/* +mkdir -p $DIR/arm64-v8a cp $OUT/arm64-v8a/*.so $DIR/arm64-v8a -rm $DIR/x86/* +mkdir -p $DIR/x86 cp $OUT/x86/*.so $DIR/x86 -rm $DIR/x86_64/* +mkdir -p $DIR/x86_64 cp $OUT/x86_64/*.so $DIR/x86_64 \ No newline at end of file