Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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 .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
- wait

- label: ":hammer_and_pick: Build and Test"
command: ./gradlew --stacktrace testRelease
command: ./gradlew --stacktrace testDebugUnitTest
plugins: [$CI_TOOLKIT_PLUGIN]
notify:
- github_commit_status:
Expand All @@ -36,7 +36,7 @@ steps:
context: Danger - PR Check

- label: ":microscope: Lint"
command: ./gradlew --stacktrace lintRelease
command: ./gradlew --stacktrace lintDebug
plugins: [$CI_TOOLKIT_PLUGIN]
notify:
- github_commit_status:
Expand Down
2 changes: 1 addition & 1 deletion .java-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
17.0
21.0
10 changes: 5 additions & 5 deletions PasscodeLock/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ plugins {

android {
namespace 'org.wordpress.passcodelock'
compileSdk 34
compileSdk 36

defaultConfig {
minSdk 23
Expand All @@ -28,14 +28,14 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.preference:preference:1.0.0'
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'androidx.preference:preference:1.2.1'
}

android.buildTypes.all { buildType ->
Expand Down
Empty file removed PasscodeLock/consumer-rules.pro
Empty file.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wordpress.passcodelock;

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
Expand All @@ -24,9 +25,11 @@ public abstract class AbstractPasscodeKeyboardActivity extends Activity {
protected InputFilter[] filters = null;
protected TextView topMessage = null;

@SuppressLint("RestrictedApi")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this to avoid linter complaining for now, but tracking separately here #1734

protected FingerprintManagerCompat mFingerprintManager;
protected CancellationSignal mCancel;

@SuppressLint("RestrictedApi")
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -36,21 +39,21 @@ protected void onCreate(Bundle savedInstanceState) {
}

setContentView(R.layout.app_passcode_keyboard);

topMessage = (TextView) findViewById(R.id.passcodelock_prompt);

Bundle extras = getIntent().getExtras();
if (extras != null) {
String message = extras.getString(KEY_MESSAGE);
if (message != null) {
topMessage.setText(message);
}
}

filters = new InputFilter[2];
filters[0]= new InputFilter.LengthFilter(1);
filters[1] = onlyNumber;

mPinCodeField = (EditText)findViewById(R.id.pin_field);

//setup the keyboard
Expand Down Expand Up @@ -158,8 +161,9 @@ public void run() {
protected void showPasswordError(){
Toast.makeText(AbstractPasscodeKeyboardActivity.this, R.string.passcode_wrong_passcode, Toast.LENGTH_SHORT).show();
}

protected abstract void onPinLockInserted();
@SuppressLint("RestrictedApi")
protected abstract FingerprintManagerCompat.AuthenticationCallback getFingerprintCallback();

private InputFilter onlyNumber = new InputFilter() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wordpress.passcodelock;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
Expand All @@ -23,7 +24,8 @@ protected void onCreate(Bundle savedInstanceState) {
}
}

@Override
@SuppressLint("RestrictedApi")
@Override
public void onResume() {
super.onResume();

Expand Down Expand Up @@ -73,13 +75,14 @@ protected void onPinLockInserted() {
type = PasscodePreferenceFragment.ENABLE_PASSLOCK;
} else {
authenticationFailed();
}
}
break;
default:
break;
}
}

@SuppressLint("RestrictedApi")
@Override
protected FingerprintManagerCompat.AuthenticationCallback getFingerprintCallback() {
return new FingerprintManagerCompat.AuthenticationCallback() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package org.wordpress.passcodelock;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.view.View;

import androidx.core.hardware.fingerprint.FingerprintManagerCompat;
import androidx.core.os.CancellationSignal;

public class PasscodeUnlockActivity extends AbstractPasscodeKeyboardActivity {
@SuppressLint("RestrictedApi")
@Override
public void onResume() {
super.onResume();
Expand Down Expand Up @@ -39,6 +41,7 @@ protected void onPinLockInserted() {
}
}

@SuppressLint("RestrictedApi")
@Override
protected FingerprintManagerCompat.AuthenticationCallback getFingerprintCallback() {
return new FingerprintManagerCompat.AuthenticationCallback() {
Expand All @@ -59,6 +62,7 @@ public void onAuthenticationFailed() {
};
}

@SuppressLint("RestrictedApi")
private boolean isFingerprintSupportedAndEnabled() {
return mFingerprintManager.isHardwareDetected() &&
mFingerprintManager.hasEnrolledFingerprints() &&
Expand Down
72 changes: 35 additions & 37 deletions Simplenote/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def versionProperties = loadPropertiesFromFile(file("${rootDir}/version.properti

android {
namespace 'com.automattic.simplenote'
compileSdk 34
compileSdk 36

buildTypes {
debug {
Expand Down Expand Up @@ -42,13 +42,8 @@ android {

minSdkVersion 23
targetSdkVersion 34

testInstrumentationRunner 'com.automattic.simplenote.SimplenoteAppRunner'
}

lintOptions {
checkReleaseBuilds false
}

testOptions {
unitTests.returnDefaultValues = true
Expand All @@ -59,16 +54,19 @@ android {

// Target Java8 to avoid use certain Kotlin's features
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
jvmTarget = JavaVersion.VERSION_11.toString()
}

viewBinding {
enabled = true
}
lint {
checkReleaseBuilds false
}
}

buildscript {
Expand All @@ -78,31 +76,31 @@ buildscript {

repositories {
google()
jcenter()
mavenCentral()
}
}

dependencies {
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:4.0.0'
testImplementation 'org.mockito:mockito-inline:4.0.0'
androidTestImplementation 'androidx.test:core:1.3.0'
androidTestImplementation 'androidx.annotation:annotation:1.0.0'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test:rules:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.1.0') {
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:5.18.0'
testImplementation 'org.mockito:mockito-inline:5.2.0'
androidTestImplementation 'androidx.test:core:1.7.0'
androidTestImplementation 'androidx.annotation:annotation:1.9.1'
androidTestImplementation 'androidx.test:runner:1.7.0'
androidTestImplementation 'androidx.test:rules:1.7.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.7.0'
androidTestImplementation('androidx.test.espresso:espresso-contrib:3.7.0') {
// Necessary to avoid version conflicts
exclude group: 'androidx', module: 'appcompat'
exclude group: 'androidx', module: 'support-v4'
exclude group: 'androidx', module: 'support-annotations'
exclude module: 'recyclerview-v7'
}
// Infrastructure to test fragments
testImplementation "androidx.arch.core:core-testing:2.1.0"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.4.3"
testImplementation "org.mockito.kotlin:mockito-kotlin:3.2.0"
testImplementation "androidx.arch.core:core-testing:2.2.0"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2"
testImplementation "org.mockito.kotlin:mockito-kotlin:6.0.0"


// Support for JsonObjects in unit tests since they are used by BucketObjects
Expand All @@ -116,32 +114,32 @@ dependencies {
implementation "com.automattic.tracks:crashlogging:$automatticTracksVersion"

// Kotlin's coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2'

// Google Support
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0-beta01'
implementation 'androidx.vectordrawable:vectordrawable:1.1.0'
implementation 'androidx.preference:preference:1.1.0'
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.vectordrawable:vectordrawable:1.2.0'
implementation 'androidx.preference:preference:1.2.1'
implementation 'androidx.legacy:legacy-preference-v14:1.0.0'
implementation 'androidx.work:work-runtime:2.7.1'
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
implementation "androidx.constraintlayout:constraintlayout:1.1.3"
implementation 'androidx.work:work-runtime:2.10.3'
implementation 'androidx.concurrent:concurrent-futures:1.3.0'
implementation "androidx.constraintlayout:constraintlayout:2.2.1"
implementation "androidx.multidex:multidex:2.0.1"
// Support for ViewModels and LiveData
implementation "androidx.activity:activity-ktx:1.3.1"
implementation "androidx.fragment:fragment-ktx:1.3.6"
implementation "androidx.activity:activity-ktx:1.10.1"
implementation "androidx.fragment:fragment-ktx:1.8.8"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$androidxLifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$androidxLifecycleVersion"
// Support for androidx Fragments
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$androidxLifecycleVersion"

// Google Play Services
implementation 'com.google.android.gms:play-services-wearable:17.0.0'
implementation 'com.google.android.gms:play-services-wearable:19.0.0'
// Third Party
implementation 'com.squareup.okhttp3:okhttp:3.12.0'
implementation 'com.squareup.okhttp3:okhttp:5.1.0'
implementation 'com.commonsware.cwac:anddown:0.4.0'
implementation 'net.openid:appauth:0.7.0'
implementation 'net.openid:appauth:0.11.1'

// Dagger Hilt dependencies
implementation "com.google.dagger:hilt-android:$google_dagger"
Expand All @@ -162,7 +160,7 @@ repositories {
}
maven { url "https://maven.google.com" }
maven { url "https://s3.amazonaws.com/repo.commonsware.com" }
jcenter()
mavenCentral()
maven {
url 'https://jitpack.io'
content {
Expand Down
13 changes: 7 additions & 6 deletions Simplenote/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@
</activity>

<activity
android:name=".NotesActivity"
android:name="com.automattic.simplenote.NotesActivity"
android:configChanges="screenSize|smallestScreenSize|orientation|screenLayout"
android:label="@string/app_launcher_name"
android:resizeableActivity="true"
android:exported="true"
android:windowSoftInputMode="adjustResize|stateHidden">
android:windowSoftInputMode="adjustResize|stateHidden"
android:theme="@style/Theme.Simplestyle">

<intent-filter>

Expand Down Expand Up @@ -85,7 +86,7 @@

<data
android:host="app.simplenote.com"
android:pathPattern="/account/.*/reset?redirect=simplenote://launch"
android:pathPattern="/account/.*/reset"
android:scheme="https">
</data>

Expand Down Expand Up @@ -121,7 +122,7 @@
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="app.simplenote.com"
android:pathPattern="/account/.*/reset?redirect=simplenote://launch"
android:pathPattern="/account/.*/reset"
android:scheme="https">
</data>
</intent-filter>
Expand Down Expand Up @@ -180,11 +181,11 @@
<activity
android:name="com.automattic.simplenote.StyleActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:parentActivityName=".PreferencesActivity"></activity>
android:parentActivityName=".PreferencesActivity" />

<activity
android:name="com.automattic.simplenote.TagsActivity"
android:configChanges="orientation|keyboardHidden|screenSize"></activity>
android:configChanges="orientation|keyboardHidden|screenSize" />

<activity
android:name="com.automattic.simplenote.DeepLinkActivity"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ class DeepLinkActivity : AppCompatActivity() {
startActivity(intent)
}
VERIFIED_WEB_SCHEME -> {
// New MagicLink
startMagicLinkConfirmation(uri)
// Check if this is a password reset URL
if (uri.path?.contains("/account/") == true && uri.path?.contains("/reset") == true) {
// launch the app if they tapped on a password reset link on app.simplenote.com
handlePasswordReset()
} else {
// New MagicLink
startMagicLinkConfirmation(uri)
}
}
LOGIN_SCHEME -> {
if (queryParamContainsData(uri.query, USERNAME_KEY_QUERY) && queryParamContainsData(uri.query, AUTH_CODE_QUERY)) {
Expand Down Expand Up @@ -88,6 +94,12 @@ class DeepLinkActivity : AppCompatActivity() {
}
}

private fun handlePasswordReset() {
val intent = IntentUtils.maybeAliasedIntent(applicationContext)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK or Intent.FLAG_ACTIVITY_NEW_TASK)
startActivity(intent)
}

private fun queryParamContainsData(path: String?, otherString: String) : Boolean = path?.contains(otherString, true) == true


Expand Down
Loading