Skip to content

Commit

Permalink
SDK 34 adaptations
Browse files Browse the repository at this point in the history
- build.gradle upgrades
- Code adaptations to remove switch cases to resource IDs
- Fix import of resource IDs from library level resources
- Minimum version requirement set to LOLLIPOP
  • Loading branch information
TranceLove committed Jul 10, 2024
1 parent bdc86af commit 0350790
Show file tree
Hide file tree
Showing 97 changed files with 694 additions and 782 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/android-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Check formatting using spotless
uses: gradle/actions/setup-gradle@v3
with:
Expand All @@ -31,11 +31,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/android-debug-artifact-ondemand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
repository: ${{fromJson(steps.request.outputs.data).head.repo.full_name}}
ref: ${{fromJson(steps.request.outputs.data).head.ref}}
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/android-debug-artifact-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/android-feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Check formatting using spotless
uses: gradle/actions/setup-gradle@v3
with:
Expand All @@ -32,11 +32,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/android-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Check formatting using spotless
uses: gradle/actions/setup-gradle@v3
with:
Expand All @@ -34,11 +34,11 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 11
java-version: 17
- name: Build with Gradle
uses: gradle/actions/setup-gradle@v3
with:
Expand Down Expand Up @@ -71,10 +71,11 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v4
- name: Java 15
- name: Java 17
uses: actions/setup-java@v4
with:
java-version: 15
distribution: "temurin"
java-version: 17
- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
- name: AVD cache
Expand Down
21 changes: 7 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.hiya.jacoco-android'
apply plugin: "com.mxalbert.gradle.jacoco-android"
apply plugin: "com.starter.easylauncher"
apply plugin: 'com.google.devtools.ksp'

Expand All @@ -15,7 +15,6 @@ android {
}
}


defaultConfig {
applicationId "com.amaze.filemanager"
minSdkVersion libs.versions.minSdk.get().toInteger()
Expand Down Expand Up @@ -95,12 +94,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '11'
jvmTarget = '17'
}

testOptions {
Expand Down Expand Up @@ -262,7 +261,7 @@ dependencies {
}

kotlin {
jvmToolchain(11)
jvmToolchain(17)
}

configurations.configureEach {
Expand Down Expand Up @@ -291,6 +290,8 @@ tasks.register('supportOldLangCodes')
include('strings.xml')
}
supportOldLangCodes.dependsOn copyTask
rootProject.tasks.named('spotlessJava').configure { dependsOn copyTask }
rootProject.tasks.named('spotlessKotlin').configure { dependsOn copyTask }
}

project.afterEvaluate {
Expand All @@ -304,14 +305,6 @@ jacoco {
toolVersion = libs.versions.jacoco.get()
}

tasks.withType(JacocoReport).configureEach {
reports {
csv.required.set(false)
html.required.set(true)
xml.required.set(true)
}
}

tasks.withType(Test).configureEach {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
Expand Down
7 changes: 7 additions & 0 deletions app/proguard.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@
-keep class org.bouncycastle.jcajce.spec.* {*;}
-keep class org.bouncycastle.jce.** {*;}

-dontwarn org.bouncycastle.jsse.**
-dontwarn org.bouncycastle.asn1.ASN1ApplicationSpecific
-dontwarn org.bouncycastle.asn1.DERApplicationSpecific
-dontwarn org.conscrypt.**
-dontwarn org.openjsse.**
-dontwarn sun.security.x509.X509Key

-dontwarn javax.naming.**

#From here sshj. We are not using GSSAPI to connect to SSH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,20 +263,14 @@ public boolean onCreateOptionsMenu(final Menu menu) {

@Override
public boolean onOptionsItemSelected(final MenuItem item) {
final int id = item.getItemId();
switch (id) {
case android.R.id.home:
goToReturnActivity();
break;
case R.id.menu_item_share_error:
final Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, buildMarkdown());
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, getString(R.string.share)));
break;
default:
break;
if (item.getItemId() == android.R.id.home) {
goToReturnActivity();
} else if (item.getItemId() == R.id.menu_item_share_error) {
final Intent intent = new Intent();
intent.setAction(Intent.ACTION_SEND);
intent.putExtra(Intent.EXTRA_TEXT, buildMarkdown());
intent.setType("text/plain");
startActivity(Intent.createChooser(intent, getString(R.string.share)));
}
return false;
}
Expand Down
Loading

0 comments on commit 0350790

Please sign in to comment.