Skip to content

Commit ace1a55

Browse files
authored
Merge branch 'master' into upnp
2 parents 92be2cd + 4d735d1 commit ace1a55

37 files changed

+764
-847
lines changed

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ license terms that you should be aware of.
1313

1414
Orbot is distributed under this license (aka the 3-clause BSD license)
1515

16-
Copyright (c) 2009-2010, Nathan Freitas, The Guardian Project
16+
Copyright (c) 2009-2025, Nathan Freitas, The Guardian Project
1717

1818
Redistribution and use in source and binary forms, with or without
1919
modification, are permitted provided that the following conditions are
@@ -65,7 +65,7 @@ Tor is distributed under this license:
6565

6666
Copyright (c) 2001-2004, Roger Dingledine
6767
Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
68-
Copyright (c) 2007-2009, The Tor Project, Inc.
68+
Copyright (c) 2007-2025, The Tor Project, Inc.
6969

7070
Redistribution and use in source and binary forms, with or without
7171
modification, are permitted provided that the following conditions are

app/build.gradle

Lines changed: 0 additions & 196 deletions
This file was deleted.

app/build.gradle.kts

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
import com.android.build.gradle.internal.api.ApkVariantOutputImpl
2+
import java.io.FileInputStream
3+
import java.util.*
4+
5+
plugins {
6+
alias(libs.plugins.kotlin.android)
7+
alias(libs.plugins.kotlin.serialization)
8+
alias(libs.plugins.android.application)
9+
}
10+
11+
kotlin { jvmToolchain(21) }
12+
13+
val orbotBaseVersionCode = 1750300200
14+
fun getVersionName(): String {
15+
// Gets the version name from the latest Git tag
16+
return providers.exec {
17+
commandLine("git", "describe", "--tags", "--always")
18+
}.standardOutput.asText.get().trim()
19+
}
20+
21+
android {
22+
namespace = "org.torproject.android"
23+
compileSdk = 36
24+
25+
defaultConfig {
26+
applicationId = namespace
27+
versionCode = orbotBaseVersionCode
28+
versionName = getVersionName()
29+
minSdk = 24
30+
targetSdk = 36
31+
multiDexEnabled = true
32+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
33+
flavorDimensions += "free"
34+
}
35+
36+
compileOptions {
37+
sourceCompatibility = JavaVersion.VERSION_21
38+
targetCompatibility = JavaVersion.VERSION_21
39+
}
40+
41+
splits {
42+
abi {
43+
isEnable = true
44+
reset()
45+
include("x86", "armeabi-v7a", "x86_64", "arm64-v8a")
46+
isUniversalApk = true
47+
}
48+
}
49+
50+
buildFeatures {
51+
buildConfig = true
52+
viewBinding = true
53+
}
54+
55+
testOptions { execution = "ANDROIDX_TEST_ORCHESTRATOR" }
56+
57+
signingConfigs {
58+
create("release") {
59+
val keystorePropertiesFile = rootProject.file("keystore.properties")
60+
val keystoreProperties = Properties()
61+
if (keystorePropertiesFile.canRead()) {
62+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
63+
}
64+
if (!keystoreProperties.stringPropertyNames().isEmpty()) {
65+
keyAlias = keystoreProperties["keyAlias"] as String
66+
keyPassword = keystoreProperties["keyPassword"] as String
67+
storeFile = file(keystoreProperties["storeFile"] as String)
68+
storePassword = keystoreProperties["storePassword"] as String
69+
}
70+
}
71+
}
72+
73+
buildTypes {
74+
getByName("release") {
75+
isShrinkResources = false
76+
isMinifyEnabled = false
77+
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.txt")
78+
signingConfig = signingConfigs.getByName("release")
79+
}
80+
getByName("debug") {
81+
isDebuggable = true
82+
applicationIdSuffix = ".debug"
83+
}
84+
}
85+
86+
productFlavors {
87+
create("fullperm") { dimension = "free" }
88+
create("nightly") {
89+
dimension = "free"
90+
// overwrites defaults from defaultConfig
91+
applicationId = "org.torproject.android.nightly"
92+
versionCode = (Date().time / 1000).toInt()
93+
}
94+
}
95+
96+
packaging {
97+
resources {
98+
excludes += listOf("META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version")
99+
}
100+
}
101+
102+
lint {
103+
abortOnError = false
104+
checkReleaseBuilds = false
105+
disable += "InvalidPackage"
106+
htmlReport = true
107+
lintConfig = file("../lint.xml")
108+
textReport = false
109+
xmlReport = false
110+
}
111+
}
112+
113+
// Increments versionCode by ABI type
114+
android.applicationVariants.all {
115+
outputs.configureEach { ->
116+
if (versionCode == orbotBaseVersionCode) {
117+
val incrementMap =
118+
mapOf("armeabi-v7a" to 1, "arm64-v8a" to 2, "x86" to 4, "x86_64" to 5)
119+
val increment = incrementMap[filters.find { it.filterType == "ABI" }?.identifier] ?: 0
120+
(this as ApkVariantOutputImpl).versionCodeOverride = orbotBaseVersionCode + increment
121+
}
122+
}
123+
}
124+
125+
dependencies {
126+
implementation(project(":OrbotLib"))
127+
implementation(project(":orbotservice"))
128+
implementation(libs.android.material)
129+
implementation(libs.android.volley)
130+
implementation(libs.androidx.activity)
131+
implementation(libs.androidx.core.ktx)
132+
implementation(libs.androidx.localbroadcast)
133+
implementation(libs.androidx.navigation.fragment.ktx)
134+
implementation(libs.androidx.navigation.ui.ktx)
135+
implementation(libs.androidx.preference)
136+
implementation(libs.androidx.appcompat)
137+
implementation(libs.androidx.biometric)
138+
implementation(libs.androidx.lifecycle.common)
139+
implementation(libs.androidx.lifecycle.process)
140+
implementation(libs.retrofit.converter)
141+
implementation(libs.retrofit.lib)
142+
implementation(libs.rootbeer.lib)
143+
implementation(libs.kotlinx.coroutines.core)
144+
implementation(libs.kotlinx.serialization.json)
145+
implementation(libs.appiconnamechanger)
146+
147+
testImplementation(libs.junit.jupiter)
148+
androidTestImplementation(libs.androidx.junit)
149+
androidTestImplementation(libs.androidx.espresso)
150+
androidTestImplementation(libs.androidx.rules)
151+
androidTestImplementation(libs.androidx.runner)
152+
androidTestImplementation(libs.screengrab)
153+
androidTestUtil(libs.androidx.orchestrator)
154+
}
155+
156+
tasks.named("preBuild") { dependsOn("copyLicenseToAssets") }
157+
tasks.register<Copy>("copyLicenseToAssets") {
158+
from(layout.projectDirectory.file("LICENSE"))
159+
into(layout.projectDirectory.dir("src/main/assets"))
160+
}
161+

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
-->
4242
<application
4343
android:name=".OrbotApp"
44+
android:supportsRtl="true"
4445
android:allowBackup="false"
4546
android:allowClearUserData="true"
4647
android:configChanges="locale|orientation|screenSize"

0 commit comments

Comments
 (0)