Compare commits
	
		
			23 Commits
		
	
	
		
			v1.11-r0
			...
			update-lib
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | 830494851d | ||
|   | 6e30dd35ee | ||
|   | dad9b0e53f | ||
|   | b2b0b8ddc9 | ||
|   | 9494f28acf | ||
|   | a98cd33cff | ||
|   | 65092dcccf | ||
|   | e464c59796 | ||
|   | 7dcccf1105 | ||
|   | 8d354bb3f0 | ||
|   | 5882263ee8 | ||
|   | 38e305bb4a | ||
|   | 177b1fc9a3 | ||
|   | 8bde5ed262 | ||
|   | 247b37262d | ||
|   | 84230b32ef | ||
|   | a54444e919 | ||
|   | 4b55e2ce8b | ||
|   | 5ae718c58e | ||
|   | 669022ddf0 | ||
|   | f0fd21a6ec | ||
|   | 73a8ec27d4 | ||
|   | 51902c9bc4 | 
							
								
								
									
										67
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										67
									
								
								.github/workflows/build.yml
									
									
									
									
										vendored
									
									
								
							| @@ -1,6 +1,10 @@ | ||||
| name: Build keepass2android app | ||||
|  | ||||
| on: [push, pull_request] | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main | ||||
|   pull_request: | ||||
|  | ||||
| jobs: | ||||
|   # macos: | ||||
| @@ -10,16 +14,15 @@ jobs: | ||||
|   #   runs-on: macos-12 | ||||
|  | ||||
|   #   steps: | ||||
|   #   - uses: actions/checkout@v3 | ||||
|  | ||||
|   #   - name: Fetch submodules | ||||
|   #     run: git submodule init && git submodule update | ||||
|   #   - uses: actions/checkout@v4 | ||||
|   #     with: | ||||
|   #       submodules: true | ||||
|  | ||||
|   #   - name: Setup Gradle | ||||
|   #     uses: gradle/gradle-build-action@v2 | ||||
|   #     uses: gradle/actions/setup-gradle@v3 | ||||
|  | ||||
|   #   - name: Cache NuGet packages | ||||
|   #     uses: actions/cache@v3 | ||||
|   #     uses: actions/cache@v4 | ||||
|   #     with: | ||||
|   #       path: ~/.nuget/packages | ||||
|   #       key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/packages.config') }} | ||||
| @@ -52,7 +55,7 @@ jobs: | ||||
|   #       # $VM_ASSETS/select-xamarin-sdk-v2.sh --mono=6.12 --android=11.2 | ||||
|  | ||||
|   #   - name: Switch to JDK-11 | ||||
|   #     uses: actions/setup-java@v3 | ||||
|   #     uses: actions/setup-java@v4 | ||||
|   #     with: | ||||
|   #       java-version: '11' | ||||
|   #       distribution: 'temurin' | ||||
| @@ -82,7 +85,7 @@ jobs: | ||||
|   #       make apk Flavor=Net | ||||
|  | ||||
|   #   - name: Archive production artifacts (net) | ||||
|   #     uses: actions/upload-artifact@v3 | ||||
|   #     uses: actions/upload-artifact@v4 | ||||
|   #     with: | ||||
|   #       name: signed APK ('net' built on ${{ github.job }}) | ||||
|   #       path: | | ||||
| @@ -100,7 +103,7 @@ jobs: | ||||
|   #       make apk Flavor=NoNet | ||||
|  | ||||
|   #   - name: Archive production artifacts (nonet) | ||||
|   #     uses: actions/upload-artifact@v3 | ||||
|   #     uses: actions/upload-artifact@v4 | ||||
|   #     with: | ||||
|   #       name: signed APK ('nonet' built on ${{ github.job }}) | ||||
|   #       path: | | ||||
| @@ -130,16 +133,15 @@ jobs: | ||||
|   #       # Build Artifact of xamarin.android-oss dated 2022-02-16, master branch (= version 12.2.99) | ||||
|   #       xamarin_url: https://artprodcus3.artifacts.visualstudio.com/Ad0adf05a-e7d7-4b65-96fe-3f3884d42038/6fd3d886-57a5-4e31-8db7-52a1b47c07a8/_apis/artifact/cGlwZWxpbmVhcnRpZmFjdDovL3hhbWFyaW4vcHJvamVjdElkLzZmZDNkODg2LTU3YTUtNGUzMS04ZGI3LTUyYTFiNDdjMDdhOC9idWlsZElkLzU0OTUzL2FydGlmYWN0TmFtZS9pbnN0YWxsZXJzLXVuc2lnbmVkKy0rTGludXg1/content?format=zip | ||||
|   #   steps: | ||||
|   #   - uses: actions/checkout@v3 | ||||
|  | ||||
|   #   - name: Fetch submodules | ||||
|   #     run: git submodule init && git submodule update | ||||
|   #   - uses: actions/checkout@v4 | ||||
|   #     with: | ||||
|   #       submodules: true | ||||
|  | ||||
|   #   - name: Setup Gradle | ||||
|   #     uses: gradle/gradle-build-action@v2 | ||||
|   #     uses: gradle/actions/setup-gradle@v3 | ||||
|  | ||||
|   #   - name: Cache NuGet packages | ||||
|   #     uses: actions/cache@v3 | ||||
|   #     uses: actions/cache@v4 | ||||
|   #     with: | ||||
|   #       path: ~/.nuget/packages | ||||
|   #       key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/packages.config') }} | ||||
| @@ -148,7 +150,7 @@ jobs: | ||||
|  | ||||
|   #   - name: Cache Xamarin.Android packages | ||||
|   #     id: xamarin_cache | ||||
|   #     uses: actions/cache@v3 | ||||
|   #     uses: actions/cache@v4 | ||||
|   #     with: | ||||
|   #       path: ~/xamarin.android-oss | ||||
|   #       key: ${{ runner.os }}-xamarin.android-oss-${{ env.xamarin_url }} | ||||
| @@ -183,7 +185,7 @@ jobs: | ||||
|   #       echo "$HOME/xamarin.android-oss/bin/Release/bin" >> $GITHUB_PATH | ||||
|  | ||||
|   #   - name: Switch to JDK-11 | ||||
|   #     uses: actions/setup-java@v3 | ||||
|   #     uses: actions/setup-java@v4 | ||||
|   #     with: | ||||
|   #       java-version: '11' | ||||
|   #       distribution: 'temurin' | ||||
| @@ -217,7 +219,7 @@ jobs: | ||||
|   #       make apk Flavor=Net | ||||
|  | ||||
|   #   - name: Archive production artifacts (net) | ||||
|   #     uses: actions/upload-artifact@v3 | ||||
|   #     uses: actions/upload-artifact@v4 | ||||
|   #     with: | ||||
|   #       name: signed APK ('net' built on ${{ github.job }}) | ||||
|   #       path: | | ||||
| @@ -235,7 +237,7 @@ jobs: | ||||
|   #       make apk Flavor=NoNet | ||||
|  | ||||
|   #   - name: Archive production artifacts (nonet) | ||||
|   #     uses: actions/upload-artifact@v3 | ||||
|   #     uses: actions/upload-artifact@v4 | ||||
|   #     with: | ||||
|   #       name: signed APK ('nonet' built on ${{ github.job }}) | ||||
|   #       path: | | ||||
| @@ -254,39 +256,38 @@ jobs: | ||||
|     runs-on: windows-2022 | ||||
|  | ||||
|     steps: | ||||
|     - uses: actions/checkout@v3 | ||||
|     - uses: actions/checkout@v4 | ||||
|       with: | ||||
|         submodules: true | ||||
|  | ||||
|     - name: Setup Gradle | ||||
|       uses: gradle/gradle-build-action@v2 | ||||
|       uses: gradle/actions/setup-gradle@v3 | ||||
|  | ||||
|     - name: Cache NuGet packages | ||||
|       uses: actions/cache@v3 | ||||
|       uses: actions/cache@v4 | ||||
|       with: | ||||
|         path: ~/.nuget/packages | ||||
|         key: ${{ runner.os }}-nuget-${{ hashFiles('src/**/*.csproj', 'src/**/packages.config') }} | ||||
|         restore-keys: | | ||||
|           ${{ runner.os }}-nuget- | ||||
|  | ||||
|     - name: Fetch submodules | ||||
|       run: git submodule init && git submodule update | ||||
|  | ||||
|     # Workaround an issue when building on windows-2022. Error was | ||||
|     #       D8 : OpenJDK 64-Bit Server VM warning : INFO: os::commit_memory(0x00000000ae400000, 330301440, 0) failed; error='The paging file is too small for this operation to complete' (DOS error/errno=1455) [D:\a\keepass2android\keepass2android\src\keepass2android\keepass2android-app.csproj] | ||||
|     #       C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.D8.targets(81,5): error MSB6006: "java.exe" exited with code 1. [D:\a\keepass2android\keepass2android\src\keepass2android\keepass2android-app.csproj] | ||||
|     - name: Configure Pagefile | ||||
|       uses: al-cheb/configure-pagefile-action@v1.3 | ||||
|       uses: al-cheb/configure-pagefile-action@a3b6ebd6b634da88790d9c58d4b37a7f4a7b8708 # v1.4 | ||||
|       with: | ||||
|         minimum-size: 8GB | ||||
|  | ||||
|     - name: Add msbuild to PATH | ||||
|       uses: microsoft/setup-msbuild@v1.1 | ||||
|       uses: microsoft/setup-msbuild@v2 | ||||
|       # If we want to also have nmake, use this instead | ||||
|       #uses: ilammy/msvc-dev-cmd@v1 | ||||
|  | ||||
|     - name: Switch to JDK-11 | ||||
|       uses: actions/setup-java@v3 | ||||
|     - name: Switch to JDK-17 | ||||
|       uses: actions/setup-java@v4 | ||||
|       with: | ||||
|         java-version: '11' | ||||
|         java-version: '17' | ||||
|         distribution: 'temurin' | ||||
|  | ||||
|     - name: Display java version | ||||
| @@ -320,7 +321,7 @@ jobs: | ||||
|         make apk Flavor=Net | ||||
|  | ||||
|     - name: Archive production artifacts (net) | ||||
|       uses: actions/upload-artifact@v3 | ||||
|       uses: actions/upload-artifact@v4 | ||||
|       with: | ||||
|         name: signed APK ('net' built on ${{ github.job }}) | ||||
|         path: | | ||||
| @@ -341,7 +342,7 @@ jobs: | ||||
|         make apk Flavor=NoNet | ||||
|  | ||||
|     - name: Archive production artifacts (nonet) | ||||
|       uses: actions/upload-artifact@v3 | ||||
|       uses: actions/upload-artifact@v4 | ||||
|       with: | ||||
|         name: signed APK ('nonet' built on ${{ github.job }}) | ||||
|         path: | | ||||
|   | ||||
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @@ -176,3 +176,4 @@ src/java/Keepass2AndroidPluginSDK2/build/generated/mockable-Google-Inc.-Google-A | ||||
| /src/ActionViewFilterTest | ||||
| /docs/gdrive-verification | ||||
| /src/MegaTest | ||||
| *.dtbcache.json | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/jackson-core-2.13.5.jar
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/jackson-core-2.13.5.jar
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1,13 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     package="com.microsoft.services.msa" | ||||
|     android:versionCode="1" | ||||
|     android:versionName="1.0" > | ||||
|  | ||||
|     <uses-sdk | ||||
|         android:minSdkVersion="14" | ||||
|         android:targetSdkVersion="22" /> | ||||
|  | ||||
|     <uses-permission android:name="com.sony.mobile.permission.SYSTEM_UI_VISIBILITY_EXTENSION" /> | ||||
|  | ||||
| </manifest> | ||||
| @@ -1 +0,0 @@ | ||||
| int string app_name 0x7f020000 | ||||
| @@ -1,13 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     package="com.microsoft.services.msa" | ||||
|     android:versionCode="1" | ||||
|     android:versionName="1.0" > | ||||
|  | ||||
|     <uses-sdk | ||||
|         android:minSdkVersion="14" | ||||
|         android:targetSdkVersion="22" /> | ||||
|  | ||||
|     <uses-permission android:name="com.sony.mobile.permission.SYSTEM_UI_VISIBILITY_EXTENSION" /> | ||||
|  | ||||
| </manifest> | ||||
										
											Binary file not shown.
										
									
								
							| @@ -1,6 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
|     <!-- From: file:/C:/Users/pnied/Documents/git/msa-auth-for-android/src/main/res/values/strings.xml --> | ||||
|     <eat-comment/> | ||||
|     <string name="app_name">msa-auth</string> | ||||
| </resources> | ||||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okhttp-4.12.0.jar
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okhttp-4.12.0.jar
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okhttp-digest-3.1.0.jar
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okhttp-digest-3.1.0.jar
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okio-3.6.0.jar
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okio-3.6.0.jar
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okio-jvm-3.6.0.jar
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								src/JavaFileStorageBindings/Jars/okio-jvm-3.6.0.jar
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1,15 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     package="com.microsoft.onedrivesdk" | ||||
|     android:versionCode="10202" | ||||
|     android:versionName="1.2.2" > | ||||
|  | ||||
|     <uses-sdk | ||||
|         android:minSdkVersion="15" | ||||
|         android:targetSdkVersion="23" /> | ||||
|  | ||||
|     <uses-permission android:name="android.permission.GET_ACCOUNTS" /> | ||||
|     <uses-permission android:name="android.permission.USE_CREDENTIALS" /> | ||||
|     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> | ||||
|  | ||||
| </manifest> | ||||
| @@ -1,22 +0,0 @@ | ||||
| int dimen activity_horizontal_margin 0x7f030000 | ||||
| int dimen activity_vertical_margin 0x7f030001 | ||||
| int id LinearLayout1 0x7f060004 | ||||
| int id com_microsoft_aad_adal_editDummyText 0x7f060002 | ||||
| int id com_microsoft_aad_adal_progressBar 0x7f060003 | ||||
| int id com_microsoft_aad_adal_webView1 0x7f060001 | ||||
| int id editPassword 0x7f060006 | ||||
| int id editUserName 0x7f060005 | ||||
| int id webView1 0x7f060000 | ||||
| int layout activity_authentication 0x7f020000 | ||||
| int layout dialog_authentication 0x7f020001 | ||||
| int layout http_auth_dialog 0x7f020002 | ||||
| int string app_loading 0x7f050000 | ||||
| int string app_name 0x7f050001 | ||||
| int string broker_processing 0x7f050002 | ||||
| int string http_auth_dialog_cancel 0x7f050003 | ||||
| int string http_auth_dialog_login 0x7f050004 | ||||
| int string http_auth_dialog_password 0x7f050005 | ||||
| int string http_auth_dialog_title 0x7f050006 | ||||
| int string http_auth_dialog_username 0x7f050007 | ||||
| int style AppBaseTheme 0x7f040000 | ||||
| int style AppTheme 0x7f040001 | ||||
| @@ -1,15 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     package="com.microsoft.onedrivesdk" | ||||
|     android:versionCode="10202" | ||||
|     android:versionName="1.2.2" > | ||||
|  | ||||
|     <uses-sdk | ||||
|         android:minSdkVersion="15" | ||||
|         android:targetSdkVersion="23" /> | ||||
|  | ||||
|     <uses-permission android:name="android.permission.GET_ACCOUNTS" /> | ||||
|     <uses-permission android:name="android.permission.USE_CREDENTIALS" /> | ||||
|     <uses-permission android:name="android.permission.MANAGE_ACCOUNTS" /> | ||||
|  | ||||
| </manifest> | ||||
										
											Binary file not shown.
										
									
								
							| @@ -183,6 +183,7 @@ | ||||
|     <LibraryProjectZip Include="..\java\JavaFileStorage\app\build\outputs\aar\JavaFileStorage-debug.aar"> | ||||
|       <Link>Jars\JavaFileStorage-debug.aar</Link> | ||||
|     </LibraryProjectZip> | ||||
|     <None Include="app.config" /> | ||||
|     <None Include="Jars\AboutJars.txt" /> | ||||
|     <None Include="Additions\AboutAdditions.txt" /> | ||||
|     <None Include="packages.config" /> | ||||
| @@ -212,12 +213,6 @@ | ||||
|       <Name>PCloudBindings</Name> | ||||
|     </ProjectReference> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\msa-auth-0.8.6\classes-msa-auth.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\onedrive-sdk-android-1.2.2\classes-onedrive-sdk.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\gdrive\commons-logging-1.1.1.jar" /> | ||||
|   </ItemGroup> | ||||
| @@ -242,21 +237,6 @@ | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\gdrive\google-http-client-gson-1.16.0-rc.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\jackson-core-2.7.4.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\okhttp-digest-2.5.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\okio-2.9.0.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\okhttp-4.10.0-RC1.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedJar Include="Jars\dropbox-core-sdk-4.0.0.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\gson-2.8.6.jar" /> | ||||
|   </ItemGroup> | ||||
| @@ -290,18 +270,30 @@ | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\gdrive\opencensus-api-0.24.0.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\okhttp-4.12.0.jar" /> | ||||
|     <EmbeddedReferenceJar Include="Jars\okio-3.6.0.jar" /> | ||||
|     <EmbeddedReferenceJar Include="Jars\okio-jvm-3.6.0.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\okhttp-digest-3.1.0.jar" /> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|     <EmbeddedReferenceJar Include="Jars\dropbox-core-sdk-5.4.6.jar" /> | ||||
|     <EmbeddedReferenceJar Include="Jars\jackson-core-2.13.5.jar" /> | ||||
|   </ItemGroup> | ||||
|   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> | ||||
|     <PropertyGroup> | ||||
|       <ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Verwenden Sie die Wiederherstellung von NuGet-Paketen, um die fehlenden Dateien herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText> | ||||
|     </PropertyGroup> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.AndroidX.Migration.1.0.10\build\monoandroid120\Xamarin.AndroidX.Migration.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.AndroidX.Migration.1.0.10\build\monoandroid120\Xamarin.AndroidX.Migration.props'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.AndroidX.Migration.1.0.10\build\monoandroid120\Xamarin.AndroidX.Migration.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.AndroidX.Migration.1.0.10\build\monoandroid120\Xamarin.AndroidX.Migration.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Build.Download.0.11.4\build\Xamarin.Build.Download.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Build.Download.0.11.4\build\Xamarin.Build.Download.props'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Build.Download.0.11.4\build\Xamarin.Build.Download.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Build.Download.0.11.4\build\Xamarin.Build.Download.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Google.Guava.ListenableFuture.1.0.0.9\build\monoandroid12.0\Xamarin.Google.Guava.ListenableFuture.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Google.Guava.ListenableFuture.1.0.0.9\build\monoandroid12.0\Xamarin.Google.Guava.ListenableFuture.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Jetbrains.Annotations.23.0.0.4\build\monoandroid12.0\Xamarin.Jetbrains.Annotations.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Jetbrains.Annotations.23.0.0.4\build\monoandroid12.0\Xamarin.Jetbrains.Annotations.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Kotlin.StdLib.Common.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Common.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Kotlin.StdLib.Common.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Common.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Kotlin.StdLib.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Kotlin.StdLib.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.targets'))" /> | ||||
| @@ -326,7 +318,6 @@ | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Kotlin.StdLib.Jdk7.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk7.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Kotlin.StdLib.Jdk7.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk7.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.Kotlin.StdLib.Jdk8.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk8.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.Kotlin.StdLib.Jdk8.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk8.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.KotlinX.Coroutines.Core.Jvm.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Core.Jvm.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.KotlinX.Coroutines.Core.Jvm.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Core.Jvm.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.2.5.1\build\monoandroid12.0\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.2.5.1\build\monoandroid12.0\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.AndroidX.Activity.1.6.0\build\monoandroid12.0\Xamarin.AndroidX.Activity.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.AndroidX.Activity.1.6.0\build\monoandroid12.0\Xamarin.AndroidX.Activity.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.AndroidX.Fragment.1.5.3\build\monoandroid12.0\Xamarin.AndroidX.Fragment.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.AndroidX.Fragment.1.5.3\build\monoandroid12.0\Xamarin.AndroidX.Fragment.targets'))" /> | ||||
| @@ -337,13 +328,14 @@ | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.GooglePlayServices.Auth.Base.118.0.6\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.Base.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.GooglePlayServices.Auth.Base.118.0.6\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.Base.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.GooglePlayServices.Fido.119.0.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Fido.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.GooglePlayServices.Fido.119.0.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Fido.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.GooglePlayServices.Auth.120.4.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.GooglePlayServices.Auth.120.4.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.targets'))" /> | ||||
|     <Error Condition="!Exists('..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets'))" /> | ||||
|   </Target> | ||||
|   <Import Project="..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets" Condition="Exists('..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets" Condition="Exists('..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets" Condition="Exists('..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.AndroidX.Migration.1.0.10\build\monoandroid120\Xamarin.AndroidX.Migration.targets" Condition="Exists('..\packages\Xamarin.AndroidX.Migration.1.0.10\build\monoandroid120\Xamarin.AndroidX.Migration.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Build.Download.0.11.4\build\Xamarin.Build.Download.targets" Condition="Exists('..\packages\Xamarin.Build.Download.0.11.4\build\Xamarin.Build.Download.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets" Condition="Exists('..\packages\Xamarin.AndroidX.MultiDex.2.0.1.13\build\monoandroid12.0\Xamarin.AndroidX.MultiDex.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets" Condition="Exists('..\packages\Xamarin.Google.Guava.FailureAccess.1.0.1.3\build\monoandroid90\Xamarin.Google.Guava.FailureAccess.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Google.Guava.ListenableFuture.1.0.0.9\build\monoandroid12.0\Xamarin.Google.Guava.ListenableFuture.targets" Condition="Exists('..\packages\Xamarin.Google.Guava.ListenableFuture.1.0.0.9\build\monoandroid12.0\Xamarin.Google.Guava.ListenableFuture.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets" Condition="Exists('..\packages\Xamarin.Google.Guava.28.2.0.1\build\monoandroid90\Xamarin.Google.Guava.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Jetbrains.Annotations.23.0.0.4\build\monoandroid12.0\Xamarin.Jetbrains.Annotations.targets" Condition="Exists('..\packages\Xamarin.Jetbrains.Annotations.23.0.0.4\build\monoandroid12.0\Xamarin.Jetbrains.Annotations.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Kotlin.StdLib.Common.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Common.targets" Condition="Exists('..\packages\Xamarin.Kotlin.StdLib.Common.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Common.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Kotlin.StdLib.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.targets" Condition="Exists('..\packages\Xamarin.Kotlin.StdLib.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.targets')" /> | ||||
| @@ -368,7 +360,6 @@ | ||||
|   <Import Project="..\packages\Xamarin.Kotlin.StdLib.Jdk7.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk7.targets" Condition="Exists('..\packages\Xamarin.Kotlin.StdLib.Jdk7.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk7.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.Kotlin.StdLib.Jdk8.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk8.targets" Condition="Exists('..\packages\Xamarin.Kotlin.StdLib.Jdk8.1.7.10\build\monoandroid12.0\Xamarin.Kotlin.StdLib.Jdk8.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.KotlinX.Coroutines.Core.Jvm.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Core.Jvm.targets" Condition="Exists('..\packages\Xamarin.KotlinX.Coroutines.Core.Jvm.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Core.Jvm.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets" Condition="Exists('..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.2.5.1\build\monoandroid12.0\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.targets" Condition="Exists('..\packages\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.2.5.1\build\monoandroid12.0\Xamarin.AndroidX.Lifecycle.ViewModelSavedState.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.AndroidX.Activity.1.6.0\build\monoandroid12.0\Xamarin.AndroidX.Activity.targets" Condition="Exists('..\packages\Xamarin.AndroidX.Activity.1.6.0\build\monoandroid12.0\Xamarin.AndroidX.Activity.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.AndroidX.Fragment.1.5.3\build\monoandroid12.0\Xamarin.AndroidX.Fragment.targets" Condition="Exists('..\packages\Xamarin.AndroidX.Fragment.1.5.3\build\monoandroid12.0\Xamarin.AndroidX.Fragment.targets')" /> | ||||
| @@ -379,4 +370,5 @@ | ||||
|   <Import Project="..\packages\Xamarin.GooglePlayServices.Auth.Base.118.0.6\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.Base.targets" Condition="Exists('..\packages\Xamarin.GooglePlayServices.Auth.Base.118.0.6\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.Base.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.GooglePlayServices.Fido.119.0.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Fido.targets" Condition="Exists('..\packages\Xamarin.GooglePlayServices.Fido.119.0.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Fido.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.GooglePlayServices.Auth.120.4.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.targets" Condition="Exists('..\packages\Xamarin.GooglePlayServices.Auth.120.4.0\build\MonoAndroid12.0\Xamarin.GooglePlayServices.Auth.targets')" /> | ||||
|   <Import Project="..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets" Condition="Exists('..\packages\Xamarin.KotlinX.Coroutines.Android.1.6.4\build\monoandroid12.0\Xamarin.KotlinX.Coroutines.Android.targets')" /> | ||||
| </Project> | ||||
							
								
								
									
										15
									
								
								src/JavaFileStorageBindings/app.config
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								src/JavaFileStorageBindings/app.config
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <configuration> | ||||
|   <runtime> | ||||
|     <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | ||||
|       <dependentAssembly> | ||||
|         <assemblyIdentity name="Google.Apis.Auth" publicKeyToken="4b01fa6e34db77ab" culture="neutral" /> | ||||
|         <bindingRedirect oldVersion="0.0.0.0-1.67.0.0" newVersion="1.67.0.0" /> | ||||
|       </dependentAssembly> | ||||
|       <dependentAssembly> | ||||
|         <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | ||||
|         <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> | ||||
|       </dependentAssembly> | ||||
|     </assemblyBinding> | ||||
|   </runtime> | ||||
| </configuration> | ||||
| @@ -24,8 +24,8 @@ | ||||
|   <package id="Xamarin.AndroidX.VersionedParcelable" version="1.1.1.14" targetFramework="monoandroid13.0" /> | ||||
|   <package id="Xamarin.AndroidX.ViewPager" version="1.0.0.14" targetFramework="monoandroid13.0" /> | ||||
|   <package id="Xamarin.Build.Download" version="0.11.4" targetFramework="monoandroid13.0" /> | ||||
|   <package id="Xamarin.Google.Guava" version="28.2.0.1" targetFramework="monoandroid90" /> | ||||
|   <package id="Xamarin.Google.Guava.FailureAccess" version="1.0.1.3" targetFramework="monoandroid90" /> | ||||
|   <package id="Xamarin.Google.Guava" version="28.2.0.1" targetFramework="monoandroid13.0" /> | ||||
|   <package id="Xamarin.Google.Guava.FailureAccess" version="1.0.1.3" targetFramework="monoandroid13.0" /> | ||||
|   <package id="Xamarin.Google.Guava.ListenableFuture" version="1.0.0.9" targetFramework="monoandroid13.0" /> | ||||
|   <package id="Xamarin.GooglePlayServices.Auth" version="120.4.0" targetFramework="monoandroid13.0" /> | ||||
|   <package id="Xamarin.GooglePlayServices.Auth.Api.Phone" version="118.0.1.2" targetFramework="monoandroid13.0" /> | ||||
|   | ||||
| @@ -27,7 +27,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "keepass2android-app", "keep | ||||
| EndProject | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aAutofillParser", "Kp2aAutofillParser\Kp2aAutofillParser.csproj", "{39B12571-BAFE-4D3A-AEE2-4D74F14DFD96}" | ||||
| EndProject | ||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Kp2aAutofillParserTest", "Kp2aAutofillParserTest\Kp2aAutofillParserTest.csproj", "{3D1560FF-86BB-4CB4-8367-80BA13B81C38}" | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Kp2aAutofillParserTest", "Kp2aAutofillParserTest\Kp2aAutofillParserTest.csproj", "{3D1560FF-86BB-4CB4-8367-80BA13B81C38}" | ||||
| EndProject | ||||
| Global | ||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
|   </PropertyGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> | ||||
|     <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> | ||||
|   </ItemGroup> | ||||
|  | ||||
| </Project> | ||||
|   | ||||
| @@ -20,13 +20,13 @@ | ||||
|   </ItemGroup> | ||||
|  | ||||
|   <ItemGroup> | ||||
|     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.3.2" /> | ||||
|     <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" /> | ||||
|     <PackageReference Include="xunit" Version="2.4.2" /> | ||||
|     <PackageReference Include="xunit.runner.visualstudio" Version="2.4.5"> | ||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|       <PrivateAssets>all</PrivateAssets> | ||||
|     </PackageReference> | ||||
|     <PackageReference Include="coverlet.collector" Version="3.1.2"> | ||||
|     <PackageReference Include="coverlet.collector" Version="6.0.2"> | ||||
|       <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||||
|       <PrivateAssets>all</PrivateAssets> | ||||
|     </PackageReference> | ||||
|   | ||||
| @@ -1,31 +1,23 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
|  | ||||
| using Android.App; | ||||
| using Android.Content; | ||||
| using Android.OS; | ||||
| using Android.Runtime; | ||||
| using Android.Views; | ||||
| using Android.Widget; | ||||
| using KeePassLib.Serialization; | ||||
| #if !EXCLUDE_JAVAFILESTORAGE | ||||
| using Keepass2android.Javafilestorage; | ||||
| using Exception = Java.Lang.Exception; | ||||
|  | ||||
| namespace keepass2android.Io | ||||
| { | ||||
| 	public class OneDriveFileStorage: JavaFileStorage | ||||
|     /// <summary> | ||||
|     /// This IFileStorage implementation becomes picked if a user is using a skydrive:// or onedrive:// file. | ||||
|     /// These refer to an old (Java) implementation which was replaced starting in 2019. The successor uses onedrive2:// (see OneDrive2FileStorage) | ||||
|     /// The Java implementation was removed in 2024 when the jar files became unavailable. We are keeping this file to notify any user who haven't updated their | ||||
|     /// file storage within 5 years. | ||||
|     /// This file should be removed around mid 2025. | ||||
|     /// </summary> | ||||
| 	public class OneDriveFileStorage: IFileStorage | ||||
| 	{ | ||||
| 		private const string ClientId = "000000004010C234"; | ||||
|  | ||||
| 		public OneDriveFileStorage(Context ctx, IKp2aApp app) : | ||||
| 			base(new Keepass2android.Javafilestorage.OneDriveStorage(ctx, ClientId), app) | ||||
| 		{ | ||||
| 		} | ||||
|  | ||||
| 		public override IEnumerable<string> SupportedProtocols | ||||
| 		 | ||||
| 		public IEnumerable<string> SupportedProtocols | ||||
| 		{ | ||||
| 			get | ||||
| 			{ | ||||
| @@ -34,10 +26,146 @@ namespace keepass2android.Io | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 	    public override bool UserShouldBackup | ||||
|         private Exception GetDeprecatedMessage() | ||||
|         { | ||||
|             return new Exception( | ||||
|                 "You have opened your file through a deprecated Microsoft API. Please select Change database, Open Database and then select One Drive again."); | ||||
|         } | ||||
|  | ||||
| 	    public bool UserShouldBackup | ||||
| 	    { | ||||
| 	        get { return false; } | ||||
| 	    } | ||||
| 	} | ||||
|  | ||||
|         public void Delete(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public bool CheckForFileChangeFast(IOConnectionInfo ioc, string previousFileVersion) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public string GetCurrentFileVersionFast(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public Stream OpenFileForRead(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public IWriteTransaction OpenWriteTransaction(IOConnectionInfo ioc, bool useFileTransaction) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public string GetFilenameWithoutPathAndExt(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public string GetFileExtension(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public bool RequiresCredentials(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void CreateDirectory(IOConnectionInfo ioc, string newDirName) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public IEnumerable<FileDescription> ListContents(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public FileDescription GetFileDescription(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public bool RequiresSetup(IOConnectionInfo ioConnection) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public string IocToPath(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void StartSelectFile(IFileStorageSetupInitiatorActivity activity, bool isForSave, int requestCode, string protocolId) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void PrepareFileUsage(IFileStorageSetupInitiatorActivity activity, IOConnectionInfo ioc, int requestCode, | ||||
|             bool alwaysReturnSuccess) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void PrepareFileUsage(Context ctx, IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void OnCreate(IFileStorageSetupActivity activity, Bundle savedInstanceState) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void OnResume(IFileStorageSetupActivity activity) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void OnStart(IFileStorageSetupActivity activity) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public void OnActivityResult(IFileStorageSetupActivity activity, int requestCode, int resultCode, Intent data) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public string GetDisplayName(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public string CreateFilePath(string parent, string newFilename) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public IOConnectionInfo GetParentPath(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public IOConnectionInfo GetFilePath(IOConnectionInfo folderPath, string filename) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public bool IsPermanentLocation(IOConnectionInfo ioc) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|  | ||||
|         public bool IsReadOnly(IOConnectionInfo ioc, OptionalOut<UiStringKey> reason = null) | ||||
|         { | ||||
|             throw GetDeprecatedMessage(); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| #endif | ||||
| @@ -1,9 +1,10 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" InitialTargets="showFlavor"> | ||||
| <Target Name="showFlavor" AfterTargets="Build"> | ||||
|         <Message Importance="high" Text="building flavor $(Flavor)"></Message> | ||||
|     </Target> | ||||
| <Import Project="../build-properties.props"/> | ||||
|   <Target Name="showFlavor" AfterTargets="Build"> | ||||
|     <Message Importance="high" Text="building flavor $(Flavor)"> | ||||
|     </Message> | ||||
|   </Target> | ||||
|   <Import Project="../build-properties.props" /> | ||||
|   <PropertyGroup> | ||||
|     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||||
|     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||||
| @@ -182,10 +183,10 @@ | ||||
|   </ItemGroup> | ||||
|   <ItemGroup Condition=" '$(Flavor)'!='NoNet' "> | ||||
|     <PackageReference Include="FluentFTP"> | ||||
|       <Version>48.0.0</Version> | ||||
|       <Version>51.1.0</Version> | ||||
|     </PackageReference> | ||||
|     <PackageReference Include="MegaApiClient"> | ||||
|       <Version>1.10.3</Version> | ||||
|       <Version>1.10.4</Version> | ||||
|     </PackageReference> | ||||
|     <PackageReference Include="Microsoft.Graph"> | ||||
|       <Version>1.21.0</Version> | ||||
| @@ -312,4 +313,4 @@ | ||||
|   <Target Name="AfterBuild"> | ||||
|   </Target> | ||||
|   --> | ||||
| </Project> | ||||
| </Project> | ||||
| @@ -4,11 +4,10 @@ android { | ||||
|  | ||||
|     namespace 'keepass2android.javafilestorage' | ||||
|  | ||||
|     compileSdkVersion 33 | ||||
|  | ||||
|     defaultConfig { | ||||
|         minSdkVersion 15 | ||||
|         minSdkVersion 21 | ||||
|         targetSdkVersion 33 | ||||
|         compileSdk 34 | ||||
|     } | ||||
|     buildTypes { | ||||
|         release { | ||||
| @@ -22,6 +21,10 @@ android { | ||||
|         sourceCompatibility 11 | ||||
|         targetCompatibility 11 | ||||
|     } | ||||
|  | ||||
|     packagingOptions { | ||||
|         exclude 'META-INF/DEPENDENCIES' | ||||
|     } | ||||
| } | ||||
|  | ||||
| /* | ||||
| @@ -30,27 +33,21 @@ NOTE: If you change dependencies here, don't forget to update the jar files in J | ||||
|  | ||||
| dependencies { | ||||
|  | ||||
|     implementation 'com.squareup.okhttp3:okhttp:4.10.0-RC1' | ||||
|     implementation 'com.burgstaller:okhttp-digest:2.5' | ||||
|     implementation 'com.squareup.okhttp3:okhttp:4.12.0' | ||||
|     implementation 'io.github.rburgst:okhttp-digest:3.1.0' | ||||
|  | ||||
|     implementation 'com.google.http-client:google-http-client-gson:1.20.0' | ||||
|     implementation('com.google.api-client:google-api-client-android:1.30.5') { | ||||
|         exclude group: 'com.google.android.google-play-services' | ||||
|     } | ||||
|     implementation 'com.google.apis:google-api-services-drive:v2-rev102-1.16.0-rc' | ||||
|     implementation 'com.dropbox.core:dropbox-core-sdk:4.0.0' | ||||
|     implementation 'com.dropbox.core:dropbox-core-sdk:5.4.6' | ||||
|     implementation 'com.google.api-client:google-api-client:1.30.5' | ||||
|     implementation 'com.google.api-client:google-api-client-android:1.30.5' | ||||
|  | ||||
|     implementation 'com.google.android.gms:play-services-auth:20.4.0' | ||||
|     //onedrive: | ||||
|     implementation('com.onedrive.sdk:onedrive-sdk-android:1.2.0') { | ||||
|         transitive = false | ||||
|     } | ||||
|     implementation 'com.pcloud.sdk:java-core:1.9.1' | ||||
|     implementation 'com.pcloud.sdk:android:1.9.1' | ||||
|     implementation 'com.google.code.gson:gson:2.8.6' | ||||
|     implementation 'com.microsoft.services.msa:msa-auth:0.8.6' | ||||
|     implementation 'com.microsoft.aad:adal:1.14.0' | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1,436 +0,0 @@ | ||||
| package keepass2android.javafilestorage; | ||||
|  | ||||
| import android.app.Activity; | ||||
| import android.content.Context; | ||||
| import android.content.Intent; | ||||
| import android.os.AsyncTask; | ||||
| import android.os.Bundle; | ||||
| import androidx.annotation.NonNull; | ||||
| import android.util.Log; | ||||
|  | ||||
| import com.onedrive.sdk.core.DefaultClientConfig; | ||||
| import com.onedrive.sdk.core.IClientConfig; | ||||
| import com.onedrive.sdk.core.OneDriveErrorCodes; | ||||
| import com.onedrive.sdk.extensions.IItemCollectionPage; | ||||
| import com.onedrive.sdk.extensions.IItemCollectionRequestBuilder; | ||||
| import com.onedrive.sdk.extensions.IOneDriveClient; | ||||
| import com.onedrive.sdk.extensions.Item; | ||||
| import com.onedrive.sdk.extensions.OneDriveClient; | ||||
| import com.onedrive.sdk.http.OneDriveServiceException; | ||||
|  | ||||
| import java.io.FileNotFoundException; | ||||
| import java.io.InputStream; | ||||
| import java.io.UnsupportedEncodingException; | ||||
| import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| /** | ||||
|  * Created by Philipp on 20.11.2016. | ||||
|  */ | ||||
| public class OneDriveStorage extends JavaFileStorageBase | ||||
| { | ||||
|     final IClientConfig oneDriveConfig; | ||||
|     final keepass2android.javafilestorage.onedrive.MyMSAAuthenticator msaAuthenticator; | ||||
|  | ||||
|     IOneDriveClient oneDriveClient; | ||||
|  | ||||
|     public OneDriveStorage(final Context context, final String clientId) { | ||||
|         msaAuthenticator = new keepass2android.javafilestorage.onedrive.MyMSAAuthenticator(context) { | ||||
|             @Override | ||||
|             public String getClientId() { | ||||
|                 return clientId; | ||||
|             } | ||||
|  | ||||
|             @Override | ||||
|             public String[] getScopes() { | ||||
|                 return new String[] { "offline_access", "onedrive.readwrite" }; | ||||
|             } | ||||
|         }; | ||||
|         oneDriveConfig = DefaultClientConfig.createWithAuthenticator(msaAuthenticator); | ||||
|         initAuthenticator(null); | ||||
|  | ||||
|  | ||||
|     } | ||||
|  | ||||
|  | ||||
|     @Override | ||||
|     public boolean requiresSetup(String path) { | ||||
|         return !isConnected(null); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void startSelectFile(FileStorageSetupInitiatorActivity activity, boolean isForSave, int requestCode) { | ||||
|  | ||||
|         initAuthenticator((Activity)activity.getActivity()); | ||||
|  | ||||
|         String path = getProtocolId()+":///"; | ||||
|         Log.d("KP2AJ", "startSelectFile "+path+", connected: "+path); | ||||
| 		if (isConnected(null)) | ||||
| 		{ | ||||
| 			Intent intent = new Intent(); | ||||
| 			intent.putExtra(EXTRA_IS_FOR_SAVE, isForSave); | ||||
| 			intent.putExtra(EXTRA_PATH, path); | ||||
| 			activity.onImmediateResult(requestCode, RESULT_FILECHOOSER_PREPARED, intent); | ||||
| 		} | ||||
| 		else | ||||
|         { | ||||
|             activity.startSelectFileProcess(path, isForSave, requestCode); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private boolean isConnected(Activity activity) { | ||||
|         if (oneDriveClient == null) | ||||
|         { | ||||
|             try | ||||
|             { | ||||
|                 Log.d("KP2AJ", "trying silent login"); | ||||
|                 if (msaAuthenticator.loginSilent() != null) | ||||
|                 { | ||||
|                     Log.d("KP2AJ", "ok: silent login"); | ||||
|  | ||||
|                     oneDriveClient = buildClient(activity); | ||||
|  | ||||
|  | ||||
|                 } | ||||
|                 else Log.d("KP2AJ", "trying silent login failed."); | ||||
|             } | ||||
|             catch (Exception e) | ||||
|             { | ||||
|                 e.printStackTrace(); | ||||
|             } | ||||
|         } | ||||
|         return oneDriveClient != null; | ||||
|     } | ||||
|  | ||||
|     private void initAuthenticator(Activity activity) { | ||||
|         msaAuthenticator.init( | ||||
|                 oneDriveConfig.getExecutors(), | ||||
|                 oneDriveConfig.getHttpProvider(), | ||||
|                 activity, | ||||
|                 oneDriveConfig.getLogger()); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     @Override | ||||
|     public void prepareFileUsage(FileStorageSetupInitiatorActivity activity, String path, int requestCode, boolean alwaysReturnSuccess) { | ||||
|         initAuthenticator((Activity)activity.getActivity()); | ||||
|         if (isConnected((Activity)activity.getActivity())) | ||||
|         { | ||||
|             Intent intent = new Intent(); | ||||
|             intent.putExtra(EXTRA_PATH, path); | ||||
|             activity.onImmediateResult(requestCode, RESULT_FILEUSAGE_PREPARED, intent); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             activity.startFileUsageProcess(path, requestCode, alwaysReturnSuccess); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getProtocolId() { | ||||
|         return "onedrive"; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void prepareFileUsage(Context appContext, String path) throws UserInteractionRequiredException { | ||||
|         if (!isConnected(null)) | ||||
|         { | ||||
|             throw new UserInteractionRequiredException(); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void onCreate(FileStorageSetupActivity activity, Bundle savedInstanceState) { | ||||
|  | ||||
|         Log.d("KP2AJ", "OnCreate"); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void onResume(final FileStorageSetupActivity activity) { | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|     } | ||||
|  | ||||
|     private IOneDriveClient buildClient(Activity activity) { | ||||
|  | ||||
|         return new OneDriveClient.Builder() | ||||
|                 .fromConfig(oneDriveConfig) | ||||
|                 .loginAndBuildClient(activity); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     String getPathFromSkydrivePath(String skydrivePath) | ||||
|     { | ||||
|         String path = ""; | ||||
|         if (skydrivePath.equals("")) | ||||
|             return ""; | ||||
|  | ||||
|         String[] parts = skydrivePath.split("/"); | ||||
|  | ||||
|         for (int i = 0; i < parts.length; i++) { | ||||
|             String part = parts[i]; | ||||
|             logDebug("parsing part " + part); | ||||
|             int indexOfSeparator = part.lastIndexOf(NAME_ID_SEP); | ||||
|             if (indexOfSeparator < 0) { | ||||
|                 // seems invalid, but we're very generous here | ||||
|                 path += "/" + part; | ||||
|                 continue; | ||||
|             } | ||||
|             String name = part.substring(0, indexOfSeparator); | ||||
|             try { | ||||
|                 name = decode(name); | ||||
|             } catch (UnsupportedEncodingException e) { | ||||
|                 // ignore | ||||
|             } | ||||
|             path += "/" + name; | ||||
|         } | ||||
|         logDebug("return " +path + ". original was " + skydrivePath); | ||||
|         return path; | ||||
|  | ||||
|     } | ||||
|  | ||||
|     String removeProtocol(String path) throws Exception { | ||||
|         if (path == null) | ||||
|             return null; | ||||
|         if (path.startsWith("skydrive")) | ||||
|             return getPathFromSkydrivePath(path.substring("skydrive://".length())); | ||||
|         return path.substring(getProtocolId().length()+3); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getDisplayName(String path) { | ||||
|  | ||||
|         if (path == null) | ||||
|             return null; | ||||
|         if (path.startsWith("skydrive")) | ||||
|             return getProtocolId()+"://"+getPathFromSkydrivePath(path.substring("skydrive://".length())); | ||||
|  | ||||
|         return path; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getFilename(String path) throws Exception { | ||||
|         return path.substring(path.lastIndexOf("/")+1); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public boolean checkForFileChangeFast(String path, String previousFileVersion) throws Exception { | ||||
|         return false; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String getCurrentFileVersionFast(String path) { | ||||
|         return null; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public InputStream openFileForRead(String path) throws Exception { | ||||
|         try { | ||||
|             path = removeProtocol(path); | ||||
|             logDebug("openFileForRead. Path="+path); | ||||
|             InputStream result = oneDriveClient.getDrive() | ||||
|                     .getRoot() | ||||
|                     .getItemWithPath(path) | ||||
|                     .getContent() | ||||
|                     .buildRequest() | ||||
|                     .get(); | ||||
|             logDebug("ok"); | ||||
|             return result; | ||||
|  | ||||
|         } | ||||
|         catch (OneDriveServiceException e) | ||||
|         { | ||||
|             throw convertException(e); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     private Exception convertException(OneDriveServiceException e) { | ||||
|         if (e.isError(OneDriveErrorCodes.ItemNotFound)) | ||||
|             return new FileNotFoundException(e.getMessage()); | ||||
|         return e; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void uploadFile(String path, byte[] data, boolean writeTransactional) throws Exception { | ||||
|         try { | ||||
|             path = removeProtocol(path); | ||||
|             oneDriveClient.getDrive() | ||||
|                     .getRoot() | ||||
|                     .getItemWithPath(path) | ||||
|                     .getContent() | ||||
|                     .buildRequest() | ||||
|                     .put(data); | ||||
|         } catch (OneDriveServiceException e) { | ||||
|             throw convertException(e); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String createFolder(String parentPath, String newDirName) throws Exception { | ||||
|         throw new Exception("not implemented."); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public String createFilePath(String parentPath, String newFileName) throws Exception { | ||||
|         String path = parentPath; | ||||
|         if (!path.endsWith("/")) | ||||
|             path = path + "/"; | ||||
|         path = path + newFileName; | ||||
|  | ||||
|         return path; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public List<FileEntry> listFiles(String parentPath) throws Exception { | ||||
|         try { | ||||
|             ArrayList<FileEntry> result = new ArrayList<FileEntry>(); | ||||
|             parentPath = removeProtocol(parentPath); | ||||
|             IItemCollectionPage itemsPage = oneDriveClient.getDrive() | ||||
|                     .getRoot() | ||||
|                     .getItemWithPath(parentPath) | ||||
|                     .getChildren() | ||||
|                     .buildRequest() | ||||
|                     .get(); | ||||
|             if (parentPath.endsWith("/")) | ||||
|                 parentPath = parentPath.substring(0,parentPath.length()-1); | ||||
|             while (true) | ||||
|             { | ||||
|                 List<Item> items = itemsPage.getCurrentPage(); | ||||
|                 if (items.isEmpty()) | ||||
|                     return result; | ||||
|  | ||||
|                 for (Item i: items) | ||||
|                 { | ||||
|                     FileEntry e = getFileEntry(parentPath + "/" + i.name, i); | ||||
|                     Log.d("KP2AJ", e.path); | ||||
|                     result.add(e); | ||||
|                 } | ||||
|                 IItemCollectionRequestBuilder nextPageReqBuilder = itemsPage.getNextPage(); | ||||
|                 if (nextPageReqBuilder == null) | ||||
|                     return result; | ||||
|                 itemsPage = nextPageReqBuilder.buildRequest().get(); | ||||
|  | ||||
|             } | ||||
|         } catch (OneDriveServiceException e) { | ||||
|             throw convertException(e); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @NonNull | ||||
|     private FileEntry getFileEntry(String path, Item i) { | ||||
|         FileEntry e = new FileEntry(); | ||||
|         if (i.size != null) | ||||
|             e.sizeInBytes = i.size; | ||||
|         else if ((i.remoteItem != null) && (i.remoteItem.size != null)) | ||||
|             e.sizeInBytes = i.remoteItem.size; | ||||
|  | ||||
|         e.displayName = i.name; | ||||
|         e.canRead = e.canWrite = true; | ||||
|         e.path = getProtocolId() +"://"+path; | ||||
|         if (i.lastModifiedDateTime != null) | ||||
|             e.lastModifiedTime = i.lastModifiedDateTime.getTimeInMillis(); | ||||
|         else if ((i.remoteItem != null)&&(i.remoteItem.lastModifiedDateTime != null)) | ||||
|             e.lastModifiedTime = i.remoteItem.lastModifiedDateTime.getTimeInMillis(); | ||||
|         e.isDirectory = (i.folder != null) || ((i.remoteItem != null) && (i.remoteItem.folder != null)); | ||||
|         return e; | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public FileEntry getFileEntry(String filename) throws Exception { | ||||
|         try { | ||||
|             filename = removeProtocol(filename); | ||||
|             Item item = oneDriveClient.getDrive() | ||||
|                     .getRoot() | ||||
|                     .getItemWithPath(filename) | ||||
|                     .buildRequest() | ||||
|                     .get(); | ||||
|             return getFileEntry(filename, item); | ||||
|         } catch (OneDriveServiceException e) { | ||||
|             throw convertException(e); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void delete(String path) throws Exception { | ||||
|         try { | ||||
|             path = removeProtocol(path); | ||||
|             oneDriveClient.getDrive() | ||||
|                     .getRoot() | ||||
|                     .getItemWithPath(path) | ||||
|                     .buildRequest() | ||||
|                     .delete(); | ||||
|         } catch (OneDriveServiceException e) { | ||||
|             throw convertException(e); | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void onStart(final FileStorageSetupActivity activity) { | ||||
|         Log.d("KP2AJ", "onStart"); | ||||
|         if (activity.getProcessName().equals(PROCESS_NAME_SELECTFILE)) | ||||
|             activity.getState().putString(EXTRA_PATH, activity.getPath()); | ||||
|  | ||||
|         JavaFileStorage.FileStorageSetupActivity storageSetupAct = activity; | ||||
|  | ||||
|         if (oneDriveClient != null) { | ||||
|             Log.d("KP2AJ", "auth successful"); | ||||
|             try { | ||||
|  | ||||
|                 finishActivityWithSuccess(activity); | ||||
|                 return; | ||||
|  | ||||
|             } catch (Exception e) { | ||||
|                 Log.d("KP2AJ", "finish with error: " + e.toString()); | ||||
|                 finishWithError(activity, e); | ||||
|                 return; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|  | ||||
|         { | ||||
|             Log.d("KP2AJ", "Starting auth"); | ||||
|             new AsyncTask<Object, Object, Object>() { | ||||
|  | ||||
|                 @Override | ||||
|                 protected Object doInBackground(Object... params) { | ||||
|                     try { | ||||
|                         return buildClient((Activity) activity); | ||||
|                     } catch (Exception e) { | ||||
|                         return null; | ||||
|                     } | ||||
|                 } | ||||
|  | ||||
|                 @Override | ||||
|                 protected void onPostExecute(Object o) { | ||||
|                     if (o == null) | ||||
|                     { | ||||
|                         Log.i(TAG, "authenticating not successful"); | ||||
|                         Intent data = new Intent(); | ||||
|                         data.putExtra(EXTRA_ERROR_MESSAGE, "authenticating not succesful"); | ||||
|                         ((Activity)activity).setResult(Activity.RESULT_CANCELED, data); | ||||
|                         ((Activity)activity).finish(); | ||||
|  | ||||
|                     } | ||||
|                     else | ||||
|                     { | ||||
|                         Log.i(TAG, "authenticating successful"); | ||||
|  | ||||
|                         oneDriveClient = (IOneDriveClient) o; | ||||
|                         finishActivityWithSuccess(activity); | ||||
|                     } | ||||
|                 } | ||||
|             }.execute(); | ||||
|  | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void onActivityResult(FileStorageSetupActivity activity, int requestCode, int resultCode, Intent data) { | ||||
|  | ||||
|     } | ||||
| } | ||||
| @@ -1,102 +0,0 @@ | ||||
| package keepass2android.javafilestorage.onedrive; | ||||
|  | ||||
| /** | ||||
|  * Created by Philipp on 22.11.2016. | ||||
|  */ | ||||
|  | ||||
| import com.microsoft.services.msa.LiveConnectSession; | ||||
| import com.onedrive.sdk.authentication.AccountType; | ||||
| import com.onedrive.sdk.authentication.IAccountInfo; | ||||
| import com.onedrive.sdk.authentication.MSAAccountInfo; | ||||
| import com.onedrive.sdk.authentication.MSAAuthenticator; | ||||
| import com.onedrive.sdk.logger.ILogger; | ||||
|  | ||||
| import com.microsoft.services.msa.LiveConnectSession; | ||||
| import com.onedrive.sdk.logger.ILogger; | ||||
|  | ||||
| /** | ||||
|  * Account information for a MSA based account. | ||||
|  */ | ||||
| public class MyMSAAccountInfo implements IAccountInfo { | ||||
|  | ||||
|     /** | ||||
|      * The service root for the OneDrive personal API. | ||||
|      */ | ||||
|     public static final String ONE_DRIVE_PERSONAL_SERVICE_ROOT = "https://api.onedrive.com/v1.0"; | ||||
|  | ||||
|     /** | ||||
|      * The authenticator that can refresh this account. | ||||
|      */ | ||||
|     private final MyMSAAuthenticator mAuthenticator; | ||||
|  | ||||
|     /** | ||||
|      * The session this account is based off of. | ||||
|      */ | ||||
|     private LiveConnectSession mSession; | ||||
|  | ||||
|     /** | ||||
|      * The logger. | ||||
|      */ | ||||
|     private final ILogger mLogger; | ||||
|  | ||||
|     /** | ||||
|      * Creates an MSAAccountInfo object. | ||||
|      * @param authenticator The authenticator that this account info was created from. | ||||
|      * @param liveConnectSession The session this account is based off of. | ||||
|      * @param logger The logger. | ||||
|      */ | ||||
|     public MyMSAAccountInfo(final MyMSAAuthenticator authenticator, | ||||
|                           final LiveConnectSession liveConnectSession, | ||||
|                           final ILogger logger) { | ||||
|         mAuthenticator = authenticator; | ||||
|         mSession = liveConnectSession; | ||||
|         mLogger = logger; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the type of the account. | ||||
|      * @return The MicrosoftAccount account type. | ||||
|      */ | ||||
|     @Override | ||||
|     public AccountType getAccountType() { | ||||
|         return AccountType.MicrosoftAccount; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the access token for requests against the service root. | ||||
|      * @return The access token for requests against the service root. | ||||
|      */ | ||||
|     @Override | ||||
|     public String getAccessToken() { | ||||
|         return mSession.getAccessToken(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Get the OneDrive service root for this account. | ||||
|      * @return the OneDrive service root for this account. | ||||
|      */ | ||||
|     @Override | ||||
|     public String getServiceRoot() { | ||||
|         return ONE_DRIVE_PERSONAL_SERVICE_ROOT; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Indicates if the account access token is expired and needs to be refreshed. | ||||
|      * @return true if refresh() needs to be called and | ||||
|      *         false if the account is still valid. | ||||
|      */ | ||||
|     @Override | ||||
|     public boolean isExpired() { | ||||
|         return mSession.isExpired(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Refreshes the authentication token for this account info. | ||||
|      */ | ||||
|     @Override | ||||
|     public void refresh() { | ||||
|         mLogger.logDebug("Refreshing access token..."); | ||||
|         final MyMSAAccountInfo newInfo = (MyMSAAccountInfo)mAuthenticator.loginSilent(); | ||||
|         mSession = newInfo.mSession; | ||||
|     } | ||||
| } | ||||
| @@ -1,446 +0,0 @@ | ||||
| package keepass2android.javafilestorage.onedrive; | ||||
|  | ||||
| /** | ||||
|  * Created by Philipp on 22.11.2016. | ||||
|  */ | ||||
| import android.app.Activity; | ||||
| import android.content.Context; | ||||
| import android.content.SharedPreferences; | ||||
| import android.util.Log; | ||||
|  | ||||
| import com.microsoft.onedrivesdk.BuildConfig; | ||||
| import com.microsoft.services.msa.LiveAuthClient; | ||||
| import com.microsoft.services.msa.LiveAuthException; | ||||
| import com.microsoft.services.msa.LiveAuthListener; | ||||
| import com.microsoft.services.msa.LiveConnectSession; | ||||
| import com.microsoft.services.msa.LiveStatus; | ||||
| import com.onedrive.sdk.authentication.ClientAuthenticatorException; | ||||
| import com.onedrive.sdk.authentication.IAccountInfo; | ||||
| import com.onedrive.sdk.authentication.IAuthenticator; | ||||
| import com.onedrive.sdk.authentication.MSAAccountInfo; | ||||
| import com.onedrive.sdk.concurrency.ICallback; | ||||
| import com.onedrive.sdk.core.ClientException; | ||||
| import com.onedrive.sdk.concurrency.SimpleWaiter; | ||||
| import com.onedrive.sdk.concurrency.IExecutors; | ||||
| import com.onedrive.sdk.core.OneDriveErrorCodes; | ||||
| import com.onedrive.sdk.http.IHttpProvider; | ||||
| import com.onedrive.sdk.logger.ILogger; | ||||
|  | ||||
| import java.security.InvalidParameterException; | ||||
| import java.util.Arrays; | ||||
| import java.util.concurrent.atomic.AtomicReference; | ||||
|  | ||||
| /** | ||||
|  * Wrapper around the MSA authentication library. | ||||
|  * https://github.com/MSOpenTech/msa-auth-for-android | ||||
|  */ | ||||
| @SuppressWarnings("ThrowableResultOfMethodCallIgnored") | ||||
| public abstract class MyMSAAuthenticator implements IAuthenticator { | ||||
|  | ||||
|     private final Context mContext; | ||||
|  | ||||
|     public MyMSAAuthenticator(Context context) | ||||
|     { | ||||
|         mContext = context; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * The sign in cancellation message. | ||||
|      */ | ||||
|     private static final String SIGN_IN_CANCELLED_MESSAGE = "The user cancelled the login operation."; | ||||
|  | ||||
|     /** | ||||
|      * The preferences for this authenticator. | ||||
|      */ | ||||
|     private static final String MSA_AUTHENTICATOR_PREFS = "MSAAuthenticatorPrefs"; | ||||
|  | ||||
|     /** | ||||
|      * The key for the user id. | ||||
|      */ | ||||
|     private static final String USER_ID_KEY = "userId"; | ||||
|  | ||||
|     /** | ||||
|      * The key for the version code | ||||
|      */ | ||||
|     public static final String VERSION_CODE_KEY = "versionCode"; | ||||
|  | ||||
|     /** | ||||
|      * The default user id | ||||
|      */ | ||||
|     private static final String DEFAULT_USER_ID = "@@defaultUser"; | ||||
|  | ||||
|     /** | ||||
|      * The active user id. | ||||
|      */ | ||||
|     private final AtomicReference<String> mUserId = new AtomicReference<>(); | ||||
|  | ||||
|     /** | ||||
|      * The executors. | ||||
|      */ | ||||
|     private IExecutors mExecutors; | ||||
|  | ||||
|     /** | ||||
|      * Indicates whether this authenticator has been initialized. | ||||
|      */ | ||||
|     private boolean mInitialized; | ||||
|  | ||||
|     /** | ||||
|      * The context UI interactions should happen with. | ||||
|      */ | ||||
|     private Activity mActivity; | ||||
|  | ||||
|     /** | ||||
|      * The logger. | ||||
|      */ | ||||
|     private ILogger mLogger; | ||||
|  | ||||
|     /** | ||||
|      * The client id for this authenticator. | ||||
|      * https://dev.onedrive.com/auth/msa_oauth.htm#to-register-your-app | ||||
|      * @return The client id. | ||||
|      */ | ||||
|     public abstract String getClientId(); | ||||
|  | ||||
|     /** | ||||
|      * The scopes for this application. | ||||
|      * https://dev.onedrive.com/auth/msa_oauth.htm#authentication-scopes | ||||
|      * @return The scopes for this application. | ||||
|      */ | ||||
|     public abstract String[] getScopes(); | ||||
|  | ||||
|     /** | ||||
|      * The live authentication client. | ||||
|      */ | ||||
|     private LiveAuthClient mAuthClient; | ||||
|  | ||||
|     /** | ||||
|      * Initializes the authenticator. | ||||
|      * @param executors The executors to schedule foreground and background tasks. | ||||
|      * @param httpProvider The http provider for sending requests. | ||||
|      * @param activity The activity to create interactive UI on. | ||||
|      * @param logger The logger for diagnostic information. | ||||
|      */ | ||||
|     @Override | ||||
|     public synchronized void init(final IExecutors executors, | ||||
|                                   final IHttpProvider httpProvider, | ||||
|                                   final Activity activity, | ||||
|                                   final ILogger logger) { | ||||
|         mActivity = activity; | ||||
|  | ||||
|         if (mInitialized) { | ||||
|             return; | ||||
|         } | ||||
|  | ||||
|         mExecutors = executors; | ||||
|         mLogger = logger; | ||||
|         mInitialized = true; | ||||
|         mAuthClient = new LiveAuthClient(mContext, getClientId(), Arrays.asList(getScopes())); | ||||
|  | ||||
|         final SharedPreferences prefs = getSharedPreferences(); | ||||
|         mUserId.set(prefs.getString(USER_ID_KEY, null)); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Starts an interactive login asynchronously. | ||||
|      * @param emailAddressHint The hint for the email address during the interactive login. | ||||
|      * @param loginCallback The callback to be called when the login is complete. | ||||
|      */ | ||||
|     @Override | ||||
|     public void login(final String emailAddressHint, final ICallback<IAccountInfo> loginCallback) { | ||||
|         Log.d("KP2AJ", "login()"); | ||||
|         if (!mInitialized) { | ||||
|             throw new IllegalStateException("init must be called"); | ||||
|         } | ||||
|  | ||||
|         if (loginCallback == null) { | ||||
|             throw new InvalidParameterException("loginCallback"); | ||||
|         } | ||||
|  | ||||
|         mLogger.logDebug("Starting login async"); | ||||
|  | ||||
|         mExecutors.performOnBackground(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 try { | ||||
|                     mExecutors.performOnForeground(login(emailAddressHint), loginCallback); | ||||
|                 } catch (final ClientException e) { | ||||
|                     mExecutors.performOnForeground(e, loginCallback); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Starts an interactive login. | ||||
|      * @param emailAddressHint The hint for the email address during the interactive login. | ||||
|      * @return The account info. | ||||
|      * @throws ClientException An exception occurs if the login was unable to complete for any reason. | ||||
|      */ | ||||
|     @Override | ||||
|     public synchronized IAccountInfo login(final String emailAddressHint) throws ClientException { | ||||
|         if (!mInitialized) { | ||||
|             throw new IllegalStateException("init must be called"); | ||||
|         } | ||||
|  | ||||
|         mLogger.logDebug("Starting login"); | ||||
|  | ||||
|         final AtomicReference<ClientException> error = new AtomicReference<>(); | ||||
|         final SimpleWaiter waiter = new SimpleWaiter(); | ||||
|  | ||||
|         final LiveAuthListener listener = new LiveAuthListener() { | ||||
|             @Override | ||||
|             public void onAuthComplete(final LiveStatus liveStatus, | ||||
|                                        final LiveConnectSession liveConnectSession, | ||||
|                                        final Object o) { | ||||
|                 if (liveStatus == LiveStatus.NOT_CONNECTED) { | ||||
|                     mLogger.logDebug("Received invalid login failure from silent authentication with MSA, ignoring."); | ||||
|                 } else { | ||||
|                     mLogger.logDebug("Successful interactive login"); | ||||
|                     waiter.signal(); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             @Override | ||||
|             public void onAuthError(final LiveAuthException e, | ||||
|                                     final Object o) { | ||||
|                 OneDriveErrorCodes code = OneDriveErrorCodes.AuthenticationFailure; | ||||
|                 if (e.getError().equals(SIGN_IN_CANCELLED_MESSAGE)) { | ||||
|                     code = OneDriveErrorCodes.AuthenticationCancelled; | ||||
|                 } | ||||
|  | ||||
|                 error.set(new ClientAuthenticatorException("Unable to login with MSA", e, code)); | ||||
|                 mLogger.logError(error.get().getMessage(), error.get()); | ||||
|                 waiter.signal(); | ||||
|             } | ||||
|         }; | ||||
|  | ||||
|         mActivity.runOnUiThread(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 mAuthClient.login(mActivity, /* scopes */null, /* user object */ null, emailAddressHint, listener); | ||||
|             } | ||||
|         }); | ||||
|  | ||||
|         mLogger.logDebug("Waiting for MSA callback"); | ||||
|         waiter.waitForSignal(); | ||||
|  | ||||
|         final ClientException exception = error.get(); | ||||
|         if (exception != null) { | ||||
|             throw exception; | ||||
|         } | ||||
|  | ||||
|         final String userId; | ||||
|         if (emailAddressHint != null) { | ||||
|             userId = emailAddressHint; | ||||
|         } else { | ||||
|             userId = DEFAULT_USER_ID; | ||||
|         } | ||||
|  | ||||
|         mUserId.set(userId); | ||||
|  | ||||
|         final SharedPreferences prefs = getSharedPreferences(); | ||||
|         prefs.edit() | ||||
|                 .putString(USER_ID_KEY, mUserId.get()) | ||||
|                 .putInt(VERSION_CODE_KEY, BuildConfig.VERSION_CODE) | ||||
|                 .apply(); | ||||
|  | ||||
|         return getAccountInfo(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Starts a silent login asynchronously. | ||||
|      * @param loginCallback The callback to be called when the login is complete. | ||||
|      */ | ||||
|     @Override | ||||
|     public void loginSilent(final ICallback<IAccountInfo> loginCallback) { | ||||
|         if (!mInitialized) { | ||||
|             throw new IllegalStateException("init must be called"); | ||||
|         } | ||||
|  | ||||
|         if (loginCallback == null) { | ||||
|             throw new InvalidParameterException("loginCallback"); | ||||
|         } | ||||
|  | ||||
|         mLogger.logDebug("Starting login silent async"); | ||||
|  | ||||
|         mExecutors.performOnBackground(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 try { | ||||
|                     mExecutors.performOnForeground(loginSilent(), loginCallback); | ||||
|                 } catch (final ClientException e) { | ||||
|                     mExecutors.performOnForeground(e, loginCallback); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Starts a silent login. | ||||
|      * @return The account info. | ||||
|      * @throws ClientException An exception occurs if the login was unable to complete for any reason. | ||||
|      */ | ||||
|     @Override | ||||
|     public synchronized IAccountInfo loginSilent() throws ClientException { | ||||
|         if (!mInitialized) { | ||||
|             throw new IllegalStateException("init must be called"); | ||||
|         } | ||||
|  | ||||
|         mLogger.logDebug("Starting login silent"); | ||||
|  | ||||
|         final int userIdStoredMinVersion = 10112; | ||||
|         if (getSharedPreferences().getInt(VERSION_CODE_KEY, 0) >= userIdStoredMinVersion | ||||
|                 && mUserId.get() == null) { | ||||
|             mLogger.logDebug("No login information found for silent authentication"); | ||||
|             return null; | ||||
|         } | ||||
|  | ||||
|         final SimpleWaiter loginSilentWaiter = new SimpleWaiter(); | ||||
|         final AtomicReference<ClientException> error = new AtomicReference<>(); | ||||
|  | ||||
|         final boolean waitForCallback = mAuthClient.loginSilent(new LiveAuthListener() { | ||||
|             @Override | ||||
|             public void onAuthComplete(final LiveStatus liveStatus, | ||||
|                                        final LiveConnectSession liveConnectSession, | ||||
|                                        final Object o) { | ||||
|                 if (liveStatus == LiveStatus.NOT_CONNECTED) { | ||||
|                     error.set(new ClientAuthenticatorException("Failed silent login, interactive login required", | ||||
|                             OneDriveErrorCodes.AuthenticationFailure)); | ||||
|                     mLogger.logError(error.get().getMessage(), error.get()); | ||||
|                 } else { | ||||
|                     mLogger.logDebug("Successful silent login"); | ||||
|                 } | ||||
|                 loginSilentWaiter.signal(); | ||||
|             } | ||||
|  | ||||
|             @Override | ||||
|             public void onAuthError(final LiveAuthException e, | ||||
|                                     final Object o) { | ||||
|                 OneDriveErrorCodes code = OneDriveErrorCodes.AuthenticationFailure; | ||||
|                 if (e.getError().equals(SIGN_IN_CANCELLED_MESSAGE)) { | ||||
|                     code = OneDriveErrorCodes.AuthenticationCancelled; | ||||
|                 } | ||||
|  | ||||
|                 error.set(new ClientAuthenticatorException("Login silent authentication error", e, code)); | ||||
|                 mLogger.logError(error.get().getMessage(), error.get()); | ||||
|                 loginSilentWaiter.signal(); | ||||
|             } | ||||
|         }); | ||||
|  | ||||
|         if (!waitForCallback) { | ||||
|             mLogger.logDebug("MSA silent auth fast-failed"); | ||||
|             return null; | ||||
|         } | ||||
|  | ||||
|         mLogger.logDebug("Waiting for MSA callback"); | ||||
|         loginSilentWaiter.waitForSignal(); | ||||
|         final ClientException exception = error.get(); | ||||
|         if (exception != null) { | ||||
|             throw exception; | ||||
|         } | ||||
|  | ||||
|         return getAccountInfo(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Log the current user out. | ||||
|      * @param logoutCallback The callback to be called when the logout is complete. | ||||
|      */ | ||||
|     @Override | ||||
|     public void logout(final ICallback<Void> logoutCallback) { | ||||
|         if (!mInitialized) { | ||||
|             throw new IllegalStateException("init must be called"); | ||||
|         } | ||||
|  | ||||
|         if (logoutCallback == null) { | ||||
|             throw new InvalidParameterException("logoutCallback"); | ||||
|         } | ||||
|  | ||||
|         mLogger.logDebug("Starting logout async"); | ||||
|  | ||||
|         mExecutors.performOnBackground(new Runnable() { | ||||
|             @Override | ||||
|             public void run() { | ||||
|                 try { | ||||
|                     logout(); | ||||
|                     mExecutors.performOnForeground((Void) null, logoutCallback); | ||||
|                 } catch (final ClientException e) { | ||||
|                     mExecutors.performOnForeground(e, logoutCallback); | ||||
|                 } | ||||
|             } | ||||
|         }); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Log the current user out. | ||||
|      * @throws ClientException An exception occurs if the logout was unable to complete for any reason. | ||||
|      */ | ||||
|     @Override | ||||
|     public synchronized void logout() throws ClientException { | ||||
|         if (!mInitialized) { | ||||
|             throw new IllegalStateException("init must be called"); | ||||
|         } | ||||
|  | ||||
|         mLogger.logDebug("Starting logout"); | ||||
|  | ||||
|         final SimpleWaiter logoutWaiter = new SimpleWaiter(); | ||||
|         final AtomicReference<ClientException> error = new AtomicReference<>(); | ||||
|         mAuthClient.logout(new LiveAuthListener() { | ||||
|             @Override | ||||
|             public void onAuthComplete(final LiveStatus liveStatus, | ||||
|                                        final LiveConnectSession liveConnectSession, | ||||
|                                        final Object o) { | ||||
|                 mLogger.logDebug("Logout completed"); | ||||
|                 logoutWaiter.signal(); | ||||
|             } | ||||
|  | ||||
|             @Override | ||||
|             public void onAuthError(final LiveAuthException e, final Object o) { | ||||
|                 error.set(new ClientAuthenticatorException("MSA Logout failed", | ||||
|                         e, | ||||
|                         OneDriveErrorCodes.AuthenticationFailure)); | ||||
|                 mLogger.logError(error.get().getMessage(), error.get()); | ||||
|                 logoutWaiter.signal(); | ||||
|             } | ||||
|         }); | ||||
|  | ||||
|         mLogger.logDebug("Waiting for logout to complete"); | ||||
|         logoutWaiter.waitForSignal(); | ||||
|  | ||||
|         mLogger.logDebug("Clearing all MSA Authenticator shared preferences"); | ||||
|         final SharedPreferences prefs = getSharedPreferences(); | ||||
|         prefs.edit() | ||||
|                 .clear() | ||||
|                 .putInt(VERSION_CODE_KEY, BuildConfig.VERSION_CODE) | ||||
|                 .apply(); | ||||
|         mUserId.set(null); | ||||
|  | ||||
|         final ClientException exception = error.get(); | ||||
|         if (exception != null) { | ||||
|             throw exception; | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Gets the current account info for this authenticator. | ||||
|      * @return NULL if no account is available. | ||||
|      */ | ||||
|     @Override | ||||
|     public IAccountInfo getAccountInfo() { | ||||
|         final LiveConnectSession session = mAuthClient.getSession(); | ||||
|         if (session == null) { | ||||
|             return null; | ||||
|         } | ||||
|  | ||||
|         return new MyMSAAccountInfo(this, session, mLogger); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Gets the shared preferences for this authenticator. | ||||
|      * @return The shared preferences. | ||||
|      */ | ||||
|     private SharedPreferences getSharedPreferences() { | ||||
|         return mContext.getSharedPreferences(MSA_AUTHENTICATOR_PREFS, Context.MODE_PRIVATE); | ||||
|     } | ||||
|  | ||||
| } | ||||
| @@ -6,7 +6,7 @@ buildscript { | ||||
|         jcenter() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath "com.android.tools.build:gradle:7.4.0" | ||||
|         classpath "com.android.tools.build:gradle:8.4.0" | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -1 +1,2 @@ | ||||
| org.gradle.jvmargs=-Xmx1536m | ||||
| android.useAndroidX=true | ||||
|   | ||||
| @@ -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.6-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||||
|   | ||||
| @@ -145,7 +145,9 @@ import java.util.ArrayList; | ||||
| import java.util.List; | ||||
|  | ||||
| //import keepass2android.javafilestorage.DropboxCloudRailStorage; | ||||
| import keepass2android.javafilestorage.DropboxV2Storage; | ||||
| import keepass2android.javafilestorage.GoogleDriveAppDataFileStorage; | ||||
| import keepass2android.javafilestorage.ICertificateErrorHandler; | ||||
| import keepass2android.javafilestorage.JavaFileStorage; | ||||
| import keepass2android.javafilestorage.JavaFileStorage.FileEntry; | ||||
| import keepass2android.javafilestorage.PCloudFileStorage; | ||||
| @@ -347,7 +349,7 @@ public class MainActivity extends Activity implements JavaFileStorage.FileStorag | ||||
| 				fileList = fs.listFiles(path); | ||||
| 				checkFileList(path, fileList, false, true); //second param indicates the file must be gone | ||||
| 				 | ||||
| 				Log.d("KP2AJ", "Delete a folder recursive"); | ||||
| 				Log.d("KP2AJ", "xDelete a folder recursive: " + subfolderPath); | ||||
| 				fs.delete(subfolderPath); | ||||
| 				 | ||||
| 				Log.d("KP2AJ", "List files again to check if deleting the folder was successful:"); | ||||
| @@ -540,12 +542,12 @@ public class MainActivity extends Activity implements JavaFileStorage.FileStorag | ||||
|  | ||||
| 	static JavaFileStorage createStorageToTest(Context ctx, Context appContext, boolean simulateRestart) { | ||||
| 		//storageToTest = new SftpStorage(ctx.getApplicationContext()); | ||||
| 		storageToTest = new PCloudFileStorage(ctx, "FLm22de7bdS", "pcloud", "pcloudtest"); | ||||
| 		//storageToTest = new PCloudFileStorage(ctx, "FLm22de7bdS", "pcloud", "pcloudtest"); | ||||
| 		//storageToTest = new SkyDriveFileStorage("000000004010C234", appContext); | ||||
|  | ||||
|  | ||||
| 		//storageToTest = new GoogleDriveAppDataFileStorage(); | ||||
| 		/*storageToTest = new WebDavStorage(new ICertificateErrorHandler() { | ||||
| 		storageToTest = new WebDavStorage(new ICertificateErrorHandler() { | ||||
| 			@Override | ||||
| 			public boolean onValidationError(String error) { | ||||
| 				return false; | ||||
| @@ -555,7 +557,7 @@ public class MainActivity extends Activity implements JavaFileStorage.FileStorag | ||||
| 			public boolean alwaysFailOnValidationError() { | ||||
| 				return false; | ||||
| 			} | ||||
| 		});*/ | ||||
| 		}); | ||||
|  | ||||
| 		//storageToTest =  new DropboxV2Storage(ctx,"4ybka4p4a1027n6", "1z5lv528un9nre8", !simulateRestart); | ||||
| 		//storageToTest =  new DropboxFileStorage(ctx,"4ybka4p4a1027n6", "1z5lv528un9nre8", !simulateRestart); | ||||
|   | ||||
| @@ -15,7 +15,7 @@ | ||||
|             android:layout_height="wrap_content" | ||||
|             android:singleLine="true" | ||||
|             android:inputType="textNoSuggestions" | ||||
|             android:text="https://daigers.diskstation.me:5006/Keepass2Android/Apps/Keepass2Android/" | ||||
|             android:text="https://webdav.hidrive.ionos.com/users/philippcro" | ||||
|             android:hint="Server URL" /> | ||||
|        </LinearLayout> | ||||
|     <EditText | ||||
| @@ -23,7 +23,7 @@ | ||||
|         android:layout_width="fill_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:singleLine="true" | ||||
|         android:text="Keepass" | ||||
|         android:text="PhilippCro" | ||||
|         android:hint="@string/hint_username" /> | ||||
|  | ||||
|     <EditText | ||||
| @@ -32,7 +32,7 @@ | ||||
|         android:layout_height="wrap_content" | ||||
|         android:inputType="textPassword" | ||||
|         android:singleLine="true" | ||||
|         android:text="$T3st17$" | ||||
|         android:text="WSBa1wh4o4YyLK" | ||||
|         android:hint="@string/hint_pass" | ||||
|         android:importantForAccessibility="no" /> | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ buildscript { | ||||
|         jcenter() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath "com.android.tools.build:gradle:7.4.0" | ||||
|         classpath "com.android.tools.build:gradle:8.4.0" | ||||
|  | ||||
|         // NOTE: Do not place your application dependencies here; they belong | ||||
|         // in the individual module build.gradle files | ||||
|   | ||||
| @@ -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.6-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||||
|   | ||||
| @@ -4,11 +4,13 @@ android { | ||||
|  | ||||
|     namespace 'keepass2android.kp2akeytransform' | ||||
|  | ||||
|     compileSdkVersion 33 | ||||
|  | ||||
|  | ||||
|     defaultConfig { | ||||
|         ndk.abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' | ||||
|  | ||||
|         minSdkVersion 21 | ||||
|         targetSdkVersion 34 | ||||
|         compileSdk 34 | ||||
|  | ||||
|     } | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ buildscript { | ||||
|         mavenCentral() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath "com.android.tools.build:gradle:7.4.0" | ||||
|         classpath "com.android.tools.build:gradle:8.4.0" | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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.6-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||||
|   | ||||
| @@ -3,10 +3,12 @@ android { | ||||
|  | ||||
|     namespace 'keepass2android.softkeyboard' | ||||
|  | ||||
|     compileSdkVersion 33 | ||||
|  | ||||
|  | ||||
|     defaultConfig { | ||||
|         minSdkVersion 18 | ||||
|         minSdkVersion 21 | ||||
|         compileSdk 34 | ||||
|         targetSdk 34 | ||||
|     } | ||||
|  | ||||
|     buildTypes { | ||||
|   | ||||
| @@ -5,7 +5,7 @@ buildscript { | ||||
|         mavenCentral() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath "com.android.tools.build:gradle:7.4.0" | ||||
|         classpath "com.android.tools.build:gradle:8.4.0" | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -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.6-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||||
|   | ||||
| @@ -6,7 +6,7 @@ buildscript { | ||||
|         mavenCentral() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath "com.android.tools.build:gradle:7.4.0" | ||||
|         classpath "com.android.tools.build:gradle:8.4.0" | ||||
|  | ||||
|         // NOTE: Do not place your application dependencies here; they belong | ||||
|         // in the individual module build.gradle files | ||||
|   | ||||
| @@ -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.6-bin.zip | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||||
|   | ||||
| @@ -18,6 +18,10 @@ android { | ||||
|             debuggable false | ||||
|         } | ||||
|     } | ||||
|  | ||||
|     buildFeatures { | ||||
|         buildConfig true | ||||
|     } | ||||
|     compileOptions { | ||||
|         targetCompatibility 11 | ||||
|         sourceCompatibility 11 | ||||
|   | ||||
| @@ -6,7 +6,7 @@ buildscript { | ||||
|         mavenCentral() | ||||
|     } | ||||
|     dependencies { | ||||
|         classpath "com.android.tools.build:gradle:7.4.0" | ||||
|         classpath "com.android.tools.build:gradle:8.4.0" | ||||
|  | ||||
|         // NOTE: Do not place your application dependencies here; they belong | ||||
|         // in the individual module build.gradle files | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| #Tue Sep 20 20:32:06 CEST 2016 | ||||
| #Tue Oct 08 15:41:22 CEST 2024 | ||||
| distributionBase=GRADLE_USER_HOME | ||||
| distributionPath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip | ||||
| zipStoreBase=GRADLE_USER_HOME | ||||
| zipStorePath=wrapper/dists | ||||
| distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip | ||||
|   | ||||
| @@ -40,7 +40,7 @@ | ||||
| 	  </intent> | ||||
|   </queries>			 | ||||
| 			 | ||||
| 	<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="33" /> | ||||
| 	<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="33" /> | ||||
|   <permission android:description="@string/permission_desc2" android:icon="@drawable/ic_launcher_offline" android:label="KP2A entry search" android:name="keepass2android.keepass2android_nonet.permission.KP2aInternalSearch" android:protectionLevel="signature" /> | ||||
|   <permission android:description="@string/permission_desc3" android:icon="@drawable/ic_launcher_offline" android:label="KP2A choose autofill dataset" android:name="keepass2android.keepass2android_nonet.permission.Kp2aChooseAutofill" android:protectionLevel="signature" /> | ||||
| 	<application  | ||||
|   | ||||
| @@ -828,7 +828,7 @@ namespace keepass2android | ||||
| 							new DropboxAppFolderFileStorage(LocaleManager.LocalizedAppContext, this), | ||||
|                             GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(LocaleManager.LocalizedAppContext)==ConnectionResult.Success ? new GoogleDriveFileStorage(LocaleManager.LocalizedAppContext, this) : null, | ||||
|                             GoogleApiAvailability.Instance.IsGooglePlayServicesAvailable(LocaleManager.LocalizedAppContext)==ConnectionResult.Success ? new GoogleDriveAppDataFileStorage(LocaleManager.LocalizedAppContext, this) : null, | ||||
| 							new OneDriveFileStorage(LocaleManager.LocalizedAppContext, this), | ||||
| 							new OneDriveFileStorage(), | ||||
| 						    new OneDrive2FullFileStorage(), | ||||
| 						    new OneDrive2MyFilesFileStorage(), | ||||
| 						    new OneDrive2AppFolderFileStorage(), | ||||
|   | ||||
| @@ -88,7 +88,7 @@ | ||||
|   </Choose> | ||||
|   <ItemGroup Condition=" '$(Flavor)'=='NoNet' "> | ||||
|     <PackageReference Include="Newtonsoft.Json"> | ||||
|       <Version>13.0.1</Version> | ||||
|       <Version>13.0.3</Version> | ||||
|     </PackageReference> | ||||
|   </ItemGroup> | ||||
|   <ItemGroup> | ||||
|   | ||||
| @@ -13,9 +13,6 @@ using keepass2android.services.AutofillBase.model; | ||||
| using System.Linq; | ||||
| using Android.Content.PM; | ||||
| using Kp2aAutofillParser; | ||||
| #if !NoNet | ||||
| using Com.Dropbox.Core.V2.Teamlog; | ||||
| #endif | ||||
| using AlertDialog = Android.App.AlertDialog; | ||||
|  | ||||
| namespace keepass2android.services.AutofillBase | ||||
|   | ||||
		Reference in New Issue
	
	Block a user