Skip to content

Commit

Permalink
Update AS and dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
maniac103 committed Jul 2, 2024
1 parent c8e6809 commit 0e07622
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
25 changes: 12 additions & 13 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,10 @@ android {
signingConfigs {
playStore
}
compileSdkVersion 33
buildToolsVersion '33.0.0'
compileSdk 34
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
targetSdkVersion 33

This comment has been minimized.

Copy link
@Fs00

Fs00 Jul 2, 2024

Contributor

@maniac103 I believe that we'll hit the notification trampoline restriction by bumping the target SDK. Both EventReceiver and NotificationHandlingService call startActivity in response to notification clicks, which is disallowed for apps targeting Android 12 and higher.

This comment has been minimized.

Copy link
@maniac103

maniac103 Jul 3, 2024

Author Collaborator

Uh, damn, I'll look into it. I just needed to bump the target SDK because the release build complained about it :-/

This comment has been minimized.

Copy link
@maniac103

maniac103 Jul 3, 2024

Author Collaborator

I fixed our notification (by avoiding routing the activity start via service) and killed off EventReceiver (as I don't see how the running download noficiation click handling can be implemented with that restriction in place.

This comment has been minimized.

Copy link
@Fs00

Fs00 Jul 3, 2024

Contributor

Great, thank you!

I was also wondering if we can take this opportunity to bump our minSdk to 23, considering that we'll soon have 10 Android versions to support and:

  • we've already had some Lollipop-specific bugs (#1261, #821, #1260)
  • AndroidX minSdk is 21 since April, at this pace it's possible that they'll bump it to 23 next year
  • a higher minSdk means that we can target WebView versions that support more web features and APIs

This comment has been minimized.

Copy link
@maniac103

maniac103 Jul 3, 2024

Author Collaborator

I'll do one more release with the trampoline fix; I'm fine with the bump afterwards.

This comment has been minimized.

Copy link
@Fs00

Fs00 Jul 3, 2024

Contributor

That's fine. Will you try to get it released on the Play Store too?

This comment has been minimized.

Copy link
@maniac103

maniac103 Jul 3, 2024

Author Collaborator

No, because I still don't see how to work with / circumvent their requirement to create a GH account for them. I really don't have time (and motivation) to deal with their BS. It's kinda obvious (also from their changes to URL handling) that they're not interested in 3rd party clients for cloud services.

This comment has been minimized.

Copy link
@Fs00

Fs00 Jul 3, 2024

Contributor

I absolutely agree with you on this. I'd like to bring back #1130 since we no longer target the Play Store, I'll try to open a PR for that this week.

I've also just realized that #1260 was merged after the latest published release, so the app was almost unusable on Lollipop for more than one year and a half and no one came to complain. We probably won't lose anything by bumping minSdk to 23 for the next release 🙂

versionCode 73
versionName "4.6.10"
applicationId "com.gh4a"
Expand All @@ -42,11 +41,8 @@ android {
buildTypes {
debug {
applicationIdSuffix '.debug'
zipAlignEnabled true
}
release {
zipAlignEnabled true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.playStore
}
Expand All @@ -57,18 +53,21 @@ android {
targetCompatibility JavaVersion.VERSION_11
}
namespace 'com.gh4a'
buildFeatures {
buildConfig true
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.preference:preference:1.2.0'
implementation 'androidx.browser:browser:1.4.0'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.browser:browser:1.8.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'androidx.print:print:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.work:work-runtime:2.7.1'
implementation 'com.google.android.material:material:1.6.0'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.work:work-runtime:2.9.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.6.4'
implementation 'com.squareup.retrofit2:converter-moshi:2.6.4'
Expand All @@ -93,7 +92,7 @@ dependencies {
}
implementation 'com.github.Tunous:MarkdownEdit:1.0.0'
implementation 'com.github.qoqa:traceur:2.2.12'
testImplementation 'junit:junit:4.13.1'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.robolectric:robolectric:4.4'
}

Expand Down
7 changes: 5 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<activity
android:name=".activities.Github4AndroidActivity"
android:launchMode="singleTop"
android:exported="true"
android:configChanges="orientation|screenSize" >
<intent-filter>
<action
Expand Down Expand Up @@ -147,6 +148,7 @@
<activity android:name=".resolver.BrowseFilter"
android:excludeFromRecents="true"
android:taskAffinity=""
android:exported="true"
android:theme="@style/TransparentTheme">
<intent-filter>
<action
Expand Down Expand Up @@ -200,8 +202,9 @@
android:exported="false" />

<receiver
android:name="EventReceiver">
<intent-filter>
android:name="EventReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.DOWNLOAD_NOTIFICATION_CLICKED" />
</intent-filter>
</receiver>
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/java/com/gh4a/utils/HttpImageGetter.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import java.util.Map;

import androidx.annotation.NonNull;
import androidx.appcompat.graphics.drawable.DrawableWrapper;
import androidx.appcompat.graphics.drawable.DrawableWrapperCompat;
import androidx.core.content.ContextCompat;
import okhttp3.HttpUrl;
import okhttp3.MediaType;
Expand Down Expand Up @@ -123,7 +123,7 @@ public LoadedBitmapDrawable(Resources res, Bitmap bitmap) {
}
}

private static class PlaceholderDrawable extends DrawableWrapper implements Runnable {
private static class PlaceholderDrawable extends DrawableWrapperCompat implements Runnable {
private final String mUrl;
private final ObjectInfo mInfo;
private Drawable mLoadedImage;
Expand All @@ -148,7 +148,7 @@ public void addLoadedImage(Drawable image, Handler handler) {

@Override
public void run() {
setWrappedDrawable(mLoadedImage);
setDrawable(mLoadedImage);
setBounds(0, 0, mLoadedImage.getIntrinsicWidth(), mLoadedImage.getIntrinsicHeight());
mInfo.invalidateViewsForNewDrawable();
}
Expand Down Expand Up @@ -208,7 +208,7 @@ void onImageLoadDone() {
Drawable d = span.getDrawable();
if (d instanceof PlaceholderDrawable) {
PlaceholderDrawable phd = (PlaceholderDrawable) d;
d = phd.getWrappedDrawable();
d = phd.getDrawable();
}
if (d instanceof GifDrawable) {
GifDrawable gd = (GifDrawable) d;
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/java/com/gh4a/worker/NotificationsWorker.java
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,11 @@ private void showSummaryNotification(NotificationManagerCompat nm,
.build();

PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
HomeActivity.makeIntent(context, R.id.notifications), 0);
HomeActivity.makeIntent(context, R.id.notifications),
PendingIntent.FLAG_IMMUTABLE);
PendingIntent deleteIntent = PendingIntent.getService(context, 0,
NotificationHandlingService.makeMarkNotificationsSeenIntent(context), 0);
NotificationHandlingService.makeMarkNotificationsSeenIntent(context),
PendingIntent.FLAG_IMMUTABLE);
NotificationCompat.Builder builder = makeBaseBuilder()
.setGroup(GROUP_ID_GITHUB)

This comment has been minimized.

Copy link
@NeMeC777

NeMeC777 Jul 19, 2024

{
"version": "0.2.0",
"configurations": [
{
"name": "Run application",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"start"
],
"skipFiles": [
"<node_internals>/**"
]
}
]
}

.setGroupSummary(true)
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:8.5.0'
}
}

Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
android.enableJetifier=true
android.nonFinalResIds=false
android.nonTransitiveRClass=false
android.useAndroidX=true
org.gradle.jvmargs=-Xmx2g
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip

0 comments on commit 0e07622

Please sign in to comment.