Skip to content

Commit

Permalink
Kill RiotX (#1727)
Browse files Browse the repository at this point in the history
- Restore RiotX appId and App name
- Prevent share to RiotX
- Show the warning popup each time the app is launch
- Prevent any new login and propose to uninstall the app
  • Loading branch information
bmarty committed Aug 5, 2020
1 parent ca61751 commit 3bfe604
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 156 deletions.
23 changes: 6 additions & 17 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,17 @@
Changes in Riot.imX 0.91.6 (2020-XX-XX)
Changes in RiotX 0.23.0 (2020-08-05)
===================================================

Features ✨:
-
This is the very last version of RiotX, published on the PlayStore.

Improvements 🙌:
-
This branch will never be merged on develop.

Features ✨:
- Inform user that the app will not be updated anymore (#1727)

Bugfix 🐛:
- Video calls are shown as a voice ones in the timeline (#1676)
- Fix regression: not able to create a room without IS configured (#1679)

Translations 🗣:
-

SDK API changes ⚠️:
-

Build 🧱:
-

Other changes:
-

Changes in Riot.imX 0.91.5 (2020-07-11)
===================================================

Expand Down
12 changes: 6 additions & 6 deletions vector/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ androidExtensions {

// Note: 2 digits max for each value
ext.versionMajor = 0
ext.versionMinor = 91
ext.versionPatch = 6
ext.versionMinor = 23
ext.versionPatch = 0

static def getGitTimestamp() {
def cmd = 'git show -s --format=%ct'
Expand Down Expand Up @@ -72,7 +72,7 @@ static def getGplayVersionSuffix() {
if (gitBranchName() == "master") {
return ""
} else {
return "-dev"
return "" // "-dev"
}
}

Expand Down Expand Up @@ -112,7 +112,7 @@ android {
ndkVersion "21.3.6528147"

defaultConfig {
applicationId "im.vector.app"
applicationId "im.vector.riotx"
// Set to API 21: see #405
minSdkVersion 21
targetSdkVersion 29
Expand Down Expand Up @@ -183,7 +183,7 @@ android {
buildTypes {
debug {
applicationIdSuffix ".debug"
resValue "string", "app_name", "Riot.imX dbg"
resValue "string", "app_name", "RiotX dbg"

resValue "bool", "debug_mode", "true"
buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false"
Expand All @@ -192,7 +192,7 @@ android {
}

release {
resValue "string", "app_name", "Riot.imX"
resValue "string", "app_name", "RiotX"

resValue "bool", "debug_mode", "false"
buildConfigField "boolean", "LOW_PRIVACY_LOG_ENABLE", "false"
Expand Down
2 changes: 1 addition & 1 deletion vector/src/gplay/debug/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"client_info": {
"mobilesdk_app_id": "1:912726360885:android:4ef8f3a0021e774d",
"android_client_info": {
"package_name": "im.vector.app.debug"
"package_name": "im.vector.riotx.debug"
}
},
"oauth_client": [
Expand Down
2 changes: 1 addition & 1 deletion vector/src/gplay/release/google-services.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"client_info": {
"mobilesdk_app_id": "1:912726360885:android:4ef8f3a0021e774d",
"android_client_info": {
"package_name": "im.vector.app"
"package_name": "im.vector.riotx"
}
},
"oauth_client": [
Expand Down
5 changes: 5 additions & 0 deletions vector/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

<!-- To be able to delete RiotX -->
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />

<!-- Call feature -->
<uses-permission android:name="android.permission.MANAGE_OWN_CALLS" />
<!-- Commented because Google PlayStore does not like we add permission if we are not requiring it. And it was added for future use -->
Expand Down Expand Up @@ -140,8 +143,10 @@
</intent-filter>
</activity>

<!-- Disable incoming share -->
<activity
android:name=".features.share.IncomingShareActivity"
android:enabled="false"
android:parentActivityName=".features.home.HomeActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,47 +17,19 @@
package im.vector.riotx.features.disclaimer

import android.app.Activity
import androidx.preference.PreferenceManager
import android.view.ViewGroup
import android.widget.TextView
import androidx.appcompat.app.AlertDialog
import androidx.core.content.edit
import im.vector.riotx.BuildConfig
import im.vector.riotx.R
import im.vector.riotx.core.extensions.setTextWithColoredPart
import im.vector.riotx.core.utils.openPlayStore

// Increase this value to show again the disclaimer dialog after an upgrade of the application
private const val CURRENT_DISCLAIMER_VALUE = 1

private const val SHARED_PREF_KEY = "LAST_DISCLAIMER_VERSION_VALUE"

fun showDisclaimerDialog(activity: Activity) {
val sharedPrefs = PreferenceManager.getDefaultSharedPreferences(activity)

if (sharedPrefs.getInt(SHARED_PREF_KEY, 0) < CURRENT_DISCLAIMER_VALUE) {
sharedPrefs.edit {
putInt(SHARED_PREF_KEY, CURRENT_DISCLAIMER_VALUE)
}
val dialogLayout = activity.layoutInflater.inflate(R.layout.dialog_disclaimer_content, null)

val dialogLayout = activity.layoutInflater.inflate(R.layout.dialog_disclaimer_content, null)

val textView = (dialogLayout as ViewGroup).findViewById<TextView>(R.id.dialogDisclaimerContentLine2)
@Suppress("ConstantConditionIf")
if (BuildConfig.FLAVOR == "gplay") {
textView.setTextWithColoredPart(R.string.alpha_disclaimer_content_line_2_gplay, R.string.alpha_disclaimer_content_line_2_gplay_colored_part)

textView.setOnClickListener {
openPlayStore(activity)
AlertDialog.Builder(activity)
.setView(dialogLayout)
.setCancelable(false)
.setPositiveButton(R.string.the_beta_is_over_get_element) { _, _ ->
openPlayStore(activity, "im.vector.app")
}
} else {
textView.setText(R.string.alpha_disclaimer_content_line_2_fdroid)
}

AlertDialog.Builder(activity)
.setView(dialogLayout)
.setCancelable(false)
.setPositiveButton(R.string._continue, null)
.show()
}
.setNegativeButton(R.string.later, null)
.show()
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable, UnknownDeviceDet
@Inject lateinit var viewModelFactory: HomeActivityViewModel.Factory

private val serverBackupStatusViewModel: ServerBackupStatusViewModel by viewModel()
@Inject lateinit var serverBackupviewModelFactory: ServerBackupStatusViewModel.Factory
@Inject lateinit var serverBackupviewModelFactory: ServerBackupStatusViewModel.Factory

@Inject lateinit var activeSessionHolder: ActiveSessionHolder
@Inject lateinit var vectorUncaughtExceptionHandler: VectorUncaughtExceptionHandler
Expand Down Expand Up @@ -225,6 +225,8 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable, UnknownDeviceDet
super.onDestroy()
}

private var disclaimerShown = false

override fun onResume() {
super.onResume()

Expand All @@ -238,7 +240,10 @@ class HomeActivity : VectorBaseActivity(), ToolbarConfigurable, UnknownDeviceDet
.setNegativeButton(R.string.no) { _, _ -> bugReporter.deleteCrashFile(this) }
.show()
} else {
showDisclaimerDialog(this)
if (!disclaimerShown) {
disclaimerShown = true
showDisclaimerDialog(this)
}
}

// Force remote backup state update to update the banner if needed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@

package im.vector.riotx.features.login

import android.content.ActivityNotFoundException
import android.content.Intent
import android.net.Uri
import butterknife.OnClick
import im.vector.riotx.BuildConfig
import im.vector.riotx.R
import im.vector.riotx.core.utils.openPlayStore
import im.vector.riotx.core.utils.toast
import javax.inject.Inject

/**
Expand All @@ -29,7 +35,19 @@ class LoginSplashFragment @Inject constructor() : AbstractLoginFragment() {

@OnClick(R.id.loginSplashSubmit)
fun getStarted() {
loginViewModel.handle(LoginAction.PostViewEvent(LoginViewEvents.OpenServerSelection))
openPlayStore(requireActivity(), "im.vector.app")
}

@OnClick(R.id.loginSplashUninstall)
fun uninstall() {
@Suppress("DEPRECATION")
val intent = Intent(Intent.ACTION_UNINSTALL_PACKAGE)
intent.data = Uri.parse("package:" + BuildConfig.APPLICATION_ID)
try {
startActivity(intent)
} catch (anfe: ActivityNotFoundException) {
requireActivity().toast(R.string.error_no_external_application_found)
}
}

override fun resetViewModel() {
Expand Down
17 changes: 2 additions & 15 deletions vector/src/main/res/layout/dialog_disclaimer_content.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
Expand All @@ -26,7 +25,7 @@
android:layout_marginTop="92dp"
android:fontFamily="sans-serif"
android:lineSpacingExtra="8sp"
android:text="@string/alpha_disclaimer_title"
android:text="@string/the_beta_is_over_title"
android:textColor="@color/white"
android:textSize="24sp"
android:textStyle="normal" />
Expand All @@ -39,20 +38,8 @@
android:layout_marginStart="24dp"
android:layout_marginTop="21dp"
android:layout_marginEnd="24dp"
android:text="@string/alpha_disclaimer_content_line_1"
android:text="@string/the_beta_is_over_content"
android:textColor="?riotx_text_primary"
android:textSize="16sp" />

<TextView
android:id="@+id/dialogDisclaimerContentLine2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:layout_marginTop="21dp"
android:layout_marginEnd="24dp"
android:layout_marginBottom="21dp"
android:textColor="?riotx_text_primary"
android:textSize="16sp"
tools:text="@string/alpha_disclaimer_content_line_2_gplay" />

</LinearLayout>
Loading

0 comments on commit 3bfe604

Please sign in to comment.