Skip to content

Commit a716625

Browse files
committed
upgrade dependencies and add AAB build for Play Store
- Update AGP 8.2.2 → 8.7.3, Gradle 8.4 → 8.9 - Update all androidx dependencies to latest stable versions - Replace deprecated lifecycle-extensions with lifecycle-viewmodel+livedata - Replace deprecated ViewModelProviders with ViewModelProvider - Update gson 2.8.5 → 2.11.0, test dependencies to latest - Add AAB (App Bundle) build to CI workflow for Play Store submission - Disable jetifier (no longer needed with modern deps) - Remove unused fileTree dependency
1 parent 8c2a42d commit a716625

7 files changed

Lines changed: 33 additions & 27 deletions

File tree

.github/workflows/build_apk.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,26 @@ jobs:
4141
distribution: 'temurin'
4242
java-version: '17'
4343

44-
- name: Assemble Release APK
45-
run: ./gradlew assembleRelease --stacktrace
44+
- name: Assemble Release APK and AAB
45+
run: ./gradlew assembleRelease bundleRelease --stacktrace
4646

4747
- name: Upload APK to artifacts
4848
uses: actions/upload-artifact@v4
4949
with:
50-
name: TouchHelper
50+
name: TouchHelper-APK
5151
path: ./app/build/outputs/apk/
5252

53+
- name: Upload AAB to artifacts
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: TouchHelper-AAB
57+
path: ./app/build/outputs/bundle/release/
58+
5359
- name: Create ZIPs
54-
working-directory: ./app/build/outputs/apk/
60+
working-directory: ./app/build/outputs/
5561
run: |
56-
zip -r ./TouchHelper.zip ./release
62+
zip -r ./TouchHelper-APK.zip ./apk/release
63+
zip -r ./TouchHelper-AAB.zip ./bundle/release
5764
5865
- name: Get git revision
5966
id: get_git_revision
@@ -70,4 +77,6 @@ jobs:
7077
name: Release ${{ steps.get_git_revision.outputs.release_name }}
7178
draft: false
7279
prerelease: false
73-
files: ./app/build/outputs/apk/TouchHelper.zip
80+
files: |
81+
./app/build/outputs/TouchHelper-APK.zip
82+
./app/build/outputs/TouchHelper-AAB.zip

app/build.gradle

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -74,21 +74,21 @@ android {
7474
}
7575

7676
dependencies {
77-
implementation fileTree(dir: "libs", include: ["*.jar"])
78-
implementation 'androidx.appcompat:appcompat:1.2.0'
79-
implementation 'com.google.android.material:material:1.2.1'
80-
implementation 'androidx.constraintlayout:constraintlayout:2.0.2'
81-
implementation 'androidx.navigation:navigation-fragment:2.1.0'
82-
implementation 'androidx.navigation:navigation-ui:2.1.0'
83-
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
84-
testImplementation 'junit:junit:4.12'
85-
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
86-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
77+
implementation 'androidx.appcompat:appcompat:1.7.0'
78+
implementation 'com.google.android.material:material:1.12.0'
79+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
80+
implementation 'androidx.navigation:navigation-fragment:2.8.5'
81+
implementation 'androidx.navigation:navigation-ui:2.8.5'
82+
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.8.7'
83+
implementation 'androidx.lifecycle:lifecycle-livedata:2.8.7'
84+
testImplementation 'junit:junit:4.13.2'
85+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
86+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
8787

88-
implementation 'com.google.code.gson:gson:2.8.5'
88+
implementation 'com.google.code.gson:gson:2.11.0'
8989

9090
// https://developer.android.com/jetpack/androidx/releases/preference?hl=zh-cn
91-
implementation 'androidx.preference:preference:1.1.1'
91+
implementation 'androidx.preference:preference:1.2.1'
9292

9393
// https://mvnrepository.com/artifact/com.belerweb/pinyin4j
9494
implementation group: 'com.belerweb', name: 'pinyin4j', version: '2.5.1'

app/src/main/java/com/zfdang/touchhelper/ui/about/AboutFragment.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
import androidx.annotation.NonNull;
1313
import androidx.annotation.Nullable;
1414
import androidx.fragment.app.Fragment;
15-
import androidx.lifecycle.Observer;
16-
import androidx.lifecycle.ViewModelProviders;
17-
1815
import com.zfdang.touchhelper.R;
1916

2017
public class AboutFragment extends Fragment {

app/src/main/java/com/zfdang/touchhelper/ui/home/HomeFragment.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
import androidx.lifecycle.MediatorLiveData;
3232
import androidx.lifecycle.MutableLiveData;
3333
import androidx.lifecycle.Observer;
34-
import androidx.lifecycle.ViewModelProviders;
34+
import androidx.lifecycle.ViewModelProvider;
3535

3636
import com.zfdang.touchhelper.R;
3737
import com.zfdang.touchhelper.TouchHelperService;
@@ -45,7 +45,7 @@ public class HomeFragment extends Fragment {
4545
public View onCreateView(@NonNull LayoutInflater inflater,
4646
ViewGroup container, Bundle savedInstanceState) {
4747
homeViewModel =
48-
ViewModelProviders.of(this).get(HomeViewModel.class);
48+
new ViewModelProvider(this).get(HomeViewModel.class);
4949
View root = inflater.inflate(R.layout.fragment_home, container, false);
5050

5151
final Drawable drawableYes = ContextCompat.getDrawable(getContext(), R.drawable.ic_right);

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
gradlePluginPortal()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:8.2.2'
10+
classpath 'com.android.tools.build:gradle:8.7.3'
1111

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

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ org.gradle.jvmargs=-Xmx2048m
1515
# Android operating system, and which are packaged with your app"s APK
1616
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1717
android.useAndroidX=true
18-
# Automatically convert third-party libraries to use AndroidX
19-
android.enableJetifier=true
18+
# Jetifier no longer needed - all dependencies use AndroidX natively
19+
# android.enableJetifier=true
2020

2121
# Keystore credentials (DO NOT commit real values to version control)
2222
# Set these in local.properties or as environment variables

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip

0 commit comments

Comments
 (0)