From 225a193ac0990aded9785a06736460d38168d8cf Mon Sep 17 00:00:00 2001 From: Matthew Tighe Date: Wed, 21 Nov 2018 10:04:05 -0800 Subject: [PATCH] Upgrade to v1.0.2 (#410) * Remove paid apps (#345) * remove paid apps * Upgrade to version 0.5.3 * Remove TODO. * Set lastAppsUpdate. * Upgrade to version 1.0.0. * Update README.md to better reflect 1.0.0. * Db migration 4 (#373) * Remove unused filesystem attributes. * Remove unused session attributes. * Remove startup script from sql statements. * Add index on filesystemId. * Remove foreign key constraints during migration. * Add test. * Fix failing test. * Update assets (#375) * Update migration to add lastUpdated attribute to filesystem entity. * Move updated assets to appropriate filesystems. * Display progress bar faster. * Fdroid (#394) * remove play services * remove play services util class * Fdroid 2 - remove billing permissions (#397) * remove play services * remove play services util class * get rid of billing permission * Filesystems page will listen to progress bar dialog and display it when navigating to it. (#393) * Upgrade to v.1.0.1 * pass kernel version down so we can fake out /proc/version (#407) * Fix: Apps Service Type Behavior (#408) * If app is only supported by one service type (ssh/vnc), disable ability to change the preference in apps details menu. * When selecting an app that is supported by one service type, set the preference type automatically and start the session. * Upgrade to v1.0.2 --- app/build.gradle | 4 ++-- app/release/output.json | 2 +- app/src/main/java/tech/ula/ui/AppDetailsFragment.kt | 11 ++++++++++- app/src/main/java/tech/ula/ui/AppListFragment.kt | 10 +++++++--- app/src/main/java/tech/ula/utils/ExecUtility.kt | 3 ++- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index adce97c1a..24f74b596 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,8 +12,8 @@ android { applicationId "tech.ula" minSdkVersion 21 targetSdkVersion 28 - versionCode 32 - versionName "1.0.1" + versionCode 33 + versionName "1.0.2" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" vectorDrawables.useSupportLibrary = true diff --git a/app/release/output.json b/app/release/output.json index a5d874b4d..955e16e15 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":32,"versionName":"1.0.1","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":33,"versionName":"1.0.2","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/tech/ula/ui/AppDetailsFragment.kt b/app/src/main/java/tech/ula/ui/AppDetailsFragment.kt index b97ea58a0..ba0b9bcd7 100644 --- a/app/src/main/java/tech/ula/ui/AppDetailsFragment.kt +++ b/app/src/main/java/tech/ula/ui/AppDetailsFragment.kt @@ -42,7 +42,16 @@ class AppDetailsFragment : Fragment() { setupPreferredServiceTypeRadioGroup() } - fun setupPreferredServiceTypeRadioGroup() { + override fun onViewCreated(view: View, savedInstanceState: Bundle?) { + super.onViewCreated(view, savedInstanceState) + if (!(app.supportsGui && app.supportsCli)) { + apps_vnc_preference.isEnabled = false + apps_ssh_preference.isEnabled = false + return + } + } + + private fun setupPreferredServiceTypeRadioGroup() { val appServiceTypePreference = appsPreferences.getAppServiceTypePreference(app.name) if (appServiceTypePreference == AppsPreferences.SSH) { apps_service_type_preferences.check(R.id.apps_ssh_preference) diff --git a/app/src/main/java/tech/ula/ui/AppListFragment.kt b/app/src/main/java/tech/ula/ui/AppListFragment.kt index c6ea3fc6e..3375d10cc 100644 --- a/app/src/main/java/tech/ula/ui/AppListFragment.kt +++ b/app/src/main/java/tech/ula/ui/AppListFragment.kt @@ -228,10 +228,14 @@ class AppListFragment : Fragment(), // TODO some error notification return } + val appFilesystem = possibleAppFilesystem.first() - if (appsListViewModel.getAppServiceTypePreference(selectedApp).isEmpty()) { - getClientPreferenceAndStart(selectedApp, appFilesystem.defaultUsername, appFilesystem.defaultPassword, appFilesystem.defaultVncPassword) - return + + if (!appSupportsOneServiceTypeAndSetPref(selectedApp)) { + if (appsListViewModel.getAppServiceTypePreference(selectedApp).isEmpty()) { + getClientPreferenceAndStart(selectedApp, appFilesystem.defaultUsername, appFilesystem.defaultPassword, appFilesystem.defaultVncPassword) + return + } } val startAppIntent = Intent(activityContext, ServerService::class.java) diff --git a/app/src/main/java/tech/ula/utils/ExecUtility.kt b/app/src/main/java/tech/ula/utils/ExecUtility.kt index 105e0845c..c02d82073 100644 --- a/app/src/main/java/tech/ula/utils/ExecUtility.kt +++ b/app/src/main/java/tech/ula/utils/ExecUtility.kt @@ -44,7 +44,8 @@ class ExecUtility( "ROOT_PATH" to applicationFilesDirPath, "ROOTFS_PATH" to "$applicationFilesDirPath/${executionDirectory.name}", "PROOT_DEBUG_LEVEL" to prootDebuggingLevel, - "EXTRA_BINDINGS" to "-b $externalStoragePath:/sdcard") + "EXTRA_BINDINGS" to "-b $externalStoragePath:/sdcard", + "OS_VERSION" to System.getProperty("os.version")) else hashMapOf() env.putAll(environmentVars)