parent
54109cb164
commit
4b84d4ce39
|
|
@ -59,12 +59,6 @@
|
|||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
<data android:scheme="ltbqy7"/>
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".act.AgreementAndPrivacyActivity"
|
||||
|
|
@ -149,14 +143,6 @@
|
|||
<meta-data
|
||||
android:name="android.webkit.WebView.EnableSafeBrowsing"
|
||||
android:value="false" />
|
||||
|
||||
<!--openinstall 使用广告推广-->
|
||||
<meta-data
|
||||
android:name="com.openinstall.APP_KEY"
|
||||
android:value="ltbqy7"/>
|
||||
<meta-data
|
||||
android:name="com.openinstall.AD_TRACK"
|
||||
android:value="true"/>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
|
|
@ -22,17 +22,9 @@ import androidx.core.content.FileProvider
|
|||
import androidx.lifecycle.ViewModelProvider
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import com.afollestad.materialdialogs.MaterialDialog
|
||||
import com.cncat.vpn.common.Global
|
||||
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.AppInstallAdapter
|
||||
import com.fm.openinstall.listener.AppInstallListener
|
||||
import com.fm.openinstall.listener.AppWakeUpAdapter
|
||||
import com.fm.openinstall.model.AppData
|
||||
import com.fm.openinstall.model.Error
|
||||
import com.github.gzuliyujiang.oaid.DeviceID
|
||||
import com.github.gzuliyujiang.oaid.DeviceIdentifier
|
||||
import com.google.gson.Gson
|
||||
|
|
@ -139,22 +131,13 @@ class SplashActivity : BaseActivity() {
|
|||
private fun initApplication() {
|
||||
username = Utils.getUniqueID(this)
|
||||
MainApplication.initUtil()
|
||||
// 获取拉起参数
|
||||
openinstall()
|
||||
val oaId = OAID
|
||||
Log.i("SplashActOAID", "OAID::" + OAID + "oaId.isEmpty()::" + oaId.isEmpty())
|
||||
if(oaId.isEmpty()){
|
||||
if (DeviceID.supportedOAID(this)){
|
||||
if(oaId.isEmpty()) {
|
||||
if (DeviceID.supportedOAID(this)) {
|
||||
val aynOAID = DeviceIdentifier.getOAID(this)
|
||||
OAID=aynOAID
|
||||
// BaiduAction.setOaid(aynOAID)
|
||||
// //设置同意隐私政策激活设备
|
||||
// BaiduAction.setPrivacyStatus(PrivacyStatus.AGREE)
|
||||
OAID = aynOAID
|
||||
}
|
||||
}else{
|
||||
// BaiduAction.setOaid(oaId)
|
||||
// //设置同意隐私政策激活设备
|
||||
// BaiduAction.setPrivacyStatus(PrivacyStatus.AGREE)
|
||||
}
|
||||
setLocalLanguage()
|
||||
val clashBinder = MainApplication.getApp()?.let {
|
||||
|
|
@ -199,22 +182,6 @@ class SplashActivity : BaseActivity() {
|
|||
// AESUtil.byteArrayToHexStr(AESUtil.encrypt("https://api.yijianlianjsq.com+https://yjl.kuaifei.net+https://api.onetouchjsq.com+https://yjl.jimao.xyz"))
|
||||
// android.util.Log.i("AAAAAAAAAAA","data:::"+byteArrayToHexStr)
|
||||
}
|
||||
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("OpenInstallAAAAA", "getWakeUp : wakeupData = " + appData.toString());
|
||||
// 获取渠道编号参数
|
||||
val channelCode = appData.getChannel()
|
||||
// 获取自定义参数
|
||||
val bindData = appData.getData()
|
||||
Log.d("OpenInstallAAAAA", "channelCode : bindData = $channelCode"+"bindData::"+bindData)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("JavascriptInterface", "SetJavaScriptEnabled")
|
||||
private fun setWebView() {
|
||||
|
|
@ -374,84 +341,29 @@ class SplashActivity : BaseActivity() {
|
|||
}
|
||||
|
||||
}
|
||||
OpenInstall.getInstall(object : AppInstallListener {
|
||||
override fun onInstallFinish(appData: AppData?, error: Error?) {
|
||||
if (error != null && error.shouldRetry()) {
|
||||
// 获取数据异常,可以尝试重新获取
|
||||
Log.d("OpenInstallError", "数据错误" + error.toString())
|
||||
val reqJson = JsonObject()
|
||||
reqJson.addProperty("password", BZYConstants.defaultPassword)
|
||||
reqJson.addProperty("checkPassword", BZYConstants.defaultPassword)
|
||||
reqJson.addProperty("invitationCode", BuildConfig.productId)
|
||||
reqJson.addProperty("clientIp", "127.0.0.1")
|
||||
reqJson.addProperty("from", "5")
|
||||
reqJson.addProperty("androidDevice", username)
|
||||
reqJson.addProperty("userAgent", userAgent)
|
||||
reqJson.addProperty("oaid", oaId)
|
||||
reqJson.addProperty("equipmentModel", equipmentModel)
|
||||
reqJson.addProperty("pkg", BuildConfig.applicationId)
|
||||
if (captchaInfo.isNotEmpty()) {
|
||||
reqJson.addProperty("captchaVerifyParam", captchaInfo)
|
||||
}
|
||||
if (registerKey.isNotEmpty() && registerIV2.isNotEmpty()) {
|
||||
val data = AESUtil.byteArrayToHexStr(
|
||||
AESUtil.RegisterEncrypt(reqJson.toString(), registerKey, registerIV2)
|
||||
)
|
||||
val params: Map<String, String> = mutableMapOf(
|
||||
"data" to data
|
||||
)
|
||||
splashAtyVM.registerByEncryption(params)
|
||||
}
|
||||
} else {
|
||||
val safeAppData = appData ?: AppData()
|
||||
val channelCode = safeAppData.channel // 获取渠道编号参数
|
||||
val bindData = safeAppData.data // 获取自定义参数
|
||||
android.util.Log.d("OpenInstallSuccess", "获取数据" + safeAppData.toString()+"channelCode::${channelCode}"+"bindData::${bindData}")
|
||||
val data = Gson().fromJson(bindData, InviteData::class.java)
|
||||
InviteCode=data.InviteCode
|
||||
|
||||
android.util.Log.d("OpenInstallSuccess", "InviteCode:::${InviteCode}")
|
||||
|
||||
val reqJson = JsonObject()
|
||||
reqJson.addProperty("password", BZYConstants.defaultPassword)
|
||||
reqJson.addProperty("checkPassword", BZYConstants.defaultPassword)
|
||||
if(InviteCode.isEmpty()){
|
||||
Log.i(
|
||||
"InviteCodeIsEmpty()",
|
||||
"InviteCode::${InviteCode}"
|
||||
)
|
||||
reqJson.addProperty("invitationCode", BuildConfig.productId)
|
||||
}else{
|
||||
reqJson.addProperty("invitationCode", InviteCode)
|
||||
Log.i(
|
||||
"OpenInstallSuccessInviteCode",
|
||||
"InviteCode::${InviteCode}"
|
||||
)
|
||||
}
|
||||
|
||||
reqJson.addProperty("clientIp", "127.0.0.1")
|
||||
reqJson.addProperty("from", "5")
|
||||
reqJson.addProperty("androidDevice", username)
|
||||
reqJson.addProperty("userAgent", userAgent)
|
||||
reqJson.addProperty("oaid", oaId)
|
||||
reqJson.addProperty("equipmentModel", equipmentModel)
|
||||
reqJson.addProperty("pkg", BuildConfig.applicationId)
|
||||
if (captchaInfo.isNotEmpty()) {
|
||||
reqJson.addProperty("captchaVerifyParam", captchaInfo)
|
||||
}
|
||||
if (registerKey.isNotEmpty() && registerIV2.isNotEmpty()) {
|
||||
val data = AESUtil.byteArrayToHexStr(
|
||||
AESUtil.RegisterEncrypt(reqJson.toString(), registerKey, registerIV2)
|
||||
)
|
||||
val params: Map<String, String> = mutableMapOf(
|
||||
"data" to data
|
||||
)
|
||||
splashAtyVM.registerByEncryption(params)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
val reqJson = JsonObject()
|
||||
reqJson.addProperty("password", BZYConstants.defaultPassword)
|
||||
reqJson.addProperty("checkPassword", BZYConstants.defaultPassword)
|
||||
reqJson.addProperty("invitationCode", BuildConfig.productId)
|
||||
reqJson.addProperty("clientIp", "127.0.0.1")
|
||||
reqJson.addProperty("from", "5")
|
||||
reqJson.addProperty("androidDevice", username)
|
||||
reqJson.addProperty("userAgent", userAgent)
|
||||
reqJson.addProperty("oaid", oaId)
|
||||
reqJson.addProperty("equipmentModel", equipmentModel)
|
||||
reqJson.addProperty("pkg", BuildConfig.applicationId)
|
||||
if (captchaInfo.isNotEmpty()) {
|
||||
reqJson.addProperty("captchaVerifyParam", captchaInfo)
|
||||
}
|
||||
if (registerKey.isNotEmpty() && registerIV2.isNotEmpty()) {
|
||||
val data = AESUtil.byteArrayToHexStr(
|
||||
AESUtil.RegisterEncrypt(reqJson.toString(), registerKey, registerIV2)
|
||||
)
|
||||
val params: Map<String, String> = mutableMapOf(
|
||||
"data" to data
|
||||
)
|
||||
splashAtyVM.registerByEncryption(params)
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
|
|
@ -486,8 +398,6 @@ class SplashActivity : BaseActivity() {
|
|||
if (decodeBool) {
|
||||
MMKV.defaultMMKV().encode(BZYConstants.INITIALIZATION, true)
|
||||
}
|
||||
// 用户注册成功后调用
|
||||
OpenInstall.reportRegister()
|
||||
splashAtyVM.login(encryName, encryPsw)
|
||||
} else if (code == "20062") {
|
||||
message?.let {
|
||||
|
|
@ -769,20 +679,4 @@ class SplashActivity : BaseActivity() {
|
|||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
private fun openinstall() {
|
||||
val androidId =
|
||||
Settings.System.getString(baseContext.contentResolver, Settings.Secure.ANDROID_ID)
|
||||
// 所有的设备标识符开发者都可控制,请参考集成文档
|
||||
val configuration: Configuration? = Configuration.Builder()
|
||||
.androidId(androidId)
|
||||
.serialNumber("10086")
|
||||
.build()
|
||||
|
||||
OpenInstall.clipBoardEnabled(false); //false为不读取,true为读取
|
||||
OpenInstall.init(this, configuration)
|
||||
OpenInstall.getWakeUp(intent, wakeUpAdapter)
|
||||
}
|
||||
data class InviteData(
|
||||
val InviteCode: String
|
||||
)
|
||||
}
|
||||
|
|
@ -12,23 +12,14 @@ import androidx.core.content.getSystemService
|
|||
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.fm.openinstall.listener.AppInstallListener
|
||||
import com.fm.openinstall.model.AppData
|
||||
import com.fm.openinstall.model.Error
|
||||
import com.github.gzuliyujiang.oaid.DeviceID
|
||||
import com.github.gzuliyujiang.oaid.DeviceIdentifier
|
||||
import com.github.gzuliyujiang.oaid.IGetter
|
||||
import com.google.gson.Gson
|
||||
|
||||
import com.jakewharton.processphoenix.ProcessPhoenix
|
||||
import com.orhanobut.logger.Logger
|
||||
import com.stripe.android.PaymentConfiguration
|
||||
import com.tencent.mmkv.MMKV
|
||||
import com.yingmao.clash.R
|
||||
import com.yingmao.clash.act.SplashActivity.Companion.InviteCode
|
||||
import com.yingmao.clash.act.SplashActivity.InviteData
|
||||
import com.yingmao.clash.conf.Constants
|
||||
import com.yingmao.clash.entity.UserData
|
||||
import com.yingmao.clash.util.CrashCatchHandler
|
||||
import com.yingmao.clash.util.clashDir
|
||||
|
|
@ -117,7 +108,6 @@ class MainApplication : Application() {
|
|||
mainApplication,
|
||||
"pk_live_51Nkl6vLWP3xWXY4LfXtdMtXzHazv6pav2rH1p1BfICeh5meGGjglExiw4GgmSzWO7NptEM1c549Fe11zRy9nCfxs009zEwLpXP"
|
||||
)
|
||||
OpenInstall.preInit(mainApplication)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -139,13 +129,6 @@ class MainApplication : Application() {
|
|||
Global.init(mApp)
|
||||
val keepRootDir = MMKV.initialize(mApp)
|
||||
Logger.i("MMKV_ROOT_DIR:$keepRootDir")
|
||||
// 是否在控制台输出⽇志,可⽤于观察⽤⼾⾏为⽇志上报情况,建议仅在调试时使⽤,release版 请设置为false !
|
||||
// BaiduAction.setPrintLog(false)
|
||||
// // 是否允许通过应用商店获取referrer信息,仅支持华为、小米;默认true
|
||||
// BaiduAction.enableMarketReferrer(true)
|
||||
// BaiduAction.init(this, Constants.USER_ACTION_SET_ID, Constants.APP_SECRET_KEY)
|
||||
// // 设置应用激活的间隔,此方法在初始化成功后才有意义,建议在初始化后执行,具体执行的时机没有限制
|
||||
// BaiduAction.setActivateInterval(this, 7)
|
||||
|
||||
}
|
||||
private fun extractGeoFiles() {
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue