|
|
|
@ -166,7 +166,7 @@ class WebViewActivity : BaseActivity() {
|
|
|
|
|
fun openUrl(context: Context, uri: Uri) {
|
|
|
|
|
if (isAllowedUrl(uri)) {
|
|
|
|
|
val intent = Intent(context, WebViewActivity::class.java)
|
|
|
|
|
intent.putExtra(WebViewActivity.KEY_URL, uri)
|
|
|
|
|
intent.putExtra(KEY_URL, uri)
|
|
|
|
|
context.startActivity(intent)
|
|
|
|
|
} else {
|
|
|
|
|
try {
|
|
|
|
@ -191,7 +191,14 @@ class WebViewActivity : BaseActivity() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private fun isAllowedUrl(uri: Uri): Boolean {
|
|
|
|
|
val allowedUris = arrayOf(Constants.faqUri, Constants.helpUri, Constants.registrationUrl, Constants.dashboard, Constants.webUri.buildUpon().appendEncodedPath("tos/").build(), Constants.webUri.buildUpon().appendEncodedPath("about/").build())
|
|
|
|
|
val allowedUris = arrayOf(
|
|
|
|
|
Constants.faqUri,
|
|
|
|
|
Constants.helpUri,
|
|
|
|
|
Constants.registrationUrl,
|
|
|
|
|
Constants.dashboard,
|
|
|
|
|
Constants.webUri.buildUpon().appendEncodedPath("tos/").build(),
|
|
|
|
|
Constants.webUri.buildUpon().appendEncodedPath("about/").build(),
|
|
|
|
|
)
|
|
|
|
|
val accountsUri = Constants.webUri.buildUpon().appendEncodedPath("accounts/").build()
|
|
|
|
|
|
|
|
|
|
return allowedUris(allowedUris, uri) || uri.host == accountsUri.host && uri.path!!.startsWith(accountsUri.path!!)
|
|
|
|
|