Compare commits

...

20 Commits

Author SHA1 Message Date
681e2cd4ee build: 添加 3.7.0 版本的 sentry plugin 缓存
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-24 10:15:39 +08:00
883dad8f06 build: 添加 3.7.0 版本的 sentry plugin 缓存
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 15:51:23 +08:00
0d650d2d00 build: 添加 3.7.0 版本的 sentry plugin 缓存
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 15:50:47 +08:00
8f8ac99dae chore: 版本更新至 5.38.2
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 12:37:29 +08:00
0be7db94ad Merge branch 'hotfix/v5.38.1-1111/crashes' into 'release'
修复 5.38.1 的部分闪退问题

See merge request halo/android/assistant-android!1947
2024-10-23 11:52:09 +08:00
ae80359b48 Merge branch 'fix/catch_view_lifecycle_owner_crash' into 'release'
fix: 捕获加载图片时获取ViewLifecycleOwner出现的闪退问题

See merge request halo/android/assistant-android!1946
2024-10-23 11:47:53 +08:00
81281855a1 fix: 修复继续下载 VA 插件异常时的闪退问题(遇到异常尝试重下) https://sentry.shanqu.cc/organizations/lightgame/issues/416793
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 11:28:58 +08:00
a5174c6931 fix: 捕获加载图片时获取ViewLifecycleOwner出现的闪退问题 2024-10-23 11:16:36 +08:00
a3cc74afb3 fix: 修复部分位置在处理图片选择回调时处理不合理造成的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/416811
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 10:13:39 +08:00
84e78de6fc fix: 当 PackageName 为空时的闪退问题 https://sentry.shanqu.cc/organizations/lightgame/issues/416770
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-23 09:54:50 +08:00
9bf4c73250 chore: 版本更新至 5.38.1
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-22 15:13:34 +08:00
57a222b87a Merge branch 'hotfix/v5.38.0-1110/get_install_list_anr' into 'release'
fix: 修复错误使用全量已安装应用列表进行应用是否已安装判断依据的问题

See merge request halo/android/assistant-android!1945
2024-10-22 10:42:53 +08:00
3e125b90a2 fix: 修复错误使用全量已安装应用列表进行应用是否已安装判断依据的问题
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-22 10:32:33 +08:00
1809265d4f Merge branch 'fix/sentry-415534' into 'release'
fixed: Sentry415534 VA启动游戏弹窗报“Can not perform this action after onSaveInstanceState”的异常问题

See merge request halo/android/assistant-android!1944
2024-10-22 10:10:36 +08:00
3b3774596d fixed: Sentry415534 VA启动游戏弹窗报“Can not perform this action after onSaveInstanceState”的异常问题 2024-10-22 09:58:40 +08:00
bded49c366 Merge branch 'hotfix/v5.38.0-1110/remove_duplicated_sentry_log' into 'release'
fix: 移除部分 Sentry 日志上报,避免数据量过大

See merge request halo/android/assistant-android!1943
2024-10-21 18:04:47 +08:00
841711b5f1 fix: 移除部分 Sentry 日志上报,避免数据量过大
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-21 18:02:17 +08:00
7a080115a7 Merge branch 'hotfix/v5.38.0-1110/remove_duplicated_sentry_log' into 'release'
fix: 移除 AndroidException 类型的 Sentry 日志上报,避免数据量过大

See merge request halo/android/assistant-android!1942
2024-10-21 17:31:24 +08:00
337c4724a7 fix: 移除 AndroidException 类型的 Sentry 日志上报,避免数据量过大
Signed-off-by: chenjuntao <chenjuntao@ghzhushou.com>
2024-10-21 17:28:44 +08:00
2119691bf6 Merge branch 'fix/GHZSCY-6799' into 'release'
fix: 【光环助手】V5.38版本群测汇总(1) https://jira.shanqu.cc/browse/GHZSCY-6799

See merge request halo/android/assistant-android!1941
2024-10-18 16:12:03 +08:00
11 changed files with 72 additions and 74 deletions

View File

@ -72,6 +72,7 @@ android_build:
only:
- dev
- release
- pack/update_sentry_plugin_cache
# 代码检查
sonarqube_analysis:
@ -157,3 +158,4 @@ oss-upload&send-email:
only:
- dev
- release
- pack/update_sentry_plugin_cache

View File

@ -1,9 +1,6 @@
package com.gh.common.util;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Handler;
import android.os.Message;
@ -19,10 +16,8 @@ import org.greenrobot.eventbus.EventBus;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 下载完成跳安装,
*/
@ -49,15 +44,15 @@ public class InstallUtils {
@Override
public void handleMessage(Message msg) {
if (msg.what == INSTALL_WHAT && packageManager != null) {
List<String> packageNameList = PackageHelper.INSTANCE.getInstalledPackageNameList(context, 0);
ArrayList<String> list = new ArrayList<>(packageNameList);
if (installMap != null && installMap.size() != 0) {
ArrayList<String> keys = new ArrayList<>();
for (String packageName : installMap.keySet()) {
if (TextUtils.isEmpty(packageName)) continue;
long time = installMap.get(packageName);
if (System.currentTimeMillis() - time >= MAX_TIME) {
keys.add(packageName);
} else if (list.contains(packageName)) {
} else if (PackageUtils.isInstalled(context, packageName)) {
keys.add(packageName);
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntityByPackageName(packageName);
@ -80,7 +75,7 @@ public class InstallUtils {
long time = uninstallMap.get(packageName);
if (System.currentTimeMillis() - time >= MAX_TIME) {
keys.add(packageName);
} else if (!list.contains(packageName)) {
} else if (!PackageUtils.isInstalled(context, packageName)) {
keys.add(packageName);
EventBus.getDefault().post(new EBPackage("卸载", packageName, "", false));
}
@ -105,6 +100,8 @@ public class InstallUtils {
}
public void addInstall(String packageName) {
if (TextUtils.isEmpty(packageName)) return;
if (installMap == null) {
installMap = Collections.synchronizedMap(new HashMap<String, Long>());
}

View File

@ -814,7 +814,7 @@ object PackageHelper {
uploadUIDGapLog = false
val uidGap = (android.os.Process.LAST_APPLICATION_UID - lastValidUid) / 100 * 100
SentryHelper.onEvent("UID_GAP", "gap", uidGap.toString())
// SentryHelper.onEvent("UID_GAP", "gap", uidGap.toString())
}
return packageList

View File

@ -225,17 +225,6 @@ public class PackageUtils {
}
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_META_DATA_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return null;
}
@ -497,7 +486,6 @@ public class PackageUtils {
}
} catch (Exception e) {
e.printStackTrace();
SentryHelper.INSTANCE.onEvent("GET_PACKAGE_INFO_ERROR", "path", path);
}
return null;
@ -640,17 +628,6 @@ public class PackageUtils {
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT).versionName;
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_VERSION_NAME_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return null;
}
@ -664,16 +641,6 @@ public class PackageUtils {
PackageManager.COMPONENT_ENABLED_STATE_DEFAULT).versionCode;
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_VERSION_CODE_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return 0;
}
@ -688,16 +655,6 @@ public class PackageUtils {
return packageManager.getApplicationIcon(packageName);
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_ICON_ERROR",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
}
return null;
}
@ -731,17 +688,6 @@ public class PackageUtils {
return jsonObject;
} catch (Exception e) {
e.printStackTrace();
if (e instanceof AndroidException) {
// 有些设备会出现 DeadSystemException
SentryHelper.INSTANCE.onEvent(
"GET_APP_BASIC_INFO_BY_PACKAGE_NAME",
"packageName",
packageName,
"exception_digest",
e.getLocalizedMessage()
);
}
return jsonObject;
}
}

View File

@ -27,12 +27,24 @@ object SimpleDownloadManager {
val downloadStatus = mDownloadQueue.getStatus(config.uniqueId)
if (downloadStatus != DownloadStatus.PAUSED) {
ExecutorProvider.getInstance().backgroundExecutor.execute {
DownloadMessageHandler.insertDownloadToDatabase(getDownloadEntity(config))
mDownloadQueue.submitNewTask(config)
}
createNewTaskAndDownload(config)
} else {
resume(config.uniqueId)
try {
resume(config.uniqueId)
} catch (e: IllegalArgumentException) {
createNewTaskAndDownload(config)
}
}
}
/**
* 创建新任务并下载
*/
private fun createNewTaskAndDownload(config: DownloadConfig) {
ExecutorProvider.getInstance().backgroundExecutor.execute {
mDownloadQueue.cancel(config.uniqueId)
DownloadMessageHandler.insertDownloadToDatabase(getDownloadEntity(config))
mDownloadQueue.submitNewTask(config)
}
}

View File

@ -8,6 +8,7 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.fragment.app.FragmentTransaction
import androidx.recyclerview.widget.*
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import androidx.viewpager2.widget.ViewPager2.PageTransformer
@ -80,6 +81,26 @@ class VGameInstalledLaunchDialog : DialogFragment() {
}
}
@Deprecated("Deprecated in Java")
override fun show(manager: FragmentManager?, tag: String?) {
try {
val clazz: Class<*> = DialogFragment::class.java
val dismissed = clazz.getDeclaredField("mDismissed")
dismissed.isAccessible = true
dismissed[this] = false
val shownByMe = clazz.getDeclaredField("mShownByMe")
shownByMe.isAccessible = true
shownByMe[this] = true
val transaction = manager!!.beginTransaction()
transaction.add(this, tag)
transaction.commitAllowingStateLoss()
} catch (e: Exception) {
super.show(manager, tag)
e.printStackTrace()
}
}
@Deprecated("Deprecated in Java")
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
return super.onCreateDialog(savedInstanceState).apply {

View File

@ -145,7 +145,7 @@ class WebFragment : LazyFragment(), IScrollable {
}
} else if (requestCode == REQUEST_PICK_IMAGE) {
if (mSelectPicCallback == null && mSelectPicCallbackAboveL == null) return
if (resultCode == Activity.RESULT_OK) {
if (resultCode == Activity.RESULT_OK && data != null) {
val uriList = Matisse.obtainResult(data)
if (uriList.size == 0) return
if (mSelectPicCallbackAboveL != null) {

View File

@ -7,8 +7,8 @@ ext {
targetSdkVersion = 30
// application info (每个大版本之间的 versionCode 增加 20)
versionCode = 1110
versionName = "5.38.0"
versionCode = 1112
versionName = "5.38.2"
applicationId = "com.gh.gamecenter"
applicationIdGat = "com.gh.gamecenter.intl"

View File

@ -480,6 +480,8 @@ open class SuggestAppFragment : ToolbarFragment() {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (data == null) return
if (requestCode == MEDIA_STORE_REQUEST || requestCode == MEDIA_STORE_CREDENTIALS_REQUEST || requestCode == MEDIA_STORE_SCREENSHOT_REQUEST) {
val selectedPaths = Matisse.obtainResult(data) ?: return
val picturePath = PathUtils.getPath(requireContext(), selectedPaths[0])

View File

@ -438,7 +438,13 @@ object ImageUtils {
controllerListener: BaseControllerListener<ImageInfo>? = null,
) {
val lifecycleObserver = view?.getTag(R.id.lifecycle_observer) as? LifecycleObserver
val lifecycle = if (lifecycleObserver != null) view.findFragment()?.viewLifecycleOwner?.lifecycle else null
val lifecycle = if (lifecycleObserver != null) {
try {
view.findFragment()?.viewLifecycleOwner?.lifecycle
} catch (e: Exception) {
null
}
} else null
lifecycleObserver?.let {
lifecycle?.removeObserver(it)
view.setTag(R.id.lifecycle_observer, null)
@ -487,7 +493,12 @@ object ImageUtils {
super.onFinalImageSet(id, imageInfo, animatable)
controllerListener?.onFinalImageSet(id, imageInfo, animatable)
animatable?.let {
(lifecycle ?: view?.findFragment()?.viewLifecycleOwner?.lifecycle)?.run {
val viewLifecycle = try {
lifecycle ?: view?.findFragment()?.viewLifecycleOwner?.lifecycle
} catch (e: Exception) {
null
}
viewLifecycle?.run {
val observer = object : DefaultLifecycleObserver {
override fun onPause(owner: LifecycleOwner) {
super.onPause(owner)

View File

@ -9,6 +9,13 @@ build_time_without_divider=$(TZ=Asia/Shanghai date +'%Y%m%d%H%M')L
post_init_script=init.internal.gradle
# 开启 mapping 上传
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' '1 a plugins { id "io.sentry.android.gradle" version "3.7.0" } ' app/build.gradle
else
sed -i '1 a plugins { id "io.sentry.android.gradle" version "3.7.0" }' app/build.gradle
fi
git checkout module_common/build.gradle
git checkout gradle.properties