-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add android app * updated readme and makefile * update play store link
- Loading branch information
Showing
389 changed files
with
34,510 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
*.iml | ||
.gradle | ||
/local.properties | ||
.idea/* | ||
.DS_Store | ||
/build | ||
/captures | ||
.externalNativeBuild | ||
.cxx | ||
local.properties | ||
!data | ||
|
||
keystore.properties | ||
app/release/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
### Intro | ||
|
||
`upvpn-android` is an Android Studio project. | ||
|
||
UpVPN Android app is built using modern Android framework based on Jetpack Compose, Room, etc. in Kotlin. | ||
|
||
### Downloads | ||
|
||
Download UpVPN Android app using one of the following options: | ||
- [Play Store](https://play.google.com/store/apps/details?id=app.upvpn.upvpn) | ||
- [F-Droid (coming soon)]() | ||
- APK from [Github Releases](https://github.com/upvpn/upvpn-app/releases) | ||
|
||
### Dev Setup | ||
|
||
Install: | ||
- Android Studio | ||
- CMake | ||
|
||
|
||
Before building app in Android Studio run following from root of this Git repo | ||
|
||
``` | ||
cargo make android-init | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/build | ||
wireguard-tools | ||
elf-cleaner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
import com.android.build.gradle.internal.cxx.configure.gradleLocalProperties | ||
import java.io.FileInputStream | ||
import java.util.Properties | ||
|
||
plugins { | ||
id("com.android.application") | ||
id("org.jetbrains.kotlin.android") | ||
id("org.jetbrains.kotlin.plugin.serialization") version "1.9.10" | ||
id("com.google.devtools.ksp") version "1.9.10-1.0.13" | ||
id("kotlin-parcelize") | ||
} | ||
|
||
val keystorePropertiesFile: File = rootProject.file("keystore.properties") | ||
val keystoreProperties = Properties() | ||
|
||
if (keystorePropertiesFile.exists()) { | ||
keystoreProperties.load(FileInputStream(keystorePropertiesFile)) | ||
} | ||
|
||
android { | ||
namespace = "app.upvpn.upvpn" | ||
compileSdk = 34 | ||
|
||
defaultConfig { | ||
applicationId = "app.upvpn.upvpn" | ||
minSdk = 24 | ||
targetSdk = 34 | ||
versionCode = 4 | ||
versionName = "u1-beta" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
} | ||
|
||
externalNativeBuild { | ||
cmake { | ||
path("tunnel/CMakeLists.txt") | ||
} | ||
} | ||
|
||
if (keystorePropertiesFile.exists()) { | ||
signingConfigs { | ||
create("release") { | ||
storeFile = | ||
file(keystoreProperties.getProperty("storeFile")) | ||
storePassword = keystoreProperties.getProperty("storePassword") | ||
keyAlias = keystoreProperties.getProperty("keyAlias") | ||
keyPassword = keystoreProperties.getProperty("keyPassword") | ||
} | ||
} | ||
} | ||
|
||
buildTypes { | ||
|
||
all { | ||
externalNativeBuild { | ||
cmake { | ||
targets("libwg-go.so") | ||
arguments("-DGRADLE_USER_HOME=${project.gradle.gradleUserHomeDir}") | ||
} | ||
} | ||
} | ||
|
||
debug { | ||
isMinifyEnabled = false | ||
versionNameSuffix = ".debug" | ||
val baseUrl = gradleLocalProperties(rootDir).getProperty("baseUrl") | ||
buildConfigField( | ||
"String", | ||
"UPVPN_BASE_URL", | ||
baseUrl | ||
) | ||
|
||
externalNativeBuild { | ||
cmake { | ||
arguments("-DANDROID_PACKAGE_NAME=${namespace}") | ||
} | ||
} | ||
} | ||
release { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
buildConfigField("String", "UPVPN_BASE_URL", "\"https://upvpn.app\"") | ||
|
||
signingConfig = signingConfigs.getByName("release") | ||
|
||
externalNativeBuild { | ||
cmake { | ||
arguments("-DANDROID_PACKAGE_NAME=${namespace}") | ||
} | ||
} | ||
} | ||
} | ||
compileOptions { | ||
isCoreLibraryDesugaringEnabled = true | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
buildFeatures { | ||
compose = true | ||
buildConfig = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.3" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
val navVersion = "2.7.5" | ||
val roomVersion = "2.6.0" | ||
val sandwichVersion = "1.3.9" | ||
|
||
implementation("androidx.core:core-ktx:1.12.0") | ||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2") | ||
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.2") | ||
implementation("androidx.activity:activity-compose:1.8.0") | ||
implementation(platform("androidx.compose:compose-bom:2023.03.00")) | ||
implementation("androidx.compose.ui:ui:1.5.4") | ||
implementation("androidx.compose.ui:ui-graphics:1.5.4") | ||
implementation("androidx.compose.ui:ui-tooling-preview:1.5.4") | ||
implementation("androidx.compose.material3:material3:1.1.2") | ||
implementation("androidx.compose.material3:material3-window-size-class:1.1.2") | ||
implementation("androidx.compose.material:material-icons-extended:1.5.4") | ||
implementation("androidx.navigation:navigation-compose:$navVersion") | ||
implementation("com.google.accompanist:accompanist-adaptive:0.32.0") | ||
|
||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") | ||
|
||
implementation("com.squareup.retrofit2:retrofit:2.9.0") | ||
implementation("com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:1.0.0") | ||
implementation("com.squareup.okhttp3:okhttp:4.12.0") | ||
|
||
implementation("com.michael-bull.kotlin-result:kotlin-result:1.1.18") | ||
|
||
implementation("androidx.room:room-runtime:$roomVersion") | ||
annotationProcessor("androidx.room:room-compiler:$roomVersion") | ||
|
||
// To use Kotlin Symbol Processing (KSP) | ||
ksp("androidx.room:room-compiler:$roomVersion") | ||
|
||
// optional - Kotlin Extensions and Coroutines support for Room | ||
implementation("androidx.room:room-ktx:$roomVersion") | ||
|
||
// Network response | ||
implementation("com.github.skydoves:sandwich:$sandwichVersion") | ||
|
||
// for java.time | ||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.0.3") | ||
|
||
compileOnly("com.google.code.findbugs:jsr305:3.0.2") | ||
|
||
testImplementation("junit:junit:4.13.2") | ||
androidTestImplementation("androidx.test.ext:junit:1.1.5") | ||
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") | ||
androidTestImplementation(platform("androidx.compose:compose-bom:2023.03.00")) | ||
androidTestImplementation("androidx.compose.ui:ui-test-junit4") | ||
debugImplementation("androidx.compose.ui:ui-tooling") | ||
debugImplementation("androidx.compose.ui:ui-test-manifest") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Add project specific ProGuard rules here. | ||
# You can control the set of applied configuration files using the | ||
# proguardFiles setting in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
24 changes: 24 additions & 0 deletions
24
upvpn-android/app/src/androidTest/kotlin/app/upvpn/upvpn/ExampleInstrumentedTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package app.upvpn.upvpn | ||
|
||
import androidx.test.platform.app.InstrumentationRegistry | ||
import androidx.test.ext.junit.runners.AndroidJUnit4 | ||
|
||
import org.junit.Test | ||
import org.junit.runner.RunWith | ||
|
||
import org.junit.Assert.* | ||
|
||
/** | ||
* Instrumented test, which will execute on an Android device. | ||
* | ||
* See [testing documentation](http://d.android.com/tools/testing). | ||
*/ | ||
@RunWith(AndroidJUnit4::class) | ||
class ExampleInstrumentedTest { | ||
@Test | ||
fun useAppContext() { | ||
// Context of the app under test. | ||
val appContext = InstrumentationRegistry.getInstrumentation().targetContext | ||
assertEquals("app.upvpn.upvpn", appContext.packageName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<resources> | ||
<string name="app_name">UpVPN ㅎ</string> | ||
</resources> |
Oops, something went wrong.