Skip to content

Commit ec64ac6

Browse files
authored
Merge pull request #19 from openziti/build-updates
update Android SDK and gradle plugin versions
2 parents 39f3170 + 8f5dcf7 commit ec64ac6

8 files changed

Lines changed: 48 additions & 37 deletions

File tree

.github/workflows/gradle-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
name: CI build
22

33
on:
4+
workflow_dispatch:
45
push:
5-
branches: ['*']
6+
branches: ['main']
67
pull_request:
78
branches: ['main']
89

.github/workflows/publish-release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Publish Release
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches:
67
- main
@@ -14,11 +15,11 @@ jobs:
1415
BUILD_NUMBER: ${{ github.GITHUB_RUN_NUMBER }}
1516

1617
steps:
17-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
1819
with:
1920
fetch-depth: 0
2021
- name: Set up JDK 11
21-
uses: actions/setup-java@v2
22+
uses: actions/setup-java@v3
2223
with:
2324
java-version: 11
2425
distribution: temurin

build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ buildscript {
2020
google()
2121
}
2222
dependencies {
23-
classpath("com.android.tools.build:gradle:7.3.0")
24-
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.7.10")
23+
classpath("com.android.tools.build:gradle:7.4.2")
24+
classpath("org.jetbrains.dokka:dokka-gradle-plugin:1.8.20")
2525
}
2626

2727
ext.versions = [
@@ -102,9 +102,9 @@ subprojects {
102102
mavenCentral()
103103
}
104104

105-
tasks.withType(PublishToMavenRepository).all {
106-
onlyIf { !semver.info.dirty }
107-
}
105+
// tasks.withType(PublishToMavenRepository).all {
106+
// onlyIf { !semver.info.dirty }
107+
// }
108108
}
109109

110110
nexusPublishing {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
16+
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
1717

1818
kotlin.code.style=official
1919

publish.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ project.plugins.withType(MavenPublishPlugin).all {
4444

4545
developers {
4646
developer {
47-
id = "advdev"
48-
name = "NetFoundry Advanced Development Team"
49-
email = "adv-dev@netfoundry.io"
47+
id = "devs"
48+
name = "OpenZiti Development Team"
49+
email = "developers@openziti.org"
5050
}
5151
}
5252

ziti-android/build.gradle

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ buildscript {
1818
mavenCentral()
1919
}
2020
dependencies {
21-
classpath 'com.github.kezong:fat-aar:1.3.8'
21+
// classpath 'com.github.kezong:fat-aar:1.3.8'
2222
}
2323
}
2424

@@ -29,19 +29,19 @@ plugins {
2929
id 'maven-publish'
3030
}
3131

32-
apply plugin: 'com.kezong.fat-aar'
32+
//apply plugin: 'com.kezong.fat-aar'
3333

3434
ext {
3535
description "Ziti SDK for Android"
3636
}
3737

3838
android {
39-
compileSdkVersion 31
39+
compileSdkVersion 33
4040
ndkVersion "21.3.6528147"
4141

4242
defaultConfig {
4343
minSdkVersion 26
44-
targetSdkVersion 31
44+
targetSdkVersion 33
4545
versionCode 1
4646

4747
buildConfigField "String", "GIT_COMMIT", "\"${semver.info.shortCommit}\""
@@ -81,8 +81,8 @@ dependencies {
8181
exclude module:"lazysodium-java"
8282
exclude module:"jna"
8383
}
84-
embed("com.goterl:lazysodium-android:${versions.lazysodiumAndroid}@aar")
85-
embed('net.java.dev.jna:jna:5.12.1@aar')
84+
api("com.goterl:lazysodium-android:${versions.lazysodiumAndroid}@aar")
85+
api('net.java.dev.jna:jna:5.12.1@aar')
8686

8787
implementation deps.kotlin
8888
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:${versions.coroutines}"

ziti-android/src/main/java/org/openziti/android/InfoProviders.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class AppInfoProvider: DebugInfoProvider {
7979
output.appendLine("Android-SDK: ${Build.VERSION.SDK_INT}")
8080
output.appendLine("Ziti Version: ${BuildConfig.ZITI_VERSION}(${Version.revision})")
8181
output.appendLine("App: ${Ziti.app.packageName}")
82-
output.appendLine("App Version: ${Ziti.app.packageManager.getPackageInfo(Ziti.app.packageName, 0).versionName}")
82+
output.appendLine("App Version: ${Ziti.getAppVersion()}")
8383
}
8484
}
8585

ziti-android/src/main/java/org/openziti/android/Ziti.kt

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager
3232
import kotlinx.coroutines.CoroutineScope
3333
import kotlinx.coroutines.Dispatchers
3434
import kotlinx.coroutines.SupervisorJob
35-
import kotlinx.coroutines.flow.collect
3635
import kotlinx.coroutines.launch
3736
import org.openziti.ZitiContext
3837
import org.openziti.net.dns.DNSResolver
@@ -104,7 +103,7 @@ object Ziti: CoroutineScope, Logged by ZitiLog() {
104103
})
105104

106105
val appId = app.packageName
107-
val appVer = app.packageManager.getPackageInfo(appId, 0).versionName
106+
val appVer = getAppVersion()
108107
org.openziti.Ziti.setApplicationInfo(appId, appVer)
109108

110109
keyStore = KeyStore.getInstance("AndroidKeyStore")
@@ -170,8 +169,9 @@ object Ziti: CoroutineScope, Logged by ZitiLog() {
170169
}
171170

172171
fun enrollZiti(jwtUri: Uri) {
173-
val jwt = app.contentResolver.openInputStream(jwtUri)!!.readBytes()
174-
enrollZiti(jwt)
172+
app.contentResolver.openInputStream(jwtUri)?.use {
173+
enrollZiti(it.readBytes())
174+
}
175175
}
176176

177177
fun enrollZiti(jwt: ByteArray) {
@@ -203,11 +203,11 @@ object Ziti: CoroutineScope, Logged by ZitiLog() {
203203

204204
fun sendFeedbackIntent() = Intent(Intent.ACTION_SEND).apply {
205205
type = "application/zip"
206-
putExtra(Intent.EXTRA_EMAIL, arrayOf("support@netfoundry.io"))
206+
putExtra(Intent.EXTRA_EMAIL, arrayOf("developers@openziti.org"))
207207
putExtra(Intent.EXTRA_SUBJECT, app.getString(R.string.supportEmailSubject))
208208

209209
val identities = Impl.getContexts()
210-
val ids = if (identities.isNullOrEmpty()) {
210+
val ids = if (identities.isEmpty()) {
211211
"no enrollments"
212212
} else {
213213
identities.joinToString(separator = "\n") {
@@ -216,16 +216,16 @@ object Ziti: CoroutineScope, Logged by ZitiLog() {
216216
}
217217

218218
val bodyString = """
219-
|Device: ${Build.MODEL} (${Build.MANUFACTURER})
220-
|Android Version: ${Build.VERSION.RELEASE}
221-
|Android-SDK: ${Build.VERSION.SDK_INT}
222-
|Ziti Version: ${BuildConfig.ZITI_VERSION}(${Version.revision})
223-
|App: ${app.packageName}
224-
|App Version: ${app.packageManager.getPackageInfo(app.packageName, 0).versionName}
225-
|
226-
|Enrollments:
227-
|${ids}
228-
|""".trimMargin()
219+
|Device: ${Build.MODEL} (${Build.MANUFACTURER})
220+
|Android Version: ${Build.VERSION.RELEASE}
221+
|Android-SDK: ${Build.VERSION.SDK_INT}
222+
|Ziti Version: ${BuildConfig.ZITI_VERSION}(${Version.revision})
223+
|App: ${app.packageName}
224+
|App Version: ${getAppVersion()}
225+
|
226+
|Enrollments:
227+
|${ids}
228+
|""".trimMargin()
229229

230230
putExtra(Intent.EXTRA_TEXT, bodyString)
231231

@@ -255,8 +255,12 @@ object Ziti: CoroutineScope, Logged by ZitiLog() {
255255
zip.flush()
256256
zip.close()
257257

258-
putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(app,
259-
"${app.packageName}.provider", logFile))
258+
putExtra(
259+
Intent.EXTRA_STREAM, FileProvider.getUriForFile(
260+
app,
261+
"${app.packageName}.provider", logFile
262+
)
263+
)
260264
}
261265

262266
@JvmStatic
@@ -274,4 +278,9 @@ object Ziti: CoroutineScope, Logged by ZitiLog() {
274278

275279
@JvmStatic
276280
fun getSSLSocketFactory() = Impl.getSSLSocketFactory()
281+
282+
fun getAppVersion(): String {
283+
val packageInfo = app.packageManager.getPackageInfo(app.packageName, 0)
284+
return packageInfo.versionName
285+
}
277286
}

0 commit comments

Comments
 (0)