Compare commits
7 Commits
v4.5.1-251
...
v4.5.2-252
| Author | SHA1 | Date | |
|---|---|---|---|
| 0d9a4baf32 | |||
| 3a9132ff8c | |||
| 02a6ec9f7d | |||
| c779d775e3 | |||
| 3fbcd33f98 | |||
| dbcdd7f3cc | |||
| 69d9854b44 |
@ -185,6 +185,11 @@ public class PackageUtils {
|
||||
|
||||
public static boolean compareSignatureBetweenInstalledAppWithApk(Context context, String packageName, String apkFilePath) {
|
||||
try {
|
||||
// 统计签名比较使用的频率 (大文件会触发 ANR)
|
||||
SentryHelper.INSTANCE.onEvent(
|
||||
"SIGNATURE_COMPARE",
|
||||
"packageName", packageName);
|
||||
|
||||
Signature sig = context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES).signatures[0];
|
||||
|
||||
// Fuck HUAWEI, 华为系统调用 getPackageArchiveInfo 获取魔羯 apk 的签名时会耗时超过5秒造成 ANR,没有找到解决方法
|
||||
|
||||
@ -7,6 +7,7 @@ import android.preference.PreferenceManager
|
||||
import android.text.TextUtils
|
||||
import com.gh.common.constant.Constants
|
||||
import com.gh.common.loghub.LoghubUtils
|
||||
import com.gh.common.runOnIoThread
|
||||
import com.gh.common.util.*
|
||||
import com.gh.gamecenter.entity.GameDigestEntity
|
||||
import com.gh.gamecenter.eventbus.EBPackage
|
||||
@ -106,7 +107,8 @@ object PackageObserver {
|
||||
}
|
||||
})
|
||||
}
|
||||
postNewlyInstalledApp(gameId, packageName)
|
||||
|
||||
runOnIoThread { postNewlyInstalledApp(gameId, packageName) }
|
||||
}
|
||||
|
||||
if ("卸载" == busFour.type) {
|
||||
|
||||
@ -14,6 +14,7 @@ import com.gh.common.exposure.ExposureEvent
|
||||
import com.gh.common.exposure.ExposureSource
|
||||
import com.gh.common.exposure.IExposable
|
||||
import com.gh.common.util.DirectUtils
|
||||
import com.gh.common.util.dip2px
|
||||
import com.gh.gamecenter.R
|
||||
import com.gh.gamecenter.adapter.viewholder.FooterViewHolder
|
||||
import com.gh.gamecenter.baselist.ListAdapter
|
||||
@ -100,6 +101,11 @@ class SpecialCatalogAdapter(context: Context, private val mCatalogViewModel: Cat
|
||||
is CatalogImageItemHolder -> {
|
||||
val imageEntity = mEntityList[position].bigImage!!
|
||||
holder.binding.run {
|
||||
image.layoutParams = image.layoutParams.apply {
|
||||
val imageWidth = mContext.resources.displayMetrics.widthPixels - (80F + 16F + 16F).dip2px()
|
||||
height = imageWidth * 9 / 16
|
||||
}
|
||||
|
||||
entity = imageEntity.image
|
||||
|
||||
var exposureEvent: ExposureEvent? = null
|
||||
|
||||
@ -4,6 +4,7 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import com.gh.common.AppExecutor;
|
||||
import com.gh.common.util.DataUtils;
|
||||
import com.gh.common.util.ExtensionsKt;
|
||||
import com.gh.common.util.InstallUtils;
|
||||
@ -38,7 +39,14 @@ public class InstallAndUninstallReceiver extends BroadcastReceiver {
|
||||
String versionName = PackageUtils.getVersionByPackage(packageName);
|
||||
EBPackage installEb = new EBPackage("安装", packageName, versionName);
|
||||
EventBus.getDefault().post(installEb);
|
||||
PackageObserver.onPackageChanged(installEb);
|
||||
if (PackageUtils.isAppOnForeground(context)) {
|
||||
PackageObserver.onPackageChanged(installEb);
|
||||
} else {
|
||||
// 处于后台运行的时候尝试延迟 1 秒再触发 onPackageChanged (猜测是引起 ANR 的原因)
|
||||
AppExecutor.getUiExecutor().executeWithDelay(() -> {
|
||||
PackageObserver.onPackageChanged(installEb);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
// 接收卸载广播
|
||||
|
||||
@ -28,8 +28,10 @@
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:singleLine="true"
|
||||
android:ellipsize="marquee"
|
||||
android:layout_marginLeft="8dp"
|
||||
android:layout_marginRight="8dp"
|
||||
android:maxLines="2"
|
||||
android:ellipsize="end"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
|
||||
@ -7,8 +7,8 @@ ext {
|
||||
targetSdkVersion = 26
|
||||
|
||||
// application info (每个大版本之间的 versionCode 增加 20)
|
||||
versionCode = 251
|
||||
versionName = "4.5.1"
|
||||
versionCode = 252
|
||||
versionName = "4.5.2"
|
||||
applicationId = "com.gh.gamecenter"
|
||||
|
||||
// AndroidX
|
||||
|
||||
Reference in New Issue
Block a user