去掉基于渠道的判断逻辑,默认按google渠道处理

This commit is contained in:
Max
2024-02-26 17:36:42 +08:00
parent a1144d47c8
commit 3b3b3cea18
5 changed files with 32 additions and 83 deletions

View File

@@ -118,7 +118,6 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
}
binding.ivHelp.setOnClickListener { showHelpPopup() }
binding.tvCharge.setOnClickListener {
val channel = AppMetaDataUtil.getChannelID()
if (position == -1) {
ResUtil.getString(R.string.avroom_firstcharge_firstchargedialog_01).toast()
}
@@ -127,16 +126,6 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
buyProduct(charge.productDetails)
}
}
// if (channel.equals(Constants.GOOGLE)) {
// goodsList?.get(position)?.let { charge ->
// buyProduct(charge.productDetails)
// }
// } else {
// CommonWebViewActivity.start(
// context,
// UriProvider.getOfficialPay(6, DeviceUtil.getDeviceId(context))
// )
// }
}
binding.recyclerView.layoutManager = GridLayoutManager(this, 6)
@@ -220,10 +209,8 @@ class FirstChargeDialog : BaseViewBindingActivity<DialogFirstChargeBinding>(),
binding.rbPlanC.text = "$${goodsList[2].chargeMoney}"
}
}
if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
initBilling()
}
}
private fun initBilling() {
billingManager = IGoogleService.newBillingService(this,this)

View File

@@ -78,11 +78,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
private void onFindViews() {
tvProtocol = findViewById(R.id.tv_protocol);
tvProtocolHint = findViewById(R.id.tv_protocol_hint);
if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
findViewById(R.id.cs_google).setVisibility(View.VISIBLE);
} else {
findViewById(R.id.cs_google).setVisibility(View.GONE);
}
String loginType = SPUtils.getString(SpConstants.LOGIN_TYPE, "");
switch (loginType) {
case SpConstants.GOOGLE:

View File

@@ -188,12 +188,7 @@ class VipMainActivity : BaseViewBindingActivity<ActivityVipMainBinding>(),
binding.tvOpenVip.isVisible = true
binding.slAuth.isVisible = true
binding.tvNotOpen.text = getString(R.string.me_no_aristocracy_yet)
val channel = AppMetaDataUtil.getChannelID()
if (channel.equals(Constants.GOOGLE)) {
initBilling()
} else {
loadData()
}
}
}
@@ -231,7 +226,6 @@ class VipMainActivity : BaseViewBindingActivity<ActivityVipMainBinding>(),
}
binding.tvOpenVip.setOnClickListener {
if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
if ((googleChargeBean?.productDetails?.getOneTimePurchaseOfferDetails()
?.getPriceAmountMicros() ?: "0") == "0"
) {
@@ -267,31 +261,7 @@ class VipMainActivity : BaseViewBindingActivity<ActivityVipMainBinding>(),
}
}
.show(context)
} else {
SelectPayTypeDialog.newInstance(
((chargeInfo?.getMoney() ?: 0.0) * 1000).toInt().toString(),
false,
chargeInfo?.getMoney() ?: 0.0
)
.apply {
setOnDiamondChargeClick {
vipViewModel.openVipWithDiamond()
}
setOnChargeClick {
// if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
ChargeActivity.start(this@VipMainActivity)
// } else {
// CommonWebViewActivity.start(
// this@VipMainActivity, UriProvider.getOfficialPay(
// 4,
// DeviceUtil.getDeviceId(this@VipMainActivity)
// )
// )
// }
}
}
.show(context)
}
}
}

View File

@@ -106,11 +106,7 @@ public class AppUpdateDialog extends DialogFragment implements View.OnClickListe
Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
Uri content_url = null;
if (AppMetaDataUtil.getChannelID().equals(Constants.GOOGLE)) {
content_url = Uri.parse(UriHelper.applyTimestampForUrl(XConstants.appDownloadUrl));//拼接上时间戳,避免访问缓存文件
} else if (newestVersionInfo != null) {
content_url = Uri.parse(newestVersionInfo.getUpdateDownloadLink());
}
intent.setData(content_url);
startActivity(intent);
} catch (Exception e) {

View File

@@ -45,35 +45,35 @@ public class ChannelModel extends BaseModel implements IChannelModel{
* 第一次注册->登录->填写完资料, 调用一下渠道接口,告知渠道统计
*/
private void notifyChannelStatistic(long uid) {
String channel = AppMetaDataUtil.getChannelID();
if ("WM_cpa".equals(channel)) {
Single.create(new SingleOnSubscribe<String>() {
@Override
public void subscribe(SingleEmitter<String> e) throws Exception {
//这里判断新设备,新用户
UserInfo userInfo = UserModel.get().getUserInfo(uid).blockingGet();
if (!userInfo.isNewUser()) {
e.onSuccess(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_01));
return;
}
URL url = new URL(getWMCPAChannelStatisticUrl());
HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
httpURLConnection.setReadTimeout(30 * 1000);
httpURLConnection.setRequestMethod("GET");
httpURLConnection.connect();
int respCode = -1;
if ((respCode = httpURLConnection.getResponseCode()) == 200){
Logger.i(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_02)+respCode );
e.onSuccess(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_03));
}else {
Logger.i(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_04) + respCode);
e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_05)+respCode));
}
httpURLConnection.disconnect();
}
}).subscribeOn(Schedulers.io())
.subscribe();
}
// String channel = AppMetaDataUtil.getChannelID();
// if ("WM_cpa".equals(channel)) {
// Single.create(new SingleOnSubscribe<String>() {
// @Override
// public void subscribe(SingleEmitter<String> e) throws Exception {
// //这里判断新设备,新用户
// UserInfo userInfo = UserModel.get().getUserInfo(uid).blockingGet();
// if (!userInfo.isNewUser()) {
// e.onSuccess(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_01));
// return;
// }
// URL url = new URL(getWMCPAChannelStatisticUrl());
// HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();
// httpURLConnection.setReadTimeout(30 * 1000);
// httpURLConnection.setRequestMethod("GET");
// httpURLConnection.connect();
// int respCode = -1;
// if ((respCode = httpURLConnection.getResponseCode()) == 200){
// Logger.i(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_02)+respCode );
// e.onSuccess(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_03));
// }else {
// Logger.i(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_04) + respCode);
// e.onError(new Throwable(ResUtil.getString(R.string.xchat_android_core_channel_channelmodel_05)+respCode));
// }
// httpURLConnection.disconnect();
// }
// }).subscribeOn(Schedulers.io())
// .subscribe();
// }
}
/**