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

Add Android 6 and Android 7.x Support, Switch to new library catalog declaration, Update Libs #20

Merged
merged 3 commits into from
Sep 29, 2023
Merged
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
11 changes: 6 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- uses: nttld/setup-ndk@v1
with:
ndk-version: r23
ndk-version: r26

- name: Get Commit Message
id: commitMessage
run: IN="${{ github.event.head_commit.message }}" && echo "::set-output name=message::${IN%%$'\n'*}"

- name: Setup JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 20
distribution: temurin

- name: Cache Gradle dependencies
uses: actions/cache@v3
Expand Down Expand Up @@ -100,7 +101,7 @@ jobs:
run: mv app/build/outputs/apk/release/app-release-unsigned-signed.apk app/build/outputs/apk/release/app-release.apk

- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Release Artifact
path: app/build/outputs/apk/release/app-release.apk
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/playstore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive

- uses: nttld/setup-ndk@v1
with:
ndk-version: r23
ndk-version: r26

- name: Setup JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v3
with:
java-version: 17
java-version: 20
distribution: temurin

- name: Cache Gradle dependencies
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
Expand All @@ -42,7 +43,7 @@ jobs:
restore-keys: ${{ runner.os }}-gradle-

- name: Cache build cache
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/.ccache
Expand Down Expand Up @@ -73,10 +74,10 @@ jobs:
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
env:
BUILD_TOOLS_VERSION: 33.0.0
BUILD_TOOLS_VERSION: 34.0.0

- name: Upload Artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: Artifact
path: app/build/outputs/bundle/release/app-release.aab
Expand All @@ -88,7 +89,7 @@ jobs:
run: echo '${{ secrets.SERVICE_ACCOUNT_JSON }}' > service_account.json

- name: Deploy to Production
uses: r0adkll/upload-google-play@v1.0.15
uses: r0adkll/upload-google-play@v1.1.2
with:
serviceAccountJson: service_account.json
packageName: de.dertyp7214.rboardpatcher
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "rboardcomponents"]
path = rboardcomponents
url = git@github.com:DerTyp7214/RboardComponents.git
[submodule "colorutilsc"]
path = colorutilsc
url = git@github.com:DerTyp7214/ColorUtilsC.git
[submodule "rboardcomponents"]
path = rboardcomponents
url = git@github.com:DerTyp7214/rBoardComponents.git
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 5 additions & 12 deletions .idea/deploymentTargetDropDown.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions .idea/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/migrations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 0 additions & 61 deletions app/build.gradle

This file was deleted.

86 changes: 86 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import org.jetbrains.kotlin.config.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.android.application")
kotlin("android")
kotlin("kapt")
alias(libs.plugins.ksp)
}

android {
namespace = "de.dertyp7214.rboardpatcher"
compileSdk = 34
buildToolsVersion = "34.0.0"

buildFeatures.buildConfig = true

defaultConfig {
applicationId = "de.dertyp7214.rboardpatcher"
minSdk = 23
targetSdk = 34
versionCode = 2700
versionName = "2.7"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
getByName("debug") {
isDebuggable = true
applicationIdSuffix = ".debug"
}
}
compileOptions {
isCoreLibraryDesugaringEnabled = true
sourceCompatibility = JavaVersion.VERSION_20
targetCompatibility = JavaVersion.VERSION_20
}

kotlinOptions {
jvmTarget = JvmTarget.JVM_20.description
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
)
}

tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = JvmTarget.JVM_20.description
}
}

packaging {
jniLibs {
useLegacyPackaging = true
}
resources.excludes.add("/META-INF/{AL2.0,LGPL2.1}")
}
}

dependencies {
implementation(project(":colorutilsc"))
implementation(project(":rboardcomponents"))

implementation(libs.browser)
implementation(libs.storage)
implementation(libs.core.ktx)
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.constraintlayout)
implementation(libs.kotlin.stdlib)
implementation(libs.kotlinx.coroutines.android)
implementation(libs.gson)
implementation(libs.preference.ktx)
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.espresso.core)
coreLibraryDesugaring(libs.desugar.jdk.libs.nio)
}
Binary file modified app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.dertyp7214.rboardpatcher.core

import android.os.Build
import de.dertyp7214.rboardpatcher.adapter.types.ThemeDataClass
import java.io.File
import java.net.URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,11 @@ class PatchActivity : BaseActivity() {
progress = { progress, stage ->
CoroutineScope(Dispatchers.Main).launch {
patchTheme.text = "Applying: $stage"
progressBar.setProgress(progress.roundToInt(), true)
if(Build.VERSION.SDK_INT > Build.VERSION_CODES.N){
progressBar.setProgress(progress.roundToInt(), true)
} else{
progressBar.progress = progress.roundToInt()
}
}
}) {
patchTheme.isEnabled = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ fun isPackageInstalled(packageName: String, packageManager: PackageManager): Boo
return try {
if (Build.VERSION.SDK_INT >= 33)
packageManager.getPackageInfo(packageName, PackageManager.PackageInfoFlags.of(0L))
else packageManager.getPackageInfo(packageName, 0)
else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
packageManager.getPackageInfo(packageName, 0).longVersionCode
} else {
packageManager.getPackageInfo(packageName, 0).versionCode.toLong()

}
true
} catch (e: PackageManager.NameNotFoundException) {
false
Expand Down
Loading
Loading