Skip to content

Commit

Permalink
Merge pull request #89 from ArcticFoxPro/master
Browse files Browse the repository at this point in the history
新增从腾讯服务器配置拉取微信最新测试版下载直链的实验性功能,修复无障碍高对比度下的一处界面 Bug,修复特殊桌面图标的单色图标透明度异常,腾讯应用宝更新获取返回内容对话框采用了更简洁可读的界面
  • Loading branch information
klxiaoniu authored Nov 14, 2024
2 parents de27d9e + a2c3e92 commit bea164c
Show file tree
Hide file tree
Showing 35 changed files with 578 additions and 361 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,13 @@ QQ 版本列表实用工具 for Android 是一个使用 Material 3 组件库构
在 QQ 版本列表实用工具界面,点击底部锥形瓶按钮即可进入实验性功能对话框。

#### 从腾讯服务器配置拉取微信最新测试版下载直链

Android 微信测试版相关信息配置在[腾讯服务器配置文件](https://dldir1.qq.com/weixin/android/weixin_android_alpha_config.json)内。可使用 QQ 版本列表实用工具提供的“从腾讯服务器配置拉取微信最新测试版下载直链”功能尝试获取微信最新测试版下载直链。

> [!WARNING]
> 此功能并非每次请求都能成功获取到 Android 微信测试版下载直链,当无法获取下载直链时可能存在的情况是微信还未发布测试版或测试版已撤包。QQ 版本列表实用工具不对此功能及其任何后果作出任何可靠性保证。请明确并确保自身具备足够的风险识别和承受能力。
#### 腾讯应用宝更新获取(实验性)

QQ、TIM、微信、企业微信、微信输入法使用腾讯应用宝([腾讯应用开放平台](https://app.open.qq.com/))分发软件最新安装包。可使用 QQ 版本列表实用工具提供的腾讯应用宝更新获取(实验性)获取 QQ、TIM、微信、企业微信、微信输入法最新腾讯应用宝上架版本安装包下载直链。
Expand Down
6 changes: 5 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ android {
minSdk = 24
targetSdk = 35
versionCode = gitCommitCount
versionName = "1.4.2-$gitCommitHash"
versionName = "1.4.3-$gitCommitHash"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
Expand Down Expand Up @@ -77,6 +77,9 @@ android {
)
signingConfig =
signingConfigs.findByName("release") ?: signingConfigs.findByName("debug")
signingConfig?.enableV2Signing = true
signingConfig?.enableV3Signing = true
signingConfig?.enableV4Signing = true
}
}

Expand Down Expand Up @@ -108,6 +111,7 @@ dependencies {
implementation(libs.logging.interceptor)
implementation(libs.kotlinx.serialization.json)
implementation(libs.coil)
implementation(libs.coil.network.okhttp)
implementation(libs.androidx.datastore.preferences)
implementation(libs.gson)
implementation(libs.paris)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.xiaoniu.qqversionlist

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@

package com.xiaoniu.qqversionlist.ui

import android.app.DownloadManager
import android.content.Intent
import android.net.Uri
import android.os.Environment
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.appcompat.app.AppCompatActivity.DOWNLOAD_SERVICE
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.card.MaterialCardView
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.xiaoniu.qqversionlist.R
import com.xiaoniu.qqversionlist.databinding.ExpLinkNextButtonBinding
import com.xiaoniu.qqversionlist.databinding.ItemExpBackUrlCardBinding
import com.xiaoniu.qqversionlist.util.ClipboardUtil.copyText
import com.xiaoniu.qqversionlist.util.DataStoreUtil
import com.xiaoniu.qqversionlist.util.Extensions.downloadFile
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -102,77 +98,14 @@ class ExpUrlListAdapter(private val urlList: List<String>) :

expNextBtnDownload.setOnClickListener {
expNextMaterialDialog.dismiss()
if (DataStoreUtil.getBooleanKV(
"downloadOnSystemManager", false
)
) {
val requestDownload =
DownloadManager.Request(Uri.parse(url))
requestDownload.setDestinationInExternalPublicDir(
Environment.DIRECTORY_DOWNLOADS,
url.substringAfterLast('/')
)
val downloadManager =
itemView.context.getSystemService(DOWNLOAD_SERVICE) as DownloadManager
downloadManager.enqueue(requestDownload)
} else {
// 这里不用 Chrome Custom Tab 的原因是 Chrome 不知道咋回事有概率卡在“等待下载”状态
val browserIntent =
Intent(Intent.ACTION_VIEW, Uri.parse(url))
browserIntent.apply {
addCategory(Intent.CATEGORY_BROWSABLE)
flags = Intent.FLAG_ACTIVITY_NEW_TASK
}
itemView.context.startActivity(browserIntent)
}
downloadFile(itemView.context, url)
}

expNextBtnShare.setOnClickListener {
expNextMaterialDialog.dismiss()
val shareIntent = Intent(Intent.ACTION_SEND).apply {
type = "text/plain"
putExtra(
Intent.EXTRA_TEXT,
if (url.contains("downv6.qq.com")) {
if (appSize != "" && appSize != "-1" && appSize != "0") "Android QQ(${
url.substringAfterLast(
'/'
)
})(${itemView.context.getString(R.string.fileSize)}$appSize MB)\n\n${
itemView.context.getString(
R.string.downloadLink
)
}$url\n\n此下载地址指向的 QQ 安装包可能属于测试版本。测试版本可能存在不可预知的稳定性问题,请明确并确保自身具备足够的风险识别和承受能力。"
else "Android QQ(${url.substringAfterLast('/')}\n\n${
itemView.context.getString(
R.string.downloadLink
)
}$url\n\n此下载地址指向的 QQ 安装包可能属于测试版本。测试版本可能存在不可预知的稳定性问题,请明确并确保自身具备足够的风险识别和承受能力。"
} else if (url.contains("imtt.dd.qq.com")) {
val appName = when {
url.contains("com.tencent.mobileqq") -> "Android QQ"
url.contains("com.tencent.tim") -> "Android TIM"
url.contains("com.tencent.mm") -> "Android 微信"
url.contains("com.tencent.wework") -> "Android 企业微信"
url.contains("com.tencent.wetype") -> "Android 微信输入法"
else -> url.substringAfterLast('/')
}

if (appSize != "" && appSize != "-1" && appSize != "0") "${appName}(大小:$appSize MB)\n\n下载地址:$url\n\n来自腾讯应用宝"
else "${appName}\n\n${
itemView.context.getString(R.string.downloadLink)
}$url\n\n来自腾讯应用宝"
} else {
if (appSize != "" && appSize != "-1" && appSize != "0") "Android QQ(${
url.substringAfterLast('/')
})(大小:$appSize MB)\n\n下载地址:$url\n\n此下载地址由 TDS 腾讯端服务 Shiply 发布平台提供,指向的 QQ 安装包可能属于测试版本。测试版本可能存在不可预知的稳定性问题,请明确并确保自身具备足够的风险识别和承受能力。"
else "Android QQ(${url.substringAfterLast('/')}\n\n${
itemView.context.getString(
R.string.downloadLink
)
}$url\n\n此下载地址由 TDS 腾讯端服务 Shiply 发布平台提供,指向的 QQ 安装包可能属于测试版本。测试版本可能存在不可预知的稳定性问题,请明确并确保自身具备足够的风险识别和承受能力。"
}
)
putExtra(Intent.EXTRA_TEXT, url)
}
itemView.context.startActivity(
Intent.createChooser(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.TextView
import android.widget.Toast
import androidx.core.text.HtmlCompat
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.xiaoniu.qqversionlist.R
import com.xiaoniu.qqversionlist.databinding.LocalQqBinding
import com.xiaoniu.qqversionlist.util.DataStoreUtil
import com.xiaoniu.qqversionlist.util.InfoUtil.showToast

class LocalQQAdapter : RecyclerView.Adapter<LocalQQAdapter.LocalQQViewHolder>() {

Expand Down Expand Up @@ -158,11 +158,7 @@ class LocalQQAdapter : RecyclerView.Adapter<LocalQQAdapter.LocalQQViewHolder>()
.setTitle(R.string.localQQVersionDetails)
.setIcon(R.drawable.phone_find_line)
.show()
} else Toast.makeText(
itemView.context,
itemView.context.getString(R.string.longPressToViewSourceDetailsIsDisabled),
Toast.LENGTH_SHORT
).show()
} else showToast(R.string.longPressToViewSourceDetailsIsDisabled)
true
}
} else itemQqInstallCard.isVisible = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import android.widget.TextView
import android.widget.Toast
import androidx.core.text.HtmlCompat
import androidx.core.view.isVisible
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.dialog.MaterialAlertDialogBuilder
import com.xiaoniu.qqversionlist.R
import com.xiaoniu.qqversionlist.databinding.LocalTimBinding
import com.xiaoniu.qqversionlist.util.DataStoreUtil
import com.xiaoniu.qqversionlist.util.InfoUtil.showToast

class LocalTIMAdapter : RecyclerView.Adapter<LocalTIMAdapter.LocalTIMViewHolder>() {

Expand Down Expand Up @@ -139,11 +139,7 @@ class LocalTIMAdapter : RecyclerView.Adapter<LocalTIMAdapter.LocalTIMViewHolder>
.setTitle(R.string.localTIMVersionDetails)
.setIcon(R.drawable.phone_find_line)
.show()
} else Toast.makeText(
itemView.context,
itemView.context.getString(R.string.longPressToViewSourceDetailsIsDisabled),
Toast.LENGTH_SHORT
).show()
} else showToast(R.string.longPressToViewSourceDetailsIsDisabled)
true
}
} else itemTimInstallCard.isVisible = false
Expand Down
Loading

0 comments on commit bea164c

Please sign in to comment.