Compare commits

..

1 Commits

Author SHA1 Message Date
87af153c0d build: 构建编译镜像 2024-10-17 12:29:11 +08:00
14 changed files with 84 additions and 68 deletions

View File

@ -11,7 +11,6 @@ docker-build:
script:
- projectPath=`echo $CI_PROJECT_PATH | sed 's#/#-#g'`
- date
- rm -rf /home/gitlab-runner/ci-build-cache/$CI_PROJECT_PATH/.gradle/caches/build-cache-1
- cp -R /home/gitlab-runner/ci-build-cache/$CI_PROJECT_PATH/.gradle .
- date
- docker build -t hub-vol.shanqu.cc/ghzs/$projectPath:latest .

View File

@ -588,7 +588,7 @@ document.addEventListener("selectionchange", function(e) {
});
document.addEventListener("selectionchange", function(e) {
setTimeout(() => RE.enabledEditingItems(e), 10)
RE.enabledEditingItems(e)
});
RE.recursion = function(dom) {

View File

@ -1,6 +1,9 @@
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;
@ -16,8 +19,10 @@ 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;
/**
* 下载完成跳安装,
*/
@ -44,15 +49,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 (PackageUtils.isInstalled(context, packageName)) {
} else if (list.contains(packageName)) {
keys.add(packageName);
DownloadEntity downloadEntity = DownloadManager.getInstance().getDownloadEntityByPackageName(packageName);
@ -75,7 +80,7 @@ public class InstallUtils {
long time = uninstallMap.get(packageName);
if (System.currentTimeMillis() - time >= MAX_TIME) {
keys.add(packageName);
} else if (!PackageUtils.isInstalled(context, packageName)) {
} else if (!list.contains(packageName)) {
keys.add(packageName);
EventBus.getDefault().post(new EBPackage("卸载", packageName, "", false));
}
@ -100,8 +105,6 @@ 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,6 +225,17 @@ 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;
}
@ -486,6 +497,7 @@ public class PackageUtils {
}
} catch (Exception e) {
e.printStackTrace();
SentryHelper.INSTANCE.onEvent("GET_PACKAGE_INFO_ERROR", "path", path);
}
return null;
@ -628,6 +640,17 @@ 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;
}
@ -641,6 +664,16 @@ 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;
}
@ -655,6 +688,16 @@ 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;
}
@ -688,6 +731,17 @@ 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,24 +27,12 @@ object SimpleDownloadManager {
val downloadStatus = mDownloadQueue.getStatus(config.uniqueId)
if (downloadStatus != DownloadStatus.PAUSED) {
createNewTaskAndDownload(config)
} else {
try {
resume(config.uniqueId)
} catch (e: IllegalArgumentException) {
createNewTaskAndDownload(config)
ExecutorProvider.getInstance().backgroundExecutor.execute {
DownloadMessageHandler.insertDownloadToDatabase(getDownloadEntity(config))
mDownloadQueue.submitNewTask(config)
}
}
}
/**
* 创建新任务并下载
*/
private fun createNewTaskAndDownload(config: DownloadConfig) {
ExecutorProvider.getInstance().backgroundExecutor.execute {
mDownloadQueue.cancel(config.uniqueId)
DownloadMessageHandler.insertDownloadToDatabase(getDownloadEntity(config))
mDownloadQueue.submitNewTask(config)
} else {
resume(config.uniqueId)
}
}

View File

@ -8,7 +8,6 @@ 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
@ -81,26 +80,6 @@ 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 && data != null) {
if (resultCode == Activity.RESULT_OK) {
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 = 1112
versionName = "5.38.2"
versionCode = 1110
versionName = "5.38.0"
applicationId = "com.gh.gamecenter"
applicationIdGat = "com.gh.gamecenter.intl"

View File

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

View File

@ -18,7 +18,13 @@ class NavigationBarView @JvmOverloads constructor(
val height = if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
0
} else {
DisplayUtils.retrieveNavigationHeight(context)
val navigationHeight = DisplayUtils.retrieveNavigationHeight(context)
// 小于 100px 的其实不是按键形式的 navigationBar 而是条状的 navigationBar把它当成是 0 处理
if (navigationHeight > 100) {
navigationHeight
} else {
0
}
}
setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), height)
}

View File

@ -7,7 +7,7 @@ plugins {
android {
// 在 DEFAULT_PLUGIN_URL 中提取插件版本号
def defaultPluginUrl = "https://app-static.796697.com/va/plugin/2024/10/17/1.0.3_64_1729148903919.zip"
def defaultPluginUrl = "https://dev-app-static.796697.com/va/plugin/2024/09/02/1.0.3_64_1725265812586.zip"
def versionText = defaultPluginUrl.substring(defaultPluginUrl.lastIndexOf("/") + 1)
def pluginVersionPattern = ~/^\d+.\d+.\d+/
def matcher = versionText =~ pluginVersionPattern

2
vasdk

Submodule vasdk updated: 270ed85b7d...473be43ac0