Loading demoapp/src/main/java/foundation/e/tordemoapp/MainActivity.kt +28 −2 Original line number Diff line number Diff line Loading @@ -22,21 +22,30 @@ import android.content.Intent import android.os.Bundle import android.view.View import android.widget.Button import android.widget.RadioButton import android.widget.Switch import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import foundation.e.privacymodules.ipscrambler.IpScramblerModule import foundation.e.privacymodules.ipscramblermodule.IIpScramblerModule const val APP_1 = "org.mozilla.firefox" class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { private var lblStatus: TextView? = null private var lblTraffic: TextView? = null private var mTxtOrbotLog: TextView? = null private var mBtnStart: Button? = null private var mBtnStop: Button? = null private var mBtnRequestStatus: Button? = null private var mSelectAll: RadioButton? = null private var mSelectApp1: RadioButton? = null private lateinit var ipScramblerModule: IpScramblerModule override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) Loading @@ -45,12 +54,13 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { ipScramblerModule.addListener(this) lblStatus = findViewById(R.id.label_status) lblTraffic = findViewById(R.id.label_traffic) mTxtOrbotLog = findViewById(R.id.orbot_log) mBtnStart = findViewById(R.id.button_start) mBtnStop = findViewById(R.id.button_stop) mSelectAll = findViewById(R.id.select_all) mSelectApp1 = findViewById(R.id.select_app1) mBtnStart?.setOnClickListener { v: View? -> ipScramblerModule.prepareAndroidVpn()?.let { startActivityForResult(it, 3)} Loading @@ -66,6 +76,18 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { mBtnRequestStatus?.setOnClickListener { ipScramblerModule.requestStatus() } mSelectAll?.setOnClickListener { ipScramblerModule.appList = emptySet() updateAppSelection() } mSelectApp1?.setOnClickListener { ipScramblerModule.appList = setOf(APP_1) updateAppSelection() } updateAppSelection() } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { Loading @@ -82,7 +104,6 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { ipScramblerModule.requestStatus() } private var logHistory = "" override fun log(message: String) { logHistory = message + "\n" + logHistory Loading @@ -96,5 +117,10 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { override fun onTrafficUpdate(upload: Long, download: Long, read: Long, write: Long) { lblTraffic?.text = "↑ ${write/1000}kB (${upload/1000}kB/s) ↓ ${read/1000}kB (${download/1000}kB/s)" } private fun updateAppSelection() { mSelectAll?.isChecked = ipScramblerModule.appList.isEmpty() mSelectApp1?.isChecked = ipScramblerModule.appList.contains(APP_1) } } demoapp/src/main/res/layout/activity_main.xml +33 −14 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <LinearLayout <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:padding="24dp" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" Loading Loading @@ -61,24 +64,40 @@ android:text="Status?" android:layout_marginBottom="24dp" /> <RadioGroup android:id="@+id/selective_scrambling" android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="vertical" android:layout_marginBottom="24dp" > <RadioButton android:id="@+id/select_all" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="All" /> <RadioButton android:id="@+id/select_app1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Firefox" /> </RadioGroup> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="OrbotLog: " /> <androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <TextView android:id="@+id/orbot_log" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="24dp" /> </androidx.core.widget.NestedScrollView> </LinearLayout> </androidx.core.widget.NestedScrollView> mavenlocalrepository/foundation/e/privacymodule.tor/0.0.2/privacymodule.tor-0.0.2.aar→mavenlocalrepository/foundation/e/privacymodule.tor/0.0.4/privacymodule.tor-0.0.4.aar +179 B (25.4 KiB) File changed and moved.No diff preview for this file type. View original file View changed file mavenlocalrepository/foundation/e/privacymodule.tor/0.0.2/privacymodule.tor-0.0.2.pom→mavenlocalrepository/foundation/e/privacymodule.tor/0.0.4/privacymodule.tor-0.0.4.pom +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>foundation.e</groupId> <artifactId>privacymodule.tor</artifactId> <version>0.0.2</version> <version>0.0.4</version> <packaging>aar</packaging> <dependencies> <dependency> Loading mavenlocalrepository/foundation/e/privacymodule.tor/maven-metadata-local.xml +4 −4 Original line number Diff line number Diff line Loading @@ -3,11 +3,11 @@ <groupId>foundation.e</groupId> <artifactId>privacymodule.tor</artifactId> <versioning> <latest>0.0.2</latest> <release>0.0.2</release> <latest>0.0.4</latest> <release>0.0.4</release> <versions> <version>0.0.2</version> <version>0.0.4</version> </versions> <lastUpdated>20210826064900</lastUpdated> <lastUpdated>20210830061036</lastUpdated> </versioning> </metadata> Loading
demoapp/src/main/java/foundation/e/tordemoapp/MainActivity.kt +28 −2 Original line number Diff line number Diff line Loading @@ -22,21 +22,30 @@ import android.content.Intent import android.os.Bundle import android.view.View import android.widget.Button import android.widget.RadioButton import android.widget.Switch import android.widget.TextView import androidx.appcompat.app.AppCompatActivity import foundation.e.privacymodules.ipscrambler.IpScramblerModule import foundation.e.privacymodules.ipscramblermodule.IIpScramblerModule const val APP_1 = "org.mozilla.firefox" class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { private var lblStatus: TextView? = null private var lblTraffic: TextView? = null private var mTxtOrbotLog: TextView? = null private var mBtnStart: Button? = null private var mBtnStop: Button? = null private var mBtnRequestStatus: Button? = null private var mSelectAll: RadioButton? = null private var mSelectApp1: RadioButton? = null private lateinit var ipScramblerModule: IpScramblerModule override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) Loading @@ -45,12 +54,13 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { ipScramblerModule.addListener(this) lblStatus = findViewById(R.id.label_status) lblTraffic = findViewById(R.id.label_traffic) mTxtOrbotLog = findViewById(R.id.orbot_log) mBtnStart = findViewById(R.id.button_start) mBtnStop = findViewById(R.id.button_stop) mSelectAll = findViewById(R.id.select_all) mSelectApp1 = findViewById(R.id.select_app1) mBtnStart?.setOnClickListener { v: View? -> ipScramblerModule.prepareAndroidVpn()?.let { startActivityForResult(it, 3)} Loading @@ -66,6 +76,18 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { mBtnRequestStatus?.setOnClickListener { ipScramblerModule.requestStatus() } mSelectAll?.setOnClickListener { ipScramblerModule.appList = emptySet() updateAppSelection() } mSelectApp1?.setOnClickListener { ipScramblerModule.appList = setOf(APP_1) updateAppSelection() } updateAppSelection() } override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { Loading @@ -82,7 +104,6 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { ipScramblerModule.requestStatus() } private var logHistory = "" override fun log(message: String) { logHistory = message + "\n" + logHistory Loading @@ -96,5 +117,10 @@ class MainActivity : AppCompatActivity(), IIpScramblerModule.Listener { override fun onTrafficUpdate(upload: Long, download: Long, read: Long, write: Long) { lblTraffic?.text = "↑ ${write/1000}kB (${upload/1000}kB/s) ↓ ${read/1000}kB (${download/1000}kB/s)" } private fun updateAppSelection() { mSelectAll?.isChecked = ipScramblerModule.appList.isEmpty() mSelectApp1?.isChecked = ipScramblerModule.appList.contains(APP_1) } }
demoapp/src/main/res/layout/activity_main.xml +33 −14 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <LinearLayout <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:padding="24dp" android:orientation="vertical" tools:context=".MainActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" Loading Loading @@ -61,24 +64,40 @@ android:text="Status?" android:layout_marginBottom="24dp" /> <RadioGroup android:id="@+id/selective_scrambling" android:layout_height="wrap_content" android:layout_width="match_parent" android:orientation="vertical" android:layout_marginBottom="24dp" > <RadioButton android:id="@+id/select_all" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="All" /> <RadioButton android:id="@+id/select_app1" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Firefox" /> </RadioGroup> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="OrbotLog: " /> <androidx.core.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" > <TextView android:id="@+id/orbot_log" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginBottom="24dp" /> </androidx.core.widget.NestedScrollView> </LinearLayout> </androidx.core.widget.NestedScrollView>
mavenlocalrepository/foundation/e/privacymodule.tor/0.0.2/privacymodule.tor-0.0.2.aar→mavenlocalrepository/foundation/e/privacymodule.tor/0.0.4/privacymodule.tor-0.0.4.aar +179 B (25.4 KiB) File changed and moved.No diff preview for this file type. View original file View changed file
mavenlocalrepository/foundation/e/privacymodule.tor/0.0.2/privacymodule.tor-0.0.2.pom→mavenlocalrepository/foundation/e/privacymodule.tor/0.0.4/privacymodule.tor-0.0.4.pom +1 −1 Original line number Diff line number Diff line Loading @@ -3,7 +3,7 @@ <modelVersion>4.0.0</modelVersion> <groupId>foundation.e</groupId> <artifactId>privacymodule.tor</artifactId> <version>0.0.2</version> <version>0.0.4</version> <packaging>aar</packaging> <dependencies> <dependency> Loading
mavenlocalrepository/foundation/e/privacymodule.tor/maven-metadata-local.xml +4 −4 Original line number Diff line number Diff line Loading @@ -3,11 +3,11 @@ <groupId>foundation.e</groupId> <artifactId>privacymodule.tor</artifactId> <versioning> <latest>0.0.2</latest> <release>0.0.2</release> <latest>0.0.4</latest> <release>0.0.4</release> <versions> <version>0.0.2</version> <version>0.0.4</version> </versions> <lastUpdated>20210826064900</lastUpdated> <lastUpdated>20210830061036</lastUpdated> </versioning> </metadata>