日期:2025.9.2

分支:yijianlian
需求:
1.一键连集成Openinstall
This commit is contained in:
level 2025-09-02 17:08:12 +08:00
parent 88fec73e3d
commit e3f8934195
12 changed files with 70 additions and 132 deletions

View File

@ -15,7 +15,7 @@ dependencies {
implementation(fileTree(mapOf("dir" to "src/main/libs", "include" to listOf("*.aar"))))
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")
implementation(files("src\\main\\libs\\Baidu_ocpc_action_2_7_2.aar"))
// implementation(files("src\\main\\libs\\OpenInstall_v2.8.5.jar"))
implementation(files("src\\main\\libs\\OpenInstall.jar"))
// implementation("com.google.firebase:firebase-crashlytics-buildtools:3.0.2")
// implementation(files("src/main/libs/openinstall.jar"))

View File

@ -340,9 +340,8 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
SpannableStringBuilder(resources.getString(R.string.AgreeAgreement))
val clickableSpan: MyClickableSpan = object : MyClickableSpan() {
override fun onClick(view: View) {
val backgroundColorSpan = BackgroundColorSpan("#4072FE".toColorInt())
spannableStringBuilder.setSpan(
backgroundColorSpan,
null,
5,
24,
Spannable.SPAN_EXCLUSIVE_INCLUSIVE
@ -360,9 +359,8 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
val privacyClickableSpan: MyClickableSpan = object : MyClickableSpan() {
override fun onClick(view: View) {
val backgroundColorSpan = BackgroundColorSpan("#4072FE".toColorInt())
spannableStringBuilder.setSpan(
backgroundColorSpan,
null,
27,
resources.getString(R.string.AgreeAgreement).length,
Spannable.SPAN_EXCLUSIVE_INCLUSIVE
@ -389,9 +387,8 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
SpannableStringBuilder(resources.getString(R.string.AgreeAgreement))
val clickableSpan: MyClickableSpan = object : MyClickableSpan() {
override fun onClick(view: View) {
val backgroundColorSpan = BackgroundColorSpan("#4072FE".toColorInt())
spannableStringBuilder.setSpan(
backgroundColorSpan,
null,
2,
8,
Spannable.SPAN_EXCLUSIVE_INCLUSIVE
@ -409,9 +406,8 @@ class LoginActivity : BaseActivity(), View.OnClickListener {
val privacyClickableSpan: MyClickableSpan = object : MyClickableSpan() {
override fun onClick(view: View) {
val backgroundColorSpan = BackgroundColorSpan("#4072FE".toColorInt())
spannableStringBuilder.setSpan(
backgroundColorSpan,
null,
9,
15,
Spannable.SPAN_EXCLUSIVE_INCLUSIVE

View File

@ -34,7 +34,7 @@ public abstract class MyClickableSpan extends ClickableSpan {
*/
@Override
public void updateDrawState(@NonNull TextPaint ds) {
ds.setColor(Color.parseColor("#f11f04"));
ds.setColor(Color.parseColor("#4072FE"));
ds.setUnderlineText(false);
}

View File

@ -28,6 +28,10 @@ import com.baidu.mobads.action.PrivacyStatus
import com.cncat.vpn.service.ClashManager
import com.cncat.vpn.service.remote.IClashManager
import com.cncat.vpn.service.remote.wrap
import com.fm.openinstall.Configuration
import com.fm.openinstall.OpenInstall
import com.fm.openinstall.listener.AppWakeUpAdapter
import com.fm.openinstall.model.AppData
import com.github.gzuliyujiang.oaid.DeviceID
import com.github.gzuliyujiang.oaid.DeviceIdentifier
import com.google.gson.JsonObject
@ -189,6 +193,24 @@ class SplashActivity : BaseActivity() {
// AESUtil.byteArrayToHexStr(AESUtil.encrypt("https://api.yijianlianjsq.com+https://yjl.kuaifei.net+https://api.onetouchjsq.com"))
// android.util.Log.i("AAAAAAAAAAA","data:::"+byteArrayToHexStr)
// 获取拉起参数
openinstall()
}
override fun onNewIntent(intent: Intent?) {
super.onNewIntent(intent)
// 此处要调用否则App在后台运行时会无法获取
OpenInstall.getWakeUp(intent, wakeUpAdapter)
}
private var wakeUpAdapter: AppWakeUpAdapter = object : AppWakeUpAdapter() {
override fun onWakeUp(appData: AppData) {
// 打印数据便于调试
Log.d("OpenInstall", "getWakeUp : wakeupData = $appData")
// 获取渠道编号参数
val channelCode = appData.getChannel()
// 获取自定义参数
val bindData = appData.getData()
Log.d("OpenInstall", "channelCode : bindData = $channelCode"+"bindData::"+bindData)
}
}
@SuppressLint("JavascriptInterface", "SetJavaScriptEnabled")
private fun setWebView() {
@ -686,4 +708,24 @@ class SplashActivity : BaseActivity() {
}
startActivity(intent)
}
private fun openinstall() {
// 所有的设备标识符开发者都可控制,请参考集成文档
val configuration: Configuration? = Configuration.Builder() //
// .serialNumber(null) // 禁止 SDK 获取 serialNumber
// 只有在使用“移动广告效果监测”功能时才开启
// .adEnabled(true)
// .imeiDisabled() // 禁止 SDK 获取 imei
// .oaid("传入获取到的oaid")
.build()
OpenInstall.init(this, configuration)
//获取唤醒参数
OpenInstall.getWakeUp(intent, wakeUpAdapter)
// 1、如果在“Android集成” -> “Android下载配置” 中启用了 “集成应用宝” 开关并填入正确的应用宝地址
// 请替换使用 getWakeUpYYB ,则可实现微信/QQ中打开应用并还原参数
// OpenInstall.getWakeUpYYB(SplashActivity.this, getIntent(), wakeUpAdapter);
// 2、 如果想只要调用了接口,无论是否有数据时都走回调
// 请替换使用 getWakeUpAlwaysCallback ,则可统一在回调中做业务跳转
// OpenInstall.getWakeUpAlwaysCallback(getIntent(), wakeUpAdapter);
}
}

View File

@ -13,6 +13,7 @@ import com.baidu.mobads.action.BaiduAction
import com.cncat.vpn.common.Global
import com.cncat.vpn.common.compat.currentProcessName
import com.cncat.vpn.common.log.Log
import com.fm.openinstall.OpenInstall
import com.github.gzuliyujiang.oaid.DeviceID
import com.github.gzuliyujiang.oaid.DeviceIdentifier
import com.github.gzuliyujiang.oaid.IGetter
@ -111,6 +112,7 @@ class MainApplication : Application() {
mainApplication,
"pk_live_51Nkl6vLWP3xWXY4LfXtdMtXzHazv6pav2rH1p1BfICeh5meGGjglExiw4GgmSzWO7NptEM1c549Fe11zRy9nCfxs009zEwLpXP"
)
OpenInstall.preInit(mainApplication)
}
}

View File

@ -1,118 +0,0 @@
package com.yingmao.clash.view.dialog
import android.app.Activity
import android.content.Context
import android.content.DialogInterface
import android.view.LayoutInflater
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import com.yingmao.clash.R
import com.yingmao.clash.conf.PayType
/**
* @author tamsiree
* @date 2016/7/19
* 确认 取消 Dialog
*/
open class DialogPayTypeChoose : RxDialog {
lateinit var titleView: TextView
private set
lateinit var rb_wxpay: View
private set
lateinit var rb_alipay: View
private set
lateinit var rb_typay: View
private set
lateinit var rb_alipay_app: View
private set
lateinit var rg_pay_type: LinearLayout
private set
lateinit var onPayTypeCheckedListener: OnPayTypeCheckedListener
private set
private var title: String = ""
constructor(context: Context?, themeResId: Int) : super(context!!, themeResId) {
initView()
}
constructor(
context: Context?,
cancelable: Boolean,
cancelListener: DialogInterface.OnCancelListener?,
) : super(context!!, cancelable, cancelListener) {
initView()
}
constructor(context: Context?) : super(context!!) {
initView()
}
constructor(context: Activity?) : super(context!!) {
initView()
}
constructor(context: Context?, alpha: Float, gravity: Int) : super(context, alpha, gravity) {
initView()
}
private fun initView() {
val dialogView = LayoutInflater.from(context).inflate(R.layout.dialog_pay_type_choose, null)
titleView = dialogView.findViewById(R.id.tv_title)
rg_pay_type = dialogView.findViewById(R.id.rg_pay_type)
rb_alipay = dialogView.findViewById(R.id.rb_alipay)
rb_typay = dialogView.findViewById(R.id.rb_typay)
rb_alipay_app = dialogView.findViewById(R.id.rb_alipay_app)
rb_wxpay = dialogView.findViewById(R.id.rb_wxpay)
if (title.isBlank()) {
titleView.visibility = View.GONE
}
setContentView(dialogView)
rb_alipay_app.setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_ALI_APP)
}
rb_alipay.setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_ALI)
}
rb_wxpay.setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_WX)
}
rb_typay.setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_Stripe)
}
dialogView.findViewById<ImageView>(R.id.iv_bilai_zfb).setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_ZFB)
}
dialogView.findViewById<ImageView>(R.id.iv_bilai_wx).setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_WX)
}
dialogView.findViewById<ImageView>(R.id.iv_bilai_jd).setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_ZFB)
}
dialogView.findViewById<LinearLayout>(R.id.ll_bilai_url).setOnClickListener {
onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_WEB)
}
}
fun setOnPayTypeCheckedListener(onPayTypeCheckedListener: OnPayTypeCheckedListener) {
this.onPayTypeCheckedListener = onPayTypeCheckedListener
}
interface OnPayTypeCheckedListener {
fun onPayTypeChecked(payType: String)
}
fun setTitle(titleStr: String) {
title = titleStr
if (title.isBlank()) {
titleView.visibility = View.GONE
return
}
titleView.visibility = View.VISIBLE
titleView.text = title
}
}

Binary file not shown.

View File

@ -103,7 +103,7 @@
<string name="vertify_failed">Verification failed, there are still %d Next chance</string>
<string name="aggregatePayment">Aggregate payment (recommended)</string>
<string name="quickPayment">Quick payment</string>
<string name="firstEntry">The free duration has been gifted. If initialization occurs, please wait for one minute before closing the app and reopening it.</string>
<string name="firstEntry">If initialization occurs, please wait for one minute before closing the app and reopening it.</string>
<string name="determine">determine</string>
<string name="reminder">reminder</string>
<string name="UploadErrorLog">Upload error log</string>

View File

@ -102,7 +102,7 @@
<string name="vertify_failed">驗證失敗,還剩%d次機會</string>
<string name="aggregatePayment">聚合支付(推薦)</string>
<string name="quickPayment">快捷支付</string>
<string name="firstEntry">免費時長已贈送,如果出現初始化請等待壹分鍾後關閉app重新打開.</string>
<string name="firstEntry">如果出現初始化請等待壹分鍾後關閉app重新打開.</string>
<string name="determine">確定</string>
<string name="reminder">温馨提示</string>
<string name="UploadErrorLog">上傳錯誤日志</string>

View File

@ -103,7 +103,7 @@
<string name="vertify_failed">驗證失敗,還剩%d次機會</string>
<string name="aggregatePayment">聚合支付(推薦)</string>
<string name="quickPayment">快捷支付</string>
<string name="firstEntry">免費時長已贈送,如果出現初始化請等待壹分鍾後關閉app重新打開.</string>
<string name="firstEntry">如果出現初始化請等待壹分鍾後關閉app重新打開.</string>
<string name="determine">確定</string>
<string name="reminder">温馨提示</string>
<string name="UploadErrorLog">上傳錯誤日志</string>

View File

@ -103,7 +103,7 @@
<string name="vertify_failed">验证失败,还剩%d次机会</string>
<string name="aggregatePayment">聚合支付(推荐)</string>
<string name="quickPayment">快捷支付</string>
<string name="firstEntry">免费时长已赠送,如果出现初始化请等待一分钟后关闭app重新打开.</string>
<string name="firstEntry">如果出现初始化请等待一分钟后关闭app重新打开.</string>
<string name="determine">确定</string>
<string name="reminder">温馨提示</string>
<string name="UploadErrorLog">上传错误日志</string>

View File

@ -109,6 +109,22 @@ subprojects {
)
)
}
create("2708") {
isDefault = true
dimension = flavorDimensionList[0]
buildConfigField("boolean", "PREMIUM", "Boolean.parseBoolean(\"false\")")
buildConfigField("boolean", "is_free", "false")
buildConfigField("boolean", "is_back_cn", "false")
buildConfigField("String", "applicationId", "\"com.jsq.wufu\"")
buildConfigField("String", "service_url", "\"https://api.yijianlianjsq.com/\"")
buildConfigField("String", "productId", "\"2708\"")
manifestPlaceholders(
mapOf(
"APP_NAME" to "@string/wf",
"APP_ICON" to "@mipmap/oneclickconnection"
)
)
}
}
sourceSets {