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

Specify export flag for Context-based receiver #72

Merged
merged 4 commits into from
Jul 27, 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
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ version: 2.1
executors:
android:
docker:
- image: cimg/android:2022.03
- image: cimg/android:2023.07
working_directory: ~/deploygate-android-sdk
environment:
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false'
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

MaxPermSize is no longer valid for JVM 9 or later


commands:
restore_gradle_cache:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8.x'
java-version: '17.x'
java-package: jdk
distribution: 'temurin'
cache: 'gradle'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8.x'
java-version: '17.x'
java-package: jdk
distribution: 'temurin'
cache: 'gradle'
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8.x'
java-version: '17.x'
java-package: jdk
distribution: 'temurin'
cache: 'gradle'
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ buildscript {
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.akaita.android:easylauncher:1.3.1'
classpath 'com.android.tools.build:gradle:7.4.2'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To use Android SDK 33

classpath 'com.project.starter:easylauncher:5.0.1'
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 4 additions & 4 deletions sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'
apply plugin: 'com.akaita.android.easylauncher'
apply plugin: 'com.starter.easylauncher'

android {
compileSdkVersion = 32
compileSdkVersion 33

defaultConfig {
applicationId "com.deploygate.sample"
minSdkVersion 14
targetSdkVersion 32
targetSdkVersion 33
}

buildTypes {
Expand Down Expand Up @@ -56,7 +56,7 @@ android {
}

easylauncher {
defaultFlavorNaming = true
defaultFlavorNaming true

productFlavors {
devreal {
Expand Down
12 changes: 6 additions & 6 deletions sdk.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ apply plugin: 'maven-publish'
version = rootProject.ext.releaseVersion

android {
compileSdkVersion 29
compileSdkVersion 33

defaultConfig {
minSdkVersion 14
targetSdkVersion 29
targetSdkVersion 33
versionCode 1
versionName project.version
manifestPlaceholders = [sdkVersion:"4"]
Expand Down Expand Up @@ -40,11 +40,11 @@ android {
}

dependencies {
testImplementation 'androidx.test:runner:1.2.0'
testImplementation 'androidx.test.ext:junit:1.1.1'
testImplementation 'org.robolectric:robolectric:4.3.1'
testImplementation 'androidx.test:runner:1.5.2'
testImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation 'org.robolectric:robolectric:4.10.3'

testImplementation 'androidx.test:rules:1.2.0'
testImplementation 'androidx.test:rules:1.5.0'
testImplementation 'com.google.truth:truth:1.0'
Copy link
Member

Choose a reason for hiding this comment

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

truth:1.1.4 is now available. how about it updating?
see: https://truth.dev/

Suggested change
testImplementation 'com.google.truth:truth:1.0'
testImplementation 'com.google.truth:truth:1.1.4'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@satsukies
Please make a new PR. These updates are just for Android 14 SDK and JVM changes.

Copy link
Member

Choose a reason for hiding this comment

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

@jmatsu
I see. My comment was off the maintain of PR.

}

Expand Down
11 changes: 9 additions & 2 deletions sdk/src/main/java/com/deploygate/sdk/DeployGate.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import android.content.Intent;
import android.content.IntentFilter;
import android.content.ServiceConnection;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.IBinder;
Expand Down Expand Up @@ -259,7 +260,7 @@ private boolean initService(boolean isBoot) {

private void prepareBroadcastReceiver() {
IntentFilter filter = new IntentFilter(ACTION_DEPLOYGATE_STARTED);
mApplicationContext.registerReceiver(new BroadcastReceiver() {
BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(
Context context,
Expand All @@ -272,7 +273,13 @@ public void onReceive(
bindToService(false);
}
}
}, filter);
};

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
mApplicationContext.registerReceiver(receiver, filter, Context.RECEIVER_EXPORTED);
} else {
mApplicationContext.registerReceiver(receiver, filter);
}
}

private void bindToService(final boolean isBoot) {
Expand Down