Skip to content

Commit

Permalink
Upgrade to v1.0.1. (#406)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
MatthewTighe authored Nov 19, 2018
1 parent 5980515 commit fa8e6b9
Show file tree
Hide file tree
Showing 23 changed files with 414 additions and 249 deletions.
2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![UserLAnd Feature Graphic](https://github.com/CypherpunkArmory/UserLAnd/raw/master/play_store/featureGraphic.png)

## Welcome to UserLAnd
# Welcome to UserLAnd

The easiest way to run a Linux distribution or application on Android.
Features:
Expand All @@ -9,16 +9,27 @@ Features:
* No root required.

How to get started:
1. Define a session - This describes what filesystem you are going to use, what server you want to run (ssh or vnc), and how you want to connect to it (ConnectBot or bVNC).
2. Define a filesystem while defining a session - This describes what distro or application you want to install (only supports debian, but more coming soon).

There are two ways to use UserLAnd: single-click apps and user-defined custom sessions.

### Using single-click apps:
1. Click an app.
2. Fill out the required information.
3. You're good to go!

### Using user-defined custom sessions:
1. Define a session - This describes what filesystem you are going to use, and what kind of service you want to use when connecting to it (ssh or vnc).
2. Define a filesystem - This describes what distribution of Linux you want to install.
3. Once defined, just tap on the session to start up. This will download necessary assets, setup the filesystem, start the server, and connect to it. This will take several minutes for the first start up, but will be quicker afterwards.

### Using your Linux distribution

A normal first session might look like this:
* sudo apt update <- sudo or su because you are not fake root initially, update because you need to do this
* sudo apt update <- update package information
* sudo apt install wget <- install whatever you want to use
* wget http://google.com <- use it

But, you can do so much more than that...your phone is not just a play thing anymore.
But you can do so much more than that. Your phone isn't just a play thing any more!

This app is fully open source. You can find our code and file issues [here](https://github.com/CypherpunkArmory/UserLAnd/).

Expand Down
6 changes: 2 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ android {
applicationId "tech.ula"
minSdkVersion 21
targetSdkVersion 28
versionCode 29
versionName "0.5.2"
versionCode 32
versionName "1.0.1"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down Expand Up @@ -94,8 +94,6 @@ dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation "com.android.support:design:$support_library_version"
implementation "com.android.support:preference-v7:$support_library_version"
implementation "com.android.billingclient:billing:1.1"
implementation "com.google.android.gms:play-services-base:16.0.1"

testImplementation 'junit:junit:4.12'
testImplementation "org.mockito:mockito-core:$mockito_version"
Expand Down
2 changes: 1 addition & 1 deletion app/release/output.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":29,"versionName":"0.5.2","enabled":true,"outputFile":"app-release.apk","fullName":"release","baseName":"release"},"path":"app-release.apk","properties":{}}]
[{"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":{}}]
253 changes: 253 additions & 0 deletions app/schemas/tech.ula.model.repositories.UlaDatabase/4.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
{
"formatVersion": 1,
"database": {
"version": 4,
"identityHash": "71f3d0d9bb252622c50dba61d887005a",
"entities": [
{
"tableName": "session",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `filesystemId` INTEGER NOT NULL, `filesystemName` TEXT NOT NULL, `active` INTEGER NOT NULL, `username` TEXT NOT NULL, `password` TEXT NOT NULL, `vncPassword` TEXT NOT NULL, `serviceType` TEXT NOT NULL, `port` INTEGER NOT NULL, `pid` INTEGER NOT NULL, `isAppsSession` INTEGER NOT NULL, FOREIGN KEY(`filesystemId`) REFERENCES `filesystem`(`id`) ON UPDATE NO ACTION ON DELETE CASCADE )",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "filesystemId",
"columnName": "filesystemId",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "filesystemName",
"columnName": "filesystemName",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "active",
"columnName": "active",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "username",
"columnName": "username",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "password",
"columnName": "password",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "vncPassword",
"columnName": "vncPassword",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "serviceType",
"columnName": "serviceType",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "port",
"columnName": "port",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "pid",
"columnName": "pid",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isAppsSession",
"columnName": "isAppsSession",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [
{
"name": "index_session_filesystemId",
"unique": false,
"columnNames": [
"filesystemId"
],
"createSql": "CREATE INDEX `index_session_filesystemId` ON `${TABLE_NAME}` (`filesystemId`)"
}
],
"foreignKeys": [
{
"table": "filesystem",
"onDelete": "CASCADE",
"onUpdate": "NO ACTION",
"columns": [
"filesystemId"
],
"referencedColumns": [
"id"
]
}
]
},
{
"tableName": "filesystem",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`id` INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, `name` TEXT NOT NULL, `distributionType` TEXT NOT NULL, `archType` TEXT NOT NULL, `defaultUsername` TEXT NOT NULL, `defaultPassword` TEXT NOT NULL, `defaultVncPassword` TEXT NOT NULL, `isAppsFilesystem` INTEGER NOT NULL, `lastUpdated` INTEGER NOT NULL)",
"fields": [
{
"fieldPath": "id",
"columnName": "id",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "distributionType",
"columnName": "distributionType",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "archType",
"columnName": "archType",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "defaultUsername",
"columnName": "defaultUsername",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "defaultPassword",
"columnName": "defaultPassword",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "defaultVncPassword",
"columnName": "defaultVncPassword",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "isAppsFilesystem",
"columnName": "isAppsFilesystem",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "lastUpdated",
"columnName": "lastUpdated",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"id"
],
"autoGenerate": true
},
"indices": [],
"foreignKeys": []
},
{
"tableName": "apps",
"createSql": "CREATE TABLE IF NOT EXISTS `${TABLE_NAME}` (`name` TEXT NOT NULL, `category` TEXT NOT NULL, `filesystemRequired` TEXT NOT NULL, `supportsCli` INTEGER NOT NULL, `supportsGui` INTEGER NOT NULL, `isPaidApp` INTEGER NOT NULL, `version` INTEGER NOT NULL, PRIMARY KEY(`name`))",
"fields": [
{
"fieldPath": "name",
"columnName": "name",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "category",
"columnName": "category",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "filesystemRequired",
"columnName": "filesystemRequired",
"affinity": "TEXT",
"notNull": true
},
{
"fieldPath": "supportsCli",
"columnName": "supportsCli",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "supportsGui",
"columnName": "supportsGui",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "isPaidApp",
"columnName": "isPaidApp",
"affinity": "INTEGER",
"notNull": true
},
{
"fieldPath": "version",
"columnName": "version",
"affinity": "INTEGER",
"notNull": true
}
],
"primaryKey": {
"columnNames": [
"name"
],
"autoGenerate": false
},
"indices": [
{
"name": "index_apps_name",
"unique": true,
"columnNames": [
"name"
],
"createSql": "CREATE UNIQUE INDEX `index_apps_name` ON `${TABLE_NAME}` (`name`)"
}
],
"foreignKeys": []
}
],
"setupQueries": [
"CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)",
"INSERT OR REPLACE INTO room_master_table (id,identity_hash) VALUES(42, \"71f3d0d9bb252622c50dba61d887005a\")"
]
}
}
22 changes: 11 additions & 11 deletions app/src/androidTest/java/tech/ula/model/MigrationTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import tech.ula.model.entities.Filesystem
import tech.ula.model.entities.Session
import tech.ula.model.repositories.Migration1To2
import tech.ula.model.repositories.Migration2To3
import tech.ula.model.repositories.Migration3To4
import tech.ula.model.repositories.UlaDatabase
import java.io.IOException

Expand All @@ -41,16 +42,7 @@ class MigrationTest {

db.close()

helper.runMigrationsAndValidate(TEST_DB, 2, true, Migration1To2())

val migratedDb = getMigratedDatabase()
val fs = migratedDb.filesystemDao().getFilesystemByName("firstFs")
val session = migratedDb.sessionDao().getSessionByName("firstSession")

assertFalse(fs.isDownloaded)
assertFalse(session.isExtracted)
assert(session.lastUpdated == 0L)
assert(session.bindings == "")
helper.runMigrationsAndValidate(TEST_DB, 2, true, Migration1To2(), Migration2To3(), Migration3To4())
}

@Test
Expand Down Expand Up @@ -98,10 +90,18 @@ class MigrationTest {
assertEquals(session1.vncPassword, "userland")
}

@Test
@Throws(IOException::class)
fun migrate3To4() {
helper.createDatabase(TEST_DB, 3)

helper.runMigrationsAndValidate(TEST_DB, 4, true, Migration3To4())
}

private fun getMigratedDatabase(): UlaDatabase {
val db = Room.databaseBuilder(InstrumentationRegistry.getTargetContext(),
UlaDatabase::class.java, TEST_DB)
.addMigrations(Migration1To2(), Migration2To3())
.addMigrations(Migration1To2(), Migration2To3(), Migration3To4())
.build()

helper.closeWhenFinished(db)
Expand Down
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="com.android.vending.BILLING" />

<application
android:allowBackup="false"
Expand Down
Loading

0 comments on commit fa8e6b9

Please sign in to comment.