diff --git a/app/build.gradle.kts b/app/build.gradle.kts index a933983..0bb4daf 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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")) diff --git a/app/src/main/java/com/yingmao/clash/act/LoginActivity.kt b/app/src/main/java/com/yingmao/clash/act/LoginActivity.kt index 786054c..60efe5c 100644 --- a/app/src/main/java/com/yingmao/clash/act/LoginActivity.kt +++ b/app/src/main/java/com/yingmao/clash/act/LoginActivity.kt @@ -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 diff --git a/app/src/main/java/com/yingmao/clash/act/MyClickableSpan.java b/app/src/main/java/com/yingmao/clash/act/MyClickableSpan.java index ab3ff37..38e06fe 100644 --- a/app/src/main/java/com/yingmao/clash/act/MyClickableSpan.java +++ b/app/src/main/java/com/yingmao/clash/act/MyClickableSpan.java @@ -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); } diff --git a/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt b/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt index a96c976..5d2bcc4 100644 --- a/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt +++ b/app/src/main/java/com/yingmao/clash/act/SplashActivity.kt @@ -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); + } } \ No newline at end of file diff --git a/app/src/main/java/com/yingmao/clash/app/MainApplication.kt b/app/src/main/java/com/yingmao/clash/app/MainApplication.kt index d592b89..1c19af0 100644 --- a/app/src/main/java/com/yingmao/clash/app/MainApplication.kt +++ b/app/src/main/java/com/yingmao/clash/app/MainApplication.kt @@ -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) } } diff --git a/app/src/main/java/com/yingmao/clash/view/dialog/DialogPayTypeChoose.kt b/app/src/main/java/com/yingmao/clash/view/dialog/DialogPayTypeChoose.kt deleted file mode 100644 index c8cd559..0000000 --- a/app/src/main/java/com/yingmao/clash/view/dialog/DialogPayTypeChoose.kt +++ /dev/null @@ -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(R.id.iv_bilai_zfb).setOnClickListener { - onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_ZFB) - } - dialogView.findViewById(R.id.iv_bilai_wx).setOnClickListener { - onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_WX) - } - dialogView.findViewById(R.id.iv_bilai_jd).setOnClickListener { - onPayTypeCheckedListener.onPayTypeChecked(PayType.PAY_TYPE_BiLai_ZFB) - } - dialogView.findViewById(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 - } -} \ No newline at end of file diff --git a/app/src/main/libs/OpenInstall.jar b/app/src/main/libs/OpenInstall.jar new file mode 100644 index 0000000..6d48a06 Binary files /dev/null and b/app/src/main/libs/OpenInstall.jar differ diff --git a/app/src/main/res/values-en/strings.xml b/app/src/main/res/values-en/strings.xml index 019bb3a..2ffa7ce 100644 --- a/app/src/main/res/values-en/strings.xml +++ b/app/src/main/res/values-en/strings.xml @@ -103,7 +103,7 @@ Verification failed, there are still %d Next chance Aggregate payment (recommended) Quick payment - The free duration has been gifted. If initialization occurs, please wait for one minute before closing the app and reopening it. + If initialization occurs, please wait for one minute before closing the app and reopening it. determine reminder Upload error log diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 6a34256..cccb984 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -102,7 +102,7 @@ 驗證失敗,還剩%d次機會 聚合支付(推薦) 快捷支付 - 免費時長已贈送,如果出現初始化,請等待壹分鍾後關閉app重新打開. + 如果出現初始化,請等待壹分鍾後關閉app重新打開. 確定 温馨提示 上傳錯誤日志 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index aba11d7..55f633e 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -103,7 +103,7 @@ 驗證失敗,還剩%d次機會 聚合支付(推薦) 快捷支付 - 免費時長已贈送,如果出現初始化,請等待壹分鍾後關閉app重新打開. + 如果出現初始化,請等待壹分鍾後關閉app重新打開. 確定 温馨提示 上傳錯誤日志 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 69fc7c2..30aedff 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -103,7 +103,7 @@ 验证失败,还剩%d次机会 聚合支付(推荐) 快捷支付 - 免费时长已赠送,如果出现初始化,请等待一分钟后关闭app重新打开. + 如果出现初始化,请等待一分钟后关闭app重新打开. 确定 温馨提示 上传错误日志 diff --git a/build.gradle.kts b/build.gradle.kts index 71600b6..16720fe 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -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 {