Skip to content

Commit

Permalink
【ID869532311】App数据隐私合规检测风险问题修复-修改大陆中文隐私政策、双清单的链接为灵犀生成的链接。
Browse files Browse the repository at this point in the history
http://tapd.oa.com/NEW_IOT/prong/stories/view/1020393192869532311

Change-Id: I22465d75931b0b6ff360daef6434d30b78661457
  • Loading branch information
SundoggyNew committed Nov 26, 2021
1 parent d633df1 commit 9d92bcb
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 207 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,7 @@ private class TextClick extends ClickableSpan {
public void onClick(View widget) {
Intent intent = new Intent(getContext(), WebActivity.class);
intent.putExtra(CommonField.EXTRA_TITLE, getContext().getString(R.string.register_agree_4));
String url = CommonField.POLICY_PREFIX;
url += "?uin=" + ANDROID_ID;
url += CommonField.PRIVACY_POLICY_SUFFIX;
String url = CommonField.PRIVACY_POLICY_URL_CN_ZH;
intent.putExtra(CommonField.EXTRA_TEXT, url);
getContext().startActivity(intent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,7 @@ class AboutUsActivity : BaseActivity() {
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
val intent = Intent(this@AboutUsActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.register_agree_4))
var url = CommonField.POLICY_PREFIX
url += "?uin=$ANDROID_ID"
url += CommonField.PRIVACY_POLICY_SUFFIX
var url = CommonField.PRIVACY_POLICY_URL_CN_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
Expand All @@ -121,23 +119,27 @@ class AboutUsActivity : BaseActivity() {
}

tv_title_third_party_information -> {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.THIRD_SDK_URL_US_ZH
val intent = Intent(this@AboutUsActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.rule_content_list))
var url = CommonField.THIRD_SDK_URL_US_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
url = CommonField.THIRD_SDK_URL_US_EN
OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.rule_content_list), CommonField.THIRD_SDK_URL_US_EN)
}
OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.rule_content_list), url)
}

tv_title_collected_personal_information -> {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.PERSONAL_INFO_URL_US_ZH
val intent = Intent(this@AboutUsActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.personal_information_list))
var url = CommonField.PERSONAL_INFO_URL_US_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
url = CommonField.PERSONAL_INFO_URL_US_EN
OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.personal_information_list), CommonField.PERSONAL_INFO_URL_US_EN)
}
OpensourceLicenseActivity.startWebWithExtra(this@AboutUsActivity, getString(R.string.personal_information_list), url)
}

tv_title_opensource -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ class ForgotPasswordActivity : PActivity(), ForgotPasswordView, View.OnClickList
}
}
iv_register_agreement.visibility = View.INVISIBLE
// formatTipText()
}

private fun initViewPager() {
Expand All @@ -90,84 +89,6 @@ class ForgotPasswordActivity : PActivity(), ForgotPasswordView, View.OnClickList
emailView.tv_forgot_to_phone.setOnClickListener(this)
}

private fun formatTipText() {
val str = resources.getString(R.string.register_agree_1)
val partStr1 = resources.getString(R.string.register_agree_2)
val partStr2 = resources.getString(R.string.register_agree_3)
val partStr3 = resources.getString(R.string.register_agree_4)
var showStr = str + partStr1 + partStr2 + partStr3
val spannable = SpannableStringBuilder(showStr)
spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
if (presenter.getCountryCode() == "86") {
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
val intent = Intent(this@ForgotPasswordActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.register_agree_2))
var url = CommonField.POLICY_PREFIX
url += "?uin=$ANDROID_ID"
url += CommonField.SERVICE_POLICY_SUFFIX
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
OpensourceLicenseActivity.startWebWithExtra(this@ForgotPasswordActivity, getString(R.string.register_agree_2), CommonField.SERVICE_AGREEMENT_URL_CN_EN)
}
} else {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.SERVICE_AGREEMENT_URL_US_ZH
} else {
url = CommonField.SERVICE_AGREEMENT_URL_US_EN
}
OpensourceLicenseActivity.startWebWithExtra(this@ForgotPasswordActivity, getString(R.string.register_agree_2), url)
}
}

override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = resources.getColor(R.color.blue_0066FF)
ds.setUnderlineText(false);
}
},
str.length, str.length + partStr1.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
if (presenter.getCountryCode() == "86") {
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
val intent = Intent(this@ForgotPasswordActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.register_agree_4))
var url = CommonField.POLICY_PREFIX
url += "?uin=$ANDROID_ID"
url += CommonField.PRIVACY_POLICY_SUFFIX
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
OpensourceLicenseActivity.startWebWithExtra(this@ForgotPasswordActivity, getString(R.string.register_agree_4), CommonField.PRIVACY_POLICY_URL_CN_EN)
}
} else {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.PRIVACY_POLICY_URL_US_ZH
} else {
url = CommonField.PRIVACY_POLICY_URL_US_EN
}
OpensourceLicenseActivity.startWebWithExtra(this@ForgotPasswordActivity, getString(R.string.register_agree_4), url)
}
}

override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = resources.getColor(R.color.blue_0066FF)
ds.setUnderlineText(false);
}

},
showStr.length - partStr1.length, showStr.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

tv_register_tip_click.setMovementMethod(LinkMovementMethod.getInstance())
tv_register_tip_click.setText(spannable)
}

override fun onClick(v: View?) {
when (v) {
phoneView.tv_forgot_to_country, phoneView.iv_forgot_to_country -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,7 @@ class LoginActivity : PActivity(), LoginView, View.OnClickListener, WeChatLogin
val partStr1 = resources.getString(R.string.register_agree_2)
val partStr2 = resources.getString(R.string.register_agree_3)
val partStr3 = resources.getString(R.string.register_agree_4)
val partStr4 = ","
val partStr5 = resources.getString(R.string.rule_content_list)
val partStr6 = resources.getString(R.string.personal_information_list)
var showStr = str + partStr1 + partStr4 + partStr3 + partStr4 + partStr5 + partStr2 + partStr6
var showStr = str + partStr1 + partStr2 + partStr3
val spannable = SpannableStringBuilder(showStr)
spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
Expand Down Expand Up @@ -169,9 +166,7 @@ class LoginActivity : PActivity(), LoginView, View.OnClickListener, WeChatLogin
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
val intent = Intent(this@LoginActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.register_agree_4))
var url = CommonField.POLICY_PREFIX
url += "?uin=$ANDROID_ID"
url += CommonField.PRIVACY_POLICY_SUFFIX
var url = CommonField.PRIVACY_POLICY_URL_CN_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
Expand All @@ -198,49 +193,6 @@ class LoginActivity : PActivity(), LoginView, View.OnClickListener, WeChatLogin
},
str.length + partStr1.length + partStr2.length, str.length + partStr1.length + partStr2.length + partStr3.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.THIRD_SDK_URL_US_ZH
} else {
url = CommonField.THIRD_SDK_URL_US_EN
}
OpensourceLicenseActivity.startWebWithExtra(this@LoginActivity, getString(R.string.rule_content_list), url)

}

override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = resources.getColor(R.color.blue_0066FF)
ds.setUnderlineText(false);
}

},
showStr.length - partStr6.length - partStr2.length - partStr5.length, showStr.length - partStr6.length - partStr2.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {

var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.PERSONAL_INFO_URL_US_ZH
} else {
url = CommonField.PERSONAL_INFO_URL_US_EN
}
OpensourceLicenseActivity.startWebWithExtra(this@LoginActivity, getString(R.string.personal_information_list), url)

}

override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = resources.getColor(R.color.blue_0066FF)
ds.setUnderlineText(false);
}

},
showStr.length - partStr6.length, showStr.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

tv_login_tip.setMovementMethod(LinkMovementMethod.getInstance())
tv_login_tip.setText(spannable)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ class PrivicyDialogActivity : BaseActivity() {
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
val intent = Intent(this@PrivicyDialogActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.register_agree_4))
var url = CommonField.POLICY_PREFIX
url += "?uin=$ANDROID_ID"
url += CommonField.PRIVACY_POLICY_SUFFIX
var url = CommonField.PRIVACY_POLICY_URL_CN_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
Expand All @@ -66,23 +64,27 @@ class PrivicyDialogActivity : BaseActivity() {
}

override fun onOkClickedPersonalInfoList() {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.PERSONAL_INFO_URL_US_ZH
val intent = Intent(this@PrivicyDialogActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.personal_information_list))
var url = CommonField.PERSONAL_INFO_URL_US_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
url = CommonField.PERSONAL_INFO_URL_US_EN
OpensourceLicenseActivity.startWebWithExtra(this@PrivicyDialogActivity, getString(R.string.personal_information_list), CommonField.PERSONAL_INFO_URL_US_EN)
}
OpensourceLicenseActivity.startWebWithExtra(this@PrivicyDialogActivity, getString(R.string.personal_information_list), url)
}

override fun onOkClickedThirdSDKList() {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.THIRD_SDK_URL_US_ZH
val intent = Intent(this@PrivicyDialogActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.rule_content_list))
var url = CommonField.THIRD_SDK_URL_US_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
url = CommonField.THIRD_SDK_URL_US_EN
OpensourceLicenseActivity.startWebWithExtra(this@PrivicyDialogActivity, getString(R.string.rule_content_list), CommonField.THIRD_SDK_URL_US_EN)
}
OpensourceLicenseActivity.startWebWithExtra(this@PrivicyDialogActivity, getString(R.string.rule_content_list), url)
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,7 @@ class RegisterActivity : PActivity(), RegisterView, View.OnClickListener {
val partStr1 = resources.getString(R.string.register_agree_2)
val partStr2 = resources.getString(R.string.register_agree_3)
val partStr3 = resources.getString(R.string.register_agree_4)
val partStr4 = ","
val partStr5 = resources.getString(R.string.rule_content_list)
val partStr6 = resources.getString(R.string.personal_information_list)
var showStr = str + partStr1 + partStr4 + partStr3 + partStr4 + partStr5 + partStr2 + partStr6
var showStr = str + partStr1 + partStr2 + partStr3
val spannable = SpannableStringBuilder(showStr)
spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
Expand Down Expand Up @@ -160,9 +157,7 @@ class RegisterActivity : PActivity(), RegisterView, View.OnClickListener {
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
val intent = Intent(this@RegisterActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.register_agree_4))
var url = CommonField.POLICY_PREFIX
url += "?uin=$ANDROID_ID"
url += CommonField.PRIVACY_POLICY_SUFFIX
var url = CommonField.PRIVACY_POLICY_URL_CN_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
} else {
Expand All @@ -189,49 +184,6 @@ class RegisterActivity : PActivity(), RegisterView, View.OnClickListener {
},
str.length + partStr1.length + partStr2.length, str.length + partStr1.length + partStr2.length + partStr3.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {
var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.THIRD_SDK_URL_US_ZH
} else {
url = CommonField.THIRD_SDK_URL_US_EN
}
OpensourceLicenseActivity.startWebWithExtra(this@RegisterActivity, getString(R.string.rule_content_list), url)

}

override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = resources.getColor(R.color.blue_0066FF)
ds.setUnderlineText(false);
}

},
showStr.length - partStr6.length - partStr2.length - partStr5.length, showStr.length - partStr6.length - partStr2.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

spannable.setSpan(object : ClickableSpan() {
override fun onClick(widget: View) {

var url = ""
if (Utils.getLang().contains(CommonField.ZH_TAG)) {
url = CommonField.PERSONAL_INFO_URL_US_ZH
} else {
url = CommonField.PERSONAL_INFO_URL_US_EN
}
OpensourceLicenseActivity.startWebWithExtra(this@RegisterActivity, getString(R.string.personal_information_list), url)

}

override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds)
ds.color = resources.getColor(R.color.blue_0066FF)
ds.setUnderlineText(false);
}

},
showStr.length - partStr6.length, showStr.length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE)

tv_register_tip.setMovementMethod(LinkMovementMethod.getInstance())
tv_register_tip.setText(spannable)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.tencent.iot.explorer.link.kitlink.activity

import android.content.Intent
import android.view.View
import android.view.ViewGroup
import android.webkit.*
Expand Down Expand Up @@ -53,7 +54,11 @@ class WebActivity : BaseActivity() {
val mWebViewClient = object : WebViewClient(){
override fun shouldOverrideUrlLoading(view: WebView?, request: WebResourceRequest?): Boolean {
if (request?.url.toString().contains(THIRD_SDK_URL_US_ZH)) {
OpensourceLicenseActivity.startWebWithExtra(this@WebActivity, getString(R.string.rule_content_list), THIRD_SDK_URL_US_ZH)
val intent = Intent(this@WebActivity, WebActivity::class.java)
intent.putExtra(CommonField.EXTRA_TITLE, getString(R.string.rule_content_list))
var url = THIRD_SDK_URL_US_ZH
intent.putExtra(CommonField.EXTRA_TEXT, url)
startActivity(intent)
return true
} else if (request?.url.toString().contains(THIRD_SDK_URL_US_EN)) {
OpensourceLicenseActivity.startWebWithExtra(this@WebActivity, getString(R.string.rule_content_list), THIRD_SDK_URL_US_EN)
Expand Down
Loading

0 comments on commit 9d92bcb

Please sign in to comment.