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

Syncing upstream repo #9

Merged
merged 12 commits into from
Sep 27, 2024
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
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
java-version: '17'
distribution: 'temurin'

- name: Cache Gradle packages
uses: actions/cache@v2
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
Expand All @@ -29,4 +29,4 @@ jobs:
run: ./gradlew check jacoco assemble

- name: Codecov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ private void endSession() {
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == RC_END_SESSION) {
EndSessionResonse resp = EndSessionResonse.fromIntent(data);
EndSessionResponse resp = EndSessionResponse.fromIntent(data);
AuthorizationException ex = AuthorizationException.fromIntent(data);
// ... process the response or exception ...
} else {
Expand Down
6 changes: 1 addition & 5 deletions app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
-->
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="net.openid.appauthdemo" >
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand All @@ -31,8 +29,6 @@
</queries>

<application
android:allowBackup="false"
android:fullBackupContent="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name_short"
android:theme="@style/AppTheme"
Expand Down
5 changes: 5 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ apply from: '../config/android-common.gradle'
apply from: '../config/keystore.gradle'

android {
namespace 'net.openid.appauthdemo'
defaultConfig {
applicationId 'net.openid.appauthdemo'
project.archivesBaseName = 'appauth-demoapp'
Expand All @@ -30,6 +31,10 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
lintConfig = file("${projectDir}/lint.xml")
}

buildTypes {
debug {
signingConfig signingConfigs.debugAndRelease
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public final class ConnectionBuilderForTesting implements ConnectionBuilder {
private static final String HTTP = "http";
private static final String HTTPS = "https";

@SuppressLint("TrustAllX509TrustManager")
@SuppressLint({"TrustAllX509TrustManager", "CustomX509TrustManager"})
private static final TrustManager[] ANY_CERT_MANAGER = new TrustManager[] {
new X509TrustManager() {
public X509Certificate[] getAcceptedIssuers() {
Expand Down
6 changes: 6 additions & 0 deletions app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<lint>
<issue id="NotificationPermission">
<ignore regexp="com.bumptech.glide.request.target.NotificationTarget" />
</issue>
</lint>
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.android.tools.build:gradle:8.0.1'
classpath 'org.ajoberstar.grgit:grgit-gradle:4.1.1'
classpath 'org.jacoco:org.jacoco.core:0.8.7'
}
Expand All @@ -26,7 +26,7 @@ ext.verifyKeystore()
project.ext {
minSdkVersion = 16
compileSdkVersion = 33
versionID = "0.11.1"
versionID = "0.11.2"
versionName = """$versionID-skyscanner"""

try {
Expand Down
3 changes: 2 additions & 1 deletion config/android-common.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
android {
namespace 'net.openid.appauth'
compileSdkVersion rootProject.compileSdkVersion
defaultConfig {
minSdkVersion rootProject.minSdkVersion
Expand Down Expand Up @@ -41,7 +42,7 @@ task jar(type: Copy, dependsOn:'bundleRelease') {
// produces a JAR containing sources
task sourcesJar(type: Jar, dependsOn:'generateReleaseSources') {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
archiveClassifier = 'sources'
}

tasks.withType(JavaCompile) {
Expand Down
7 changes: 5 additions & 2 deletions config/coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@ android {
}
}
}
unitTestVariants.all {
it.mergedFlavor.manifestPlaceholders = ['appAuthRedirectScheme': 'net.openid.appauthdemo']
}
}

task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.enabled = true
html.enabled = true
xml.required.set(true)
html.required.set(true)
}
// Class R is used, but usage will not be covered, so ignore this class from report
afterEvaluate {
Expand Down
10 changes: 6 additions & 4 deletions config/javadoc.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ configurations {
}

dependencies {
mdDoclet 'org.jdrupes.mdoclet:doclet:2.0.0'
mdDoclet 'org.jdrupes.mdoclet:doclet:3.1.0'
}

task androidJavadoc(type: JavaExec) {
jvmArgs = ['--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED']
jvmArgs = ['--add-exports=jdk.javadoc/jdk.javadoc.internal.tool=ALL-UNNAMED',
'--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED']
classpath files(project.android.getBootClasspath())
main = 'jdk.javadoc.internal.tool.Main'
mainClass = 'jdk.javadoc.internal.tool.Main'
ext.destinationDir = file("${project.buildDir}/docs/javadoc")
args = ['-doctitle', "AppAuth for Android",
'-use',
Expand All @@ -22,10 +23,11 @@ task androidJavadoc(type: JavaExec) {
'-d', ext.destinationDir,
'-Xdoclint:none',
] + android.sourceSets.main.java.sourceFiles.files
mustRunAfter(':library:assembleRelease', ':library:assembleDebug')
}

task javadocJar(type: Jar, dependsOn: androidJavadoc) {
classifier = 'javadoc'
archiveClassifier = 'javadoc'
from androidJavadoc.ext.destinationDir
}

Expand Down
2 changes: 1 addition & 1 deletion config/style.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ task checkAllSource(type: Checkstyle) {
afterEvaluate {
source 'java'
include '**/*.java'
classpath = files project.configurations.compile.files
classpath = files()
}
}

Expand Down
6 changes: 3 additions & 3 deletions config/testdeps.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-core:3.10.0'
testImplementation 'org.robolectric:robolectric:4.5.1'
testImplementation 'org.robolectric:robolectric:4.9'
testImplementation 'org.assertj:assertj-core:3.19.0'
testImplementation 'androidx.test.ext:junit:1.1.3'
testImplementation 'androidx.test.ext:truth:1.3.0'
testImplementation 'androidx.test.ext:junit:1.1.5'
testImplementation 'androidx.test.ext:truth:1.5.0'
testImplementation 'com.google.truth:truth:1.1.3'
testImplementation 'xmlpull:xmlpull:1.1.3.1'
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Sat Jun 13 20:20:21 CEST 2020
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-all.zip
3 changes: 1 addition & 2 deletions library/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
* express or implied. See the License for the specific language governing permissions and
* limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="net.openid.appauth">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />

Expand Down
2 changes: 1 addition & 1 deletion library/gradle-maven-push.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def artifactoryURL = "https://artifactory.skyscannertools.net/artifactory/infras

task sourceJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier "source"
archiveClassifier = 'source'
}

afterEvaluate { project ->
Expand Down
5 changes: 2 additions & 3 deletions library/javatests/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@
* limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="net.openid.appauth">
xmlns:tools="http://schemas.android.com/tools">

<application>
<activity android:name=".RedirectUriReceiverActivity"
android:exported="true" tools:node="replace">
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import androidx.browser.customtabs.CustomTabsServiceConnection;
import androidx.browser.customtabs.CustomTabsSession;
import java.util.List;
import net.openid.appauth.BuildConfig;

import org.junit.After;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package net.openid.appauth.browser;

import net.openid.appauth.BuildConfig;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static org.assertj.core.api.Assertions.assertThat;

import net.openid.appauth.BuildConfig;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.RobolectricTestRunner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.util.Collections;
import java.util.HashSet;

import net.openid.appauth.BuildConfig;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import android.util.Log;

import net.openid.appauth.BuildConfig;

import org.junit.After;
import org.junit.Before;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
import android.os.Bundle;
import androidx.browser.customtabs.CustomTabsService;

import net.openid.appauth.BuildConfig;

import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand Down Expand Up @@ -66,7 +64,7 @@ public void testFormUrlEncode_withSpaceSeparatedValueForParameter() {
parameters.put("test2", "value2 value3");
String query = UriUtil.formUrlEncode(parameters);

assertThat(query.contains("value2+value3"));
assertThat(query).contains("value2+value3");
mSanitizer.parseQuery(query);
for (Map.Entry<String, String> param : parameters.entrySet()) {
assertThat(mSanitizer.getValue(param.getKey())).isEqualTo(param.getValue());
Expand Down
Loading