From e474d6bd57c089e2bb882da18ddb5f353597a69b Mon Sep 17 00:00:00 2001
From: level <1364007522@qq.com>
Date: Wed, 23 Jul 2025 18:25:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E6=8F=90=E4=BA=A4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/build.gradle.kts | 43 +-
app/src/main/AndroidManifest.xml | 3 +
.../yingmao/clash/act/BandPhoneActivity.kt | 5 -
.../yingmao/clash/act/ChangeNodeActivity.kt | 4 +-
.../yingmao/clash/act/ChangeNodeTzActivity.kt | 606 ------------------
.../com/yingmao/clash/act/ExpensesRecordVM.kt | 2 +-
.../com/yingmao/clash/act/NewMainActivity.kt | 4 +-
.../com/yingmao/clash/base/BaseActivity.kt | 226 ++++++-
.../main/java/com/yingmao/clash/conf/Conf.kt | 2 +-
.../yingmao/clash/fragment/NewAccFragment.kt | 49 +-
.../java/com/yingmao/clash/vm/MainAtyVM.kt | 14 -
.../yingmao/clash/webview/BZYWebViewKeFu.kt | 307 +++++++++
app/src/main/res/layout/activity_base.xml | 65 ++
.../res/layout/bzy_kefu_webview_layout.xml | 40 ++
build.gradle.kts | 2 +
15 files changed, 688 insertions(+), 684 deletions(-)
delete mode 100644 app/src/main/java/com/yingmao/clash/act/ChangeNodeTzActivity.kt
create mode 100644 app/src/main/java/com/yingmao/clash/webview/BZYWebViewKeFu.kt
create mode 100644 app/src/main/res/layout/activity_base.xml
create mode 100644 app/src/main/res/layout/bzy_kefu_webview_layout.xml
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
index ec88bad..d27ecea 100644
--- a/app/build.gradle.kts
+++ b/app/build.gradle.kts
@@ -25,7 +25,7 @@ dependencies {
implementation(libs.rikkax.multiprocess)
val commonAar = file("libs/common.aar")
val coreAar = file("libs/core.aar")
- val hideawayEar = file("libs/hideapi.aar")
+ val hideapiAar = file("libs/hideapi.aar")
val serviceAar = file("libs/service.aar")
val oss = file("libs/oss-android-sdk-2.9.19.aar")
if (oss.exists()) {
@@ -45,8 +45,8 @@ dependencies {
println("core.aar does not exist")
}
- if (hideawayEar.exists()) {
- implementation(files(hideawayEar))
+ if (hideapiAar.exists()) {
+ implementation(files(hideapiAar))
} else {
println("hideapi.aar does not exist")
}
@@ -58,14 +58,18 @@ dependencies {
implementation(libs.kotlin.coroutine)
implementation(libs.androidx.core)
+// implementation(libs.androidx.activity)
+// implementation(libs.androidx.fragment)
implementation(libs.androidx.appcompat)
implementation(libs.androidx.coordinator)
implementation(libs.androidx.recyclerview)
implementation(libs.google.material)
- implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.9.1")
- implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.9.1")
- implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.9.1")
+ implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.5.1")
+ implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1")
+ implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.1")
+
+// https://mvnrepository.com/artifact/com.tencent/mmkv-static
implementation("com.tencent:mmkv-static:1.2.10")
implementation ("com.jakewharton:process-phoenix:3.0.0")
@@ -78,13 +82,29 @@ dependencies {
api("com.orhanobut:logger:2.2.0")
api("com.google.code.gson:gson:2.10.1")
api(platform("com.squareup.okhttp3:okhttp-bom:4.10.0"))
+
+ // define any required OkHttp artifacts without version
api("com.squareup.okhttp3:okhttp")
api("com.squareup.okhttp3:logging-interceptor")
+//// https://mvnrepository.com/artifact/com.google.code.gson/gson
+// api("com.google.code.gson:gson:2.10.1")
api("org.yaml:snakeyaml:1.29")
+
+// https://mvnrepository.com/artifact/com.alipay.sdk/alipaysdk-android
implementation("com.alipay.sdk:alipaysdk-android:15.8.17")
+ // https://mvnrepository.com/artifact/com.journeyapps/zxing-android-embedded
+// implementation("com.journeyapps:zxing-android-embedded:3.6.0")
+
+// https://mvnrepository.com/artifact/com.google.zxing/core
+// implementation("com.google.zxing:core:3.5.3")
implementation("com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.4")
+ // https://mvnrepository.com/artifact/com.airbnb.android/lottie
implementation("com.airbnb.android:lottie:5.2.0")
- implementation("com.github.bumptech.glide:glide:4.16.0")
+// https://mvnrepository.com/artifact/com.github.bumptech.glide/glide
+ implementation("com.github.bumptech.glide:glide:4.13.2")
+// implementation("com.luozm.captcha:captcha:1.1.2")
+// implementation("com.aliyun.dpa:oss-android-sdk:2.9.19")
+// implementation ("com.hihonor.mcs:ads-identifier:1.0.3.301")
implementation("com.github.gzu-liyujiang:Android_CN_OAID:4.2.8") {
exclude("com.hihonor.mcs", "ads-identifier")
exclude("com.huawei.hms", "ads-identifier")
@@ -92,7 +112,9 @@ dependencies {
//stripe 支付
implementation("com.stripe:stripe-android:21.4.2")// 使用最新版本
implementation("com.github.getActivity:XXPermissions:20.0")
+ // 华为的最新版本广告标识服务SDK,参阅 https://developer.huawei.com/consumer/cn/doc/HMSCore-Guides/identifier-service-version-change-history-0000001050066927
api ("com.huawei.hms:ads-identifier:3.4.62.300")
+ // 荣耀的最新版本广告标识服务SDK,参阅 https://developer.hihonor.com/cn/kitdoc?kitId=11030&navigation=guides&docId=intergrate.md
api ("com.hihonor.mcs:ads-identifier:1.0.2.301")
implementation("com.android.installreferrer:installreferrer:2.2")// 使用最新版本
@@ -108,7 +130,9 @@ task("downloadGeoFiles") {
val geoFilesUrls = mapOf(
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb" to "geoip.metadb",
- "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat" to "geosite.dat")
+ "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat" to "geosite.dat",
+ // "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country.mmdb" to "country.mmdb",
+ )
doLast {
geoFilesUrls.forEach { (downloadUrl, outputFileName) ->
@@ -159,6 +183,9 @@ android {
abiFilters.add("armeabi-v7a")
}
}
+// sourceSets.all {
+// jniLibs.srcDir("src/main/jniLibs")
+// }
sourceSets.all {
jniLibs.srcDir("src/main/jniLibs")
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 9e242c4..7c1102d 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -166,6 +166,9 @@
+
= mutableListOf()
-
-// var clash: ClashManager? = null
- }
-
- private lateinit var swipeLayout: SwipeRefreshLayout
- private lateinit var changeNodeVM: ChangeNodeVM
- private lateinit var nodeListRv: RecyclerView
- private var names: List? = null
- private lateinit var aiBack: AppCompatImageView
- private var broadcastReceiver: BroadcastReceiver? = null
- private var cacheNodeStr: String? = ""
-
- // private var checkedNode: ClashNodebBean? = null
- private var uuid: UUID? = null
-
- private var testRuning = false
- // var cprofile: ProfileManager? = null
- // private var currentNode: Profile? = null
-
-
- override fun onCreate(savedInstanceState: Bundle?) {
- super.onCreate(savedInstanceState)
- setContentView(R.layout.activity_change_node)
- setMoreBar("线路测速", this)
- changeNodeVM = ViewModelProvider(this).get(ChangeNodeVM::class.java)
- initData()
- initViews()
-
-// cprofile = ProfileManager(this)
- }
-
- override fun onBackPressed() {
- intent.putExtra(BZYConstants.EXTRA_KEY_IS_RUNING, is_runing)
- setResult(2, intent)
- super.onBackPressed()
- }
-
- private fun initData() {
-// clash = MainApplication.getApp()?.let { ClashManager(it) }
- cacheNodeStr = MMKV.defaultMMKV().decodeString(BZYConstants.NODE_All_ITEM_NAME_KEY, "");
-
- val intentFilter = IntentFilter(Intents.ACTION_NODE_LIST)
- broadcastReceiver = NodeListBR()
- if (Build.VERSION.SDK_INT >= 34 && applicationInfo.targetSdkVersion >= 34) {
- registerReceiver(
- broadcastReceiver,
- intentFilter,
- Context.RECEIVER_EXPORTED
- )
- } else {
- registerReceiver(
- broadcastReceiver,
- intentFilter
- )
- }
-// registerReceiver(
-// broadcastReceiver,
-// intentFilter
-// )
- }
-
- @SuppressLint("SetTextI18n")
- private fun initViews() {
- aiBack = findViewById(R.id.aiBack)
- aiBack.setOnClickListener {
- onBackPressed()
- }
- swipeLayout = findViewById(R.id.swipeLayout)
- initRefreshLayout()
- nodeListRv = findViewById(R.id.rv_node_list)
- var userTrafficTv: TextView = findViewById(R.id.node_user_traffic)
-
- findViewById(R.id.iv_back).setOnClickListener {
- onBackPressed()
- }
- initAdapter()
-// Log.d("initViews cacheNodeStr==>${cacheNodeStr}")
- if (!TextUtils.isEmpty(cacheNodeStr)) {
- currentNode = getNodesInfo(cacheNodeStr!!)
- setNewData(currentNode)
- }
-
-// if (!TextUtils.isEmpty(serStore.userTraffic)) {
-// userTrafficTv.visibility=View.VISIBLE
-// var jo = JsonParser.parseString(serStore.userTraffic).asJsonObject
-// var t = jo.get("total")
-// var d = jo.get("download").asLong
-// var u = jo.get("upload").asLong
-// val trafficUsedInGB = String.format("%.2f", (d + u) / 1024.0 / 1024.0 / 1024.0)
-// userTrafficTv.text="已用流量:${trafficUsedInGB}GB"
-// }
- }
-
- private fun getNodesInfo(json: String): MutableList {
- var mList: MutableList = mutableListOf()
- if (TextUtils.isEmpty(json)) {
- return mList
- }
- val gson = Gson()
- var ja = JsonParser.parseString(json).asJsonArray
-
- var cnb = ClashNodebBean("自动选择", "", "", 1, "", "", 0, true);
- mList.add(cnb)
- for (i in 0 until ja.size()) {
- var bean = gson.fromJson(ja.get(i).asString, ClashNodebBean::class.java)
- bean.delay = Utils.generateRandomTwoDigitNumber(10, 60)
- mList.add(bean)
- }
- return mList
- }
-
- inner class NodeListBR : BroadcastReceiver() {
- override fun onReceive(context: Context?, intent: Intent?) {
- when (intent?.action) {
- Intents.ACTION_NODE_LIST -> {
- Log.d("ACTION_NODE_LIST ACTION_NODE_LIST")
-// val parcelableArrayListExtra = intent.getParcelableArrayListExtra