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

413-smartphone-as-a-container #419

Open
wants to merge 296 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
296 commits
Select commit Hold shift + click to select a range
771fb44
fixed based on the tests
frankmer Sep 18, 2024
403e9ab
l10n
frankmer Sep 20, 2024
e7254fe
workflow flutter version
frankmer Sep 20, 2024
dffb58e
fix ecc utils
frankmer Sep 20, 2024
4b28685
implementd _getCurrentMethodName to prevent worng method names in log…
frankmer Sep 23, 2024
dfed2e5
container handleProcessorResult
frankmer Sep 23, 2024
76b2f87
refactoring
frankmer Sep 24, 2024
965937b
drag down to sync container
frankmer Sep 26, 2024
7cec7a8
container
frankmer Sep 26, 2024
ce1eb58
Merge branch 'edit-push-request-dialog' into 413-smartphone-as-a-cont…
frankmer Sep 26, 2024
24d84e4
Merge branch 'master' into 413-smartphone-as-a-container
frankmer Sep 27, 2024
eb44153
monochrome icon
frankmer Sep 27, 2024
6706d46
monochrome icon
frankmer Sep 27, 2024
99e2202
Appearance
frankmer Sep 27, 2024
44b1f80
fix sync container push token
frankmer Sep 27, 2024
00c1172
fix all imports
frankmer Sep 27, 2024
eb0a21d
ui improvments
frankmer Oct 1, 2024
1d2ab18
bug fixes
frankmer Oct 2, 2024
391c17b
token containers
frankmer Oct 7, 2024
1170b0c
containers
frankmer Oct 7, 2024
38841f4
fix issue in home widget
frankmer Oct 7, 2024
6282e22
refactor token folder for new backdound
frankmer Oct 8, 2024
c80bd05
show container status message only when syncing manually
frankmer Oct 8, 2024
673d78b
Refactor token folder for new background
frankmer Oct 11, 2024
cde3231
added container delete action
frankmer Oct 11, 2024
4a13acc
Refactor Mutex in secure repos
frankmer Oct 11, 2024
01c6a5f
added translations
frankmer Oct 11, 2024
f7745e4
improved container rollout/sync error handling
frankmer Oct 11, 2024
0e9785f
fixed filtered main view tokens list
frankmer Oct 14, 2024
082f0bc
added container action dialogs
frankmer Oct 15, 2024
de819ae
cleaning up
frankmer Oct 15, 2024
58170f4
sync icons
frankmer Oct 15, 2024
5a3afc1
cleaning up
frankmer Oct 15, 2024
c5d5746
visual optimizations
frankmer Oct 15, 2024
32b4394
fixed tests
frankmer Oct 15, 2024
a4576c8
edit tests java version
frankmer Oct 16, 2024
4ba19d5
edit workflow
frankmer Oct 16, 2024
3a2a899
l10n fixes
frankmer Oct 16, 2024
d5d0db3
Moved ContainerTokenSyncIcon to the issuer
frankmer Oct 17, 2024
1838e57
replace existing container
frankmer Oct 18, 2024
c5683a0
l10n added indonesian
frankmer Oct 18, 2024
224ebb7
edited l10n
frankmer Oct 21, 2024
e5758c3
l10n edits
frankmer Oct 22, 2024
83894d4
added Container transfer
frankmer Oct 24, 2024
31fc935
edits for new endpoint
frankmer Oct 24, 2024
bcd999d
fixing minor issues
frankmer Oct 25, 2024
71fd9b0
Cleaned up dependencies
frankmer Oct 25, 2024
4500fbd
Cleaned up dependencies
frankmer Oct 28, 2024
034b7e3
changes for customizer
frankmer Oct 28, 2024
2344f96
changes for customizer
frankmer Oct 28, 2024
110c63e
removed unused device_id
frankmer Oct 28, 2024
3e05325
Added buildXFile to ImageFileType extension
frankmer Nov 1, 2024
c30c8b1
Add fileName getter to ImageFileType extension and enhance WidgetImag…
frankmer Nov 1, 2024
b00ad2c
Enhance ApplicationCustomization with equality and hashCode overrides…
frankmer Nov 4, 2024
3c09afc
Added SendDeviceInfosDialog
frankmer Nov 6, 2024
cd8ea63
Add confirmation dialog for deleting container and associated tokens
frankmer Nov 6, 2024
35bfc39
Merge branch 'master' into 413-smartphone-as-a-container
frankmer Nov 8, 2024
cffe36b
Add export color customization and refactor container dialog handling
frankmer Nov 11, 2024
4c96ec0
Merge branch 'master' into 413-smartphone-as-a-container
frankmer Nov 11, 2024
37fc863
l10n
frankmer Nov 11, 2024
17d4ca0
Refactor deep link listeners to include WidgetRef in onNewState callb…
frankmer Nov 11, 2024
d036c07
implemented container policies
frankmer Nov 14, 2024
3ee25ff
fixed test
frankmer Nov 14, 2024
6cd9939
fixed api for sync policies
frankmer Nov 15, 2024
564afd4
fix sign devide brand and model
frankmer Nov 15, 2024
db38302
added container policies on finalization
frankmer Nov 15, 2024
21eb0ec
uncomment syncTokens call in TokenContainerNotifier
frankmer Nov 15, 2024
fc5c3e6
fix
frankmer Nov 15, 2024
7242c32
unregister container on delete
frankmer Nov 18, 2024
a21680e
l10n
frankmer Nov 18, 2024
f5d51ee
l10n
frankmer Nov 18, 2024
92ac10d
tests
frankmer Nov 18, 2024
9a9961c
tests
frankmer Nov 21, 2024
19cd146
customizer edits
frankmer Nov 21, 2024
49b686a
Add additional error codes to ResponseBuilder extension
frankmer Nov 21, 2024
b25f95c
customizer edits
frankmer Nov 21, 2024
3f85a91
Refactor PiMailer to accept dynamic mail recipients and update feedba…
frankmer Nov 22, 2024
94b7d66
Enhance ApplicationCustomization to include dynamic subject prefixes …
frankmer Nov 22, 2024
f261f9d
Remove default crash report recipient and related identifier
frankmer Nov 22, 2024
dcc4a98
Refactor ApplicationCustomization to use private subject prefix varia…
frankmer Nov 22, 2024
2717d8d
Refactor ApplicationCustomization to use raw subject prefix variables…
frankmer Nov 22, 2024
fc6dfba
refactoring
frankmer Jul 16, 2024
3ab05c0
refactoring
frankmer Jul 16, 2024
aed963e
smartphone as a container
frankmer Jul 17, 2024
b7b3bf7
smartphone as a container
frankmer Jul 18, 2024
ea73f14
smartphone as a container
frankmer Jul 19, 2024
4da39eb
smartphone as a container
frankmer Jul 22, 2024
ae6c986
smartphone as a container
frankmer Jul 23, 2024
37e4cd4
smartphone as a container
frankmer Jul 25, 2024
b3f7ca9
smartphone as a container
frankmer Jul 26, 2024
f175f4a
smartphone as a container
frankmer Jul 29, 2024
ea72a1a
token as a container
frankmer Jul 30, 2024
ecab94d
token as a container
frankmer Jul 30, 2024
72c8dd8
token as a container
frankmer Jul 31, 2024
4dc78a6
fixed tests
frankmer Aug 1, 2024
55fd7af
.
frankmer Aug 1, 2024
e9bb860
refactoring
frankmer Aug 5, 2024
9a23e44
refactoring
frankmer Aug 5, 2024
1227b0d
added licenses
frankmer Aug 5, 2024
69acc55
refactoring
frankmer Aug 5, 2024
8c1a91e
refactoring
frankmer Aug 6, 2024
f4f88f8
refactoring
frankmer Aug 7, 2024
8630d26
refactoring
frankmer Aug 7, 2024
c7b3d22
refactoring
frankmer Aug 7, 2024
4d98e69
refactoring
frankmer Aug 8, 2024
ccbf8c6
refactoring
frankmer Aug 8, 2024
f6f7665
refactoring
frankmer Aug 8, 2024
7eb83a4
merge error
frankmer Aug 21, 2024
9bd7aa5
merge error
frankmer Aug 21, 2024
a06838b
refactoring
frankmer Aug 23, 2024
5b0873f
finalize container
frankmer Aug 26, 2024
bc019b5
container finalization
frankmer Aug 28, 2024
71e29c0
refactoring
frankmer Sep 5, 2024
09f7e27
refactoring
frankmer Sep 5, 2024
95c3883
container sync works now
frankmer Sep 13, 2024
6842c2a
sync fixes
frankmer Sep 13, 2024
841d335
fix all imports
frankmer Sep 13, 2024
c1e7b55
rollout push token fix
frankmer Sep 13, 2024
20e9dda
fixed import error
frankmer Sep 16, 2024
958370c
error handling while sync container
frankmer Sep 16, 2024
e86a94c
token container
frankmer Sep 16, 2024
c6df23b
fixed based on the tests
frankmer Sep 17, 2024
e487bb1
fixed issues based on the tests
frankmer Sep 18, 2024
9c5f0af
fixed based on the tests
frankmer Sep 18, 2024
2784c7a
l10n
frankmer Sep 20, 2024
1ad7bbf
fix ecc utils
frankmer Sep 20, 2024
1dcc177
implementd _getCurrentMethodName to prevent worng method names in log…
frankmer Sep 23, 2024
389d8ef
container handleProcessorResult
frankmer Sep 23, 2024
8c27ec1
refactoring
frankmer Sep 24, 2024
722141c
drag down to sync container
frankmer Sep 26, 2024
0878203
container
frankmer Sep 26, 2024
d1b42e8
monochrome icon
frankmer Sep 27, 2024
35b36d2
monochrome icon
frankmer Sep 27, 2024
331b1ce
Appearance
frankmer Sep 27, 2024
0ad0421
fix sync container push token
frankmer Sep 27, 2024
2588ab3
fix all imports
frankmer Sep 27, 2024
aecf13a
ui improvments
frankmer Oct 1, 2024
ce6a079
bug fixes
frankmer Oct 2, 2024
6edfd6e
token containers
frankmer Oct 7, 2024
3db336f
containers
frankmer Oct 7, 2024
40baa77
fix issue in home widget
frankmer Oct 7, 2024
2fdec16
refactor token folder for new backdound
frankmer Oct 8, 2024
ca26b47
show container status message only when syncing manually
frankmer Oct 8, 2024
d3738c2
Refactor token folder for new background
frankmer Oct 11, 2024
98aaa45
added container delete action
frankmer Oct 11, 2024
c286033
Refactor Mutex in secure repos
frankmer Oct 11, 2024
eff2568
added translations
frankmer Oct 11, 2024
1d30ba2
improved container rollout/sync error handling
frankmer Oct 11, 2024
875de17
fixed filtered main view tokens list
frankmer Oct 14, 2024
633cea7
added container action dialogs
frankmer Oct 15, 2024
92f6e5d
cleaning up
frankmer Oct 15, 2024
2dc703b
sync icons
frankmer Oct 15, 2024
4174564
cleaning up
frankmer Oct 15, 2024
67a235e
visual optimizations
frankmer Oct 15, 2024
9a772e5
fixed tests
frankmer Oct 15, 2024
2d62184
edit tests java version
frankmer Oct 16, 2024
9d3cb39
edit workflow
frankmer Oct 16, 2024
fc57e73
l10n fixes
frankmer Oct 16, 2024
cc9a384
Moved ContainerTokenSyncIcon to the issuer
frankmer Oct 17, 2024
f9a9f89
replace existing container
frankmer Oct 18, 2024
cce294c
l10n added indonesian
frankmer Oct 18, 2024
c434af2
edited l10n
frankmer Oct 21, 2024
18b2414
l10n edits
frankmer Oct 22, 2024
be42007
added Container transfer
frankmer Oct 24, 2024
693cdb6
edits for new endpoint
frankmer Oct 24, 2024
ed7ad4b
fixing minor issues
frankmer Oct 25, 2024
5cf1b22
Cleaned up dependencies
frankmer Oct 25, 2024
3700827
Cleaned up dependencies
frankmer Oct 28, 2024
acafd03
changes for customizer
frankmer Oct 28, 2024
e650d98
changes for customizer
frankmer Oct 28, 2024
2977723
removed unused device_id
frankmer Oct 28, 2024
8e2799a
Added buildXFile to ImageFileType extension
frankmer Nov 1, 2024
8dfcbd3
Add fileName getter to ImageFileType extension and enhance WidgetImag…
frankmer Nov 1, 2024
87b833b
Enhance ApplicationCustomization with equality and hashCode overrides…
frankmer Nov 4, 2024
fd7a09a
Added SendDeviceInfosDialog
frankmer Nov 6, 2024
0877777
Add confirmation dialog for deleting container and associated tokens
frankmer Nov 6, 2024
4dc24e4
Add export color customization and refactor container dialog handling
frankmer Nov 11, 2024
12dea03
l10n
frankmer Nov 11, 2024
4f53e11
Refactor deep link listeners to include WidgetRef in onNewState callb…
frankmer Nov 11, 2024
92b7394
implemented container policies
frankmer Nov 14, 2024
8a6ab8e
fixed test
frankmer Nov 14, 2024
a09199f
fixed api for sync policies
frankmer Nov 15, 2024
7a75a7a
fix sign devide brand and model
frankmer Nov 15, 2024
bc18348
added container policies on finalization
frankmer Nov 15, 2024
ad32e89
uncomment syncTokens call in TokenContainerNotifier
frankmer Nov 15, 2024
a9ef234
fix
frankmer Nov 15, 2024
6dce597
unregister container on delete
frankmer Nov 18, 2024
c2fa776
l10n
frankmer Nov 18, 2024
3c5fb7a
l10n
frankmer Nov 18, 2024
0405714
tests
frankmer Nov 18, 2024
8d5a3f1
tests
frankmer Nov 21, 2024
0afde09
customizer edits
frankmer Nov 21, 2024
75f8dda
Add additional error codes to ResponseBuilder extension
frankmer Nov 21, 2024
9a18503
customizer edits
frankmer Nov 21, 2024
815cafd
Refactor PiMailer to accept dynamic mail recipients and update feedba…
frankmer Nov 22, 2024
43e4c62
Enhance ApplicationCustomization to include dynamic subject prefixes …
frankmer Nov 22, 2024
c76bff3
Remove default crash report recipient and related identifier
frankmer Nov 22, 2024
db7abbb
Refactor ApplicationCustomization to use private subject prefix varia…
frankmer Nov 22, 2024
bdeb4b4
Refactor ApplicationCustomization to use raw subject prefix variables…
frankmer Nov 22, 2024
c892018
Merge branch '413-smartphone-as-a-container' of https://github.com/pr…
frankmer Nov 26, 2024
a663449
Update Indonesian localization strings and remove unused imports
frankmer Nov 26, 2024
6bb63d2
Refactor widget semantics for improved accessibility and update toolt…
frankmer Nov 26, 2024
4060318
Enhance application customization tests
frankmer Nov 26, 2024
bb9affd
Merge branch 'master' into 413-smartphone-as-a-container
frankmer Nov 26, 2024
df39af3
Do not update fb token when delete pull only token
frankmer Nov 26, 2024
0a8309f
Bump version to 4.5.0+405001 in pubspec.yaml
frankmer Nov 27, 2024
496d141
Refactor WidgetImage constructor to require fileName and update toStr…
frankmer Nov 27, 2024
44201af
Translate accessibility button labels to French
frankmer Nov 27, 2024
5127ef4
Rename ImageFileType enum to ImageFormat and update related reference…
frankmer Nov 28, 2024
0041a7f
Refactor CooldownButton, added support for textButton style
frankmer Nov 28, 2024
bcb83d7
Fix text order in request info and add spacing in decline confirm dialog
frankmer Nov 28, 2024
cc1d4a6
Add spacing in decline confirm dialog for improved layout
frankmer Nov 28, 2024
34ccbe7
Refactor application customization to support optional background and…
frankmer Nov 28, 2024
d60e4b9
Rename fileType to imageFormat in WidgetImage and related classes; up…
frankmer Nov 28, 2024
68e7db6
Refactor snackbar utility functions for improved duration
frankmer Nov 29, 2024
c02aa4f
Merge branch '413-smartphone-as-a-container' of https://github.com/pr…
frankmer Nov 29, 2024
96c3995
Update pubspec.yaml to reorganize dependencies and remove duplicates
frankmer Nov 29, 2024
1d701b5
Remove unused asset paths from pubspec.yaml
frankmer Nov 29, 2024
b3fd3d6
Update version number in pubspec.yaml to 4.5.0+405003 and clean up as…
frankmer Nov 29, 2024
c480779
Refactor ApplicationCustomizer provider to introduce initial state ma…
frankmer Nov 29, 2024
b400ab3
Enhance MainViewTokensList to improve sorting and filtering logic
frankmer Dec 3, 2024
9376f43
Enhance token filtering logic for the TokensList views
frankmer Dec 4, 2024
83d2d91
Refactor application customization tests to update property names for…
frankmer Dec 4, 2024
1dd5861
Moved the constant_identifiers to the corresponding token class.
frankmer Dec 6, 2024
6783cda
Added missing imports
frankmer Dec 6, 2024
98ab966
Moved the constant_identifiers to the corresponding class.
frankmer Dec 6, 2024
4a9621c
fixed PushToken TTL_MINUTES validation
frankmer Dec 9, 2024
be601cc
fixed TTL_MINUTES validation
frankmer Dec 9, 2024
80e40aa
fixed TTL_MINUTES handling
frankmer Dec 9, 2024
6f60bd6
added handling for not linked token templates with serial in PiContai…
frankmer Dec 9, 2024
8d6180b
removed TTL_MINUTES handling from PushToken class
frankmer Dec 9, 2024
5e7b3a5
refactor: update duration validators and improve expiration date hand…
frankmer Dec 9, 2024
f58e74d
Some localizations have been refactored to use local context instead …
frankmer Dec 13, 2024
0e62a6b
rename TYPE constant and added some tests
frankmer Dec 17, 2024
8bca5b7
rename TYPE constant to OTPAUTH_TYPE and update related references
frankmer Dec 18, 2024
d2a87ef
Added tests for container api
frankmer Dec 18, 2024
e8dc042
fixes tests
frankmer Dec 18, 2024
17d2f2f
Refactor error handling in PiContainerApi and improve UI responsivene…
frankmer Dec 18, 2024
34a224c
Fix unregister container result handling in PiContainerApi
frankmer Dec 19, 2024
985d301
Fix translation for rolloutStateSendingPublicKeyCompleted in English …
frankmer Dec 19, 2024
0f47c0b
Refactor isSameTokenAs method for improved clarity and consistency ac…
frankmer Dec 19, 2024
681d86c
Update token hash values and improve isSameTokenAs method logic for b…
frankmer Dec 19, 2024
c656322
fixed tests
frankmer Dec 19, 2024
28b8cae
Rename image_file_type_extension to image_format_extension and update…
frankmer Dec 19, 2024
790dbe1
Fix async group declaration in token_container_notifier_test
frankmer Jan 6, 2025
c217a80
Add authToDiscardPushRequest localization
frankmer Jan 6, 2025
3431c16
Remove commented-out code and unnecessary imports from PushRequestNot…
frankmer Jan 6, 2025
a4a2b28
Update Gradle and dependencies;
frankmer Jan 7, 2025
9abb640
Workaround for an issue with ColorFiltered.
frankmer Jan 7, 2025
231a6aa
Enables to sync by dragging with with a finalized container but no token
frankmer Jan 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
24 changes: 14 additions & 10 deletions .github/workflows/flutter_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,23 @@ jobs:
# matrix job fails.
fail-fast: false
matrix:
api-level: [21,31] # [minSdk, most used, newest (30 is not working :(] 19 would be minSDK but does not support x86_64
api-level: [21,31,34] # [minSdk, most used, newest (30 is not working :(] 19 would be minSDK but does not support x86_64
target: [default] # [default, google_apis]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
java-version: '17.0.11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.24.3'
- run: "flutter --version"
- run: "flutter pub get"
- run: "flutter build ios -t 'lib/mains/main_netknights.dart' --debug --flavor netknights --no-codesign"
- run: 'flutter --version'
- run: 'flutter doctor -v'
- run: 'flutter pub get'
- run: 'flutter gen-l10n'
- run: 'flutter build ios -t "lib/mains/main_netknights.dart" --debug --flavor netknights --no-codesign'

build_appbundle:
name: (Android)
Expand All @@ -47,13 +49,15 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'oracle'
java-version: '17'
distribution: 'zulu'
java-version: '17.0.11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.24.3'
- run: 'flutter clean'
- run: "flutter --version"
- run: "flutter pub get"
- run: "flutter build apk -t 'lib/mains/main_netknights.dart' --debug --flavor netknights"
- run: 'flutter --version'
- run: 'flutter doctor -v'
- run: 'flutter pub get'
- run: 'flutter gen-l10n'
- run: 'flutter build apk -t "lib/mains/main_netknights.dart" --debug --flavor netknights'
11 changes: 6 additions & 5 deletions .github/workflows/flutter_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '17.0.7'
java-version: '17.0.11'
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: '3.24.3'
- run: "flutter --version"
- run: flutter pub get
- run: flutter gen-l10n
- run: flutter test
- run: 'flutter --version'
- run: 'flutter doctor -v'
- run: 'flutter pub get'
- run: 'flutter gen-l10n'
- run: 'flutter test'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -896,3 +896,4 @@ ios/Flutter/flutter_export_environment.sh
*firebase_options.dart
!default_firebase_options.dart
firebase.json
lib/l10n/app_localizations*
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
analyzer:
errors:
constant_identifier_names: ignore
include: package:flutter_lints/flutter.yaml

linter:
Expand Down
26 changes: 20 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ plugins {
id "dev.flutter.flutter-gradle-plugin"
}



dependencies {
// Add this [coreLibraryDesugaring] inside [dependencies]
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.4'// use compatible version e.g 2.1.4
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
Expand Down Expand Up @@ -40,17 +47,24 @@ if (keystorePropertiesFileNetknightsDebug.exists()) {


android {
compileSdkVersion 34
namespace 'it.netknights.piauthenticator'

compileSdkVersion 35

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

defaultConfig {
applicationId "it.netknights.piauthenticator"
minSdkVersion 21
targetSdkVersion 34
minSdkVersion 21
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
manifestPlaceholders = [applicationName: "io.flutter.app.FlutterApplication"]
Expand All @@ -62,7 +76,7 @@ android {
storePassword keystorePropertiesNetknights['storePassword']
keyAlias keystorePropertiesNetknights['keyAlias']
keyPassword keystorePropertiesNetknights['keyPassword']
}
}
netknights_debug {
storeFile keystorePropertiesNetknightsDebug['storeFile'] ? file(keystorePropertiesNetknightsDebug['storeFile']) : null
storePassword keystorePropertiesNetknightsDebug['storePassword']
Expand All @@ -72,7 +86,7 @@ android {
}

flavorDimensions "pi-authenticator"

productFlavors {
netknights{
dimension "pi-authenticator"
Expand All @@ -87,7 +101,7 @@ android {
signingConfig signingConfigs.netknights_debug
}
}

buildTypes {
release {
// Enables code shrinking, obfuscation, and optimization for only
Expand Down
12 changes: 5 additions & 7 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="it.netknights.piauthenticator">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
Expand All @@ -11,12 +10,12 @@
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<!-- To read all files until API level 32 -->
<uses-permission
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="32" />

<!-- To write all files until API level 29. We will MediaStore from API level 30 -->
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="28" />


Expand Down Expand Up @@ -63,7 +62,7 @@
<!-- <meta-data
android:name="io.flutter.embedding.android.SplashScreenDrawable"
android:resource="@drawable/launch_background" /> -->

<!-- This is used for the home screen widget -->
<intent-filter>
<action android:name="es.antonborri.home_widget.action.LAUNCH" />
Expand Down Expand Up @@ -93,7 +92,7 @@
android:name="es.antonborri.home_widget.HomeWidgetBackgroundService"
android:permission="android.permission.BIND_JOB_SERVICE"
android:exported="true"/>


<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
Expand All @@ -108,4 +107,3 @@
</intent>
</queries>
</manifest>

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AppWidgetProvider : HomeWidgetProvider() {
nightModeSuffix = if(currentThemeMode == "dark") "_dark" else "_light"
}
println("nightModeSuffix: $nightModeSuffix")

var editor = widgetData.edit()
editor.putString("_widgetIds", appWidgetIds.joinToString(","))
widgetData.getString("_copyText", null)?.let {
Expand All @@ -46,7 +46,7 @@ class AppWidgetProvider : HomeWidgetProvider() {
editor.remove("_rebuildingWidgetIds")
var rebuildingWidgetIds: IntArray
if(rebuildingIds == null || rebuildingIds.isEmpty()) {
rebuildingWidgetIds = appWidgetIds
rebuildingWidgetIds = appWidgetIds
} else {
rebuildingWidgetIds = rebuildingIds?.split(",")?.map { it.toInt() }?.toIntArray() ?: intArrayOf()
}
Expand All @@ -55,7 +55,7 @@ class AppWidgetProvider : HomeWidgetProvider() {
rebuildingWidgetIds.forEach { widgetId ->
val views = RemoteViews(context.packageName, R.layout.widget_layout).apply {
val tokenId = widgetData.getString("_tokenId$widgetId", null)

// _loadImageFromWidgetDataString(widgetData, "_tokenBackground$nightModeSuffix", R.id.widget_background, this)
_setBackground(context, widgetData, widgetId, nightModeSuffix, this)
if(tokenId == null) {
Expand Down Expand Up @@ -93,10 +93,12 @@ class AppWidgetProvider : HomeWidgetProvider() {
}
fun _setSettingsIcon(context: Context, widgetData: SharedPreferences, widgetId: Int, nightModeSuffix: String, remoteViews: RemoteViews) {
_loadImageFromWidgetDataString(widgetData, "_settingsIcon$nightModeSuffix", R.id.widget_settings, remoteViews)
val pendingIntent = HomeWidgetLaunchIntent.getActivity(context,
val pendingIntent = HomeWidgetLaunchIntent.getActivity(
context,
MainActivity::class.java,
Uri.parse("homewidgetnavigate://link?id=$widgetId"))
remoteViews.setOnClickPendingIntent(R.id.widget_settings, pendingIntent)
Uri.parse("homewidgetnavigate://link?id=$widgetId")
)
remoteViews.setOnClickPendingIntent(R.id.widget_settings, pendingIntent)
}
fun _setActionIcon(context: Context, widgetData: SharedPreferences, widgetId: Int, nightModeSuffix: String, remoteViews: RemoteViews, showToken: Boolean) {
println("getString: _tokenType$widgetId")
Expand All @@ -120,21 +122,27 @@ class AppWidgetProvider : HomeWidgetProvider() {
_loadImageFromWidgetDataString(widgetData, "_tokenOtp${widgetId}_hidden$nightModeSuffix", R.id.widget_otp, remoteViews)
println("tokenLocked: $tokenLocked")
if(tokenLocked) {
val pendingIntent = HomeWidgetLaunchIntent.getActivity(context,
val pendingIntent = HomeWidgetLaunchIntent.getActivity(
context,
MainActivity::class.java,
Uri.parse("homewidgetnavigate://showlocked?id=$widgetId"))
Uri.parse("homewidgetnavigate://showlocked?id=$widgetId")
)
remoteViews.setOnClickPendingIntent(R.id.widget_otp, pendingIntent)
} else {
val backgroundIntent = HomeWidgetBackgroundIntent.getBroadcast(context,
Uri.parse("homewidget://show?widgetId=$widgetId"))
val backgroundIntent = HomeWidgetBackgroundIntent.getBroadcast(
context,
Uri.parse("homewidget://show?widgetId=$widgetId")
)
remoteViews.setOnClickPendingIntent(R.id.widget_otp, backgroundIntent)}
}

fun _setTokenOtp(context: Context, widgetData: SharedPreferences, widgetId: Int, nightModeSuffix: String, remoteViews: RemoteViews) {
_loadImageFromWidgetDataString(widgetData, "_tokenOtp$widgetId$nightModeSuffix", R.id.widget_otp, remoteViews)
// Otp is visible, so the user can copy it to the clipboard with the next click
val clipIntent = HomeWidgetBackgroundIntent.getBroadcast(context,
Uri.parse("homewidget://copy?widgetId=$widgetId"))
val clipIntent = HomeWidgetBackgroundIntent.getBroadcast(
context,
Uri.parse("homewidget://copy?widgetId=$widgetId")
)
remoteViews.setOnClickPendingIntent(R.id.widget_otp, clipIntent)
}

Expand All @@ -145,35 +153,38 @@ class AppWidgetProvider : HomeWidgetProvider() {
}

fun _setContainerEmpty(context: Context, widgetData: SharedPreferences, widgetId: Int, nightModeSuffix: String, remoteViews: RemoteViews) {
// No token yet, so the user has to select one
val pendingIntent = HomeWidgetLaunchIntent.getActivity(
context,
MainActivity::class.java,
Uri.parse("homewidgetnavigate://link?id=$widgetId")
)
remoteViews.setOnClickPendingIntent(R.id.widget_background, pendingIntent)
remoteViews.setOnClickPendingIntent(R.id.widget_otp, pendingIntent)
_loadImageFromWidgetDataString(widgetData, "_tokenContainerEmpty$nightModeSuffix", R.id.widget_otp, remoteViews)
remoteViews.setImageViewBitmap(R.id.widget_settings, null);
remoteViews.setImageViewBitmap(R.id.widget_action, null);
// No token yet, so the user has to select one
val pendingIntent = HomeWidgetLaunchIntent.getActivity(context,
MainActivity::class.java,
Uri.parse("homewidgetnavigate://link?id=$widgetId"))
remoteViews.setOnClickPendingIntent(R.id.widget_background, pendingIntent)
}



fun _loadImageFromWidgetDataString(widgetData: SharedPreferences, key: String, xmlElement: Int, view: RemoteViews): Boolean {

println("Try to load image from key: $key")
val imagePath = widgetData.getString("$key", null)
if(imagePath == null) {
println("imagePath is null")
view.setImageViewBitmap(xmlElement, null)
return false
}
}

val imageFile = File(imagePath)
val imageExists = imageFile.exists()
if (imageExists && imageFile.absolutePath == null) {
println("image not found!, looked @: $imagePath")
return false
}

println("imagePath is $imagePath")
try {
val myBitmap: Bitmap = BitmapFactory.decodeFile(imageFile.absolutePath)
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 10 additions & 1 deletion android/app/src/netknights/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
<foreground>
<inset
android:drawable="@drawable/ic_launcher_foreground"
android:inset="16%" />
</foreground>
<monochrome>
<inset
android:drawable="@drawable/ic_launcher_monochrome"
android:inset="16%" />
</monochrome>
</adaptive-icon>
Loading
Loading