Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Gradle, JVM and AGP #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions postixdroid/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
apply plugin: 'com.android.application'
plugins {
alias(libs.plugins.android.application)
}

android {
compileSdkVersion 33
namespace = "de.ccc.events.postixdroid"

compileSdk 33

defaultConfig {
applicationId "de.events.ccc.postixdroid"
applicationId "de.ccc.events.postixdroid"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, I'm not sure how that happened. Should be the previous applicationid, or @pc-coholic?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Phew.... Usually I would say "Do not touch" as to not disturb the update-process for existing installations.

But then again on the other hand, we do tend to install the app from scratch on all our rental devices and only the old (and hopefully soon to be permanently decomissioned) LCKJ-devices are getting the package through MDM (which I control)...

So I guess we could fix that oversight... @raphaelm @rixx any opinions on this?

minSdkVersion 16
targetSdkVersion 33
versionCode 6
versionName "camp23.2"
multiDexEnabled true
}

lintOptions {
disable 'InvalidPackage' // problem with jetty and bouncycastle
}

signingConfigs {
release {
storeFile file("../../release.keystore")
Expand All @@ -39,16 +39,22 @@ android {
}

packagingOptions {
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
resources {
excludes += ['META-INF/LICENSE.txt', 'META-INF/NOTICE.txt']
}
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'me.dm7.barcodescanner:zxing:1.9.8'
implementation 'com.squareup.okhttp3:okhttp:4.10.0'
implementation libs.multidex
implementation libs.appcompat
implementation libs.material
implementation libs.zxing
implementation libs.okhttp
}
3 changes: 1 addition & 2 deletions postixdroid/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="de.ccc.events.postixdroid">
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import android.media.MediaPlayer;
import android.net.wifi.WifiManager;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import androidx.annotation.RawRes;
Expand Down Expand Up @@ -126,16 +127,24 @@ public void onCreate(Bundle savedInstanceState) {

dataWedgeHelper = new DataWedgeHelper(this);
if (dataWedgeHelper.isInstalled()) {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
PERMISSIONS_REQUEST_WRITE_STORAGE);
} else {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
try {
dataWedgeHelper.install();
} catch (IOException e) {
e.printStackTrace();
}
} else {
if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE},
PERMISSIONS_REQUEST_WRITE_STORAGE);
} else {
try {
dataWedgeHelper.install();
} catch (IOException e) {
e.printStackTrace();
}
}
}
}
timerHandler.postDelayed(timerUpdate, 100);
Expand Down Expand Up @@ -192,7 +201,9 @@ public void onRequestPermissionsResult(int requestCode, String permissions[], in
}
case PERMISSIONS_REQUEST_WRITE_STORAGE: {
try {
dataWedgeHelper.install();
if (dataWedgeHelper != null) {
dataWedgeHelper.install();
}
} catch (IOException e) {
e.printStackTrace();
}
Expand Down
22 changes: 3 additions & 19 deletions postixdroid/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,5 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}
plugins {
alias(libs.plugins.android.application) apply false
}
9 changes: 8 additions & 1 deletion postixdroid/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,11 @@
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
18 changes: 18 additions & 0 deletions postixdroid/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[versions]
agp = "8.7.3"
appcompat = "1.6.1"
material = "1.9.0"
multidex = "1.0.3"
zxing = "1.9.8"
okhttp = "4.10.0"

[libraries]
appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" }
material = { group = "com.google.android.material", name = "material", version.ref = "material" }
multidex = { group = "com.android.support", name = "multidex", version.ref = "multidex" }
zxing = { group = "me.dm7.barcodescanner", name = "zxing", version.ref = "zxing" }
okhttp = { group = "com.squareup.okhttp3", name = "okhttp", version.ref = "okhttp" }

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }

Binary file modified postixdroid/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions postixdroid/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Thu Dec 20 19:47:58 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
Loading