diff --git a/.gitignore b/.gitignore index 000f857e..78aa98fb 100644 --- a/.gitignore +++ b/.gitignore @@ -52,3 +52,5 @@ local.properties **/fastlane/izzyscript/iod-scan-apk.php **/fastlane/izzyscript/current_iod-scan-apk.php **/fastlane/izzyscript/current_result_*.json + +flake.lock \ No newline at end of file diff --git a/buildapk.sh b/buildapk.sh new file mode 100644 index 00000000..67577362 --- /dev/null +++ b/buildapk.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +KEY_STORE=$HOME/.config/upload-keystore.jks +KEY_ALIAS=upload + +rm -rf presentation/build +./gradlew clean assembleApkstoreRelease +cd presentation/build/outputs/apk/apkstore/release/ +zipalign -p -f -v 4 presentation-apkstore-release-unsigned.apk cryptomator.apk +apksigner sign --ks $KEY_STORE --ks-key-alias $KEY_ALIAS -v cryptomator.apk +cp presentation/build/outputs/apk/apkstore/release/cryptomator.apk ../../../../../../ \ No newline at end of file diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..6faa7826 --- /dev/null +++ b/flake.nix @@ -0,0 +1,39 @@ +{ + description = "Cryptomator"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + android-nixpkgs = { + url = "github:tadfisher/android-nixpkgs/stable"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + + outputs = { self, android-nixpkgs, nixpkgs, flake-utils }: + flake-utils.lib.eachDefaultSystem + (system: + let pkgs = import nixpkgs { + inherit system; + config = { android_sdk.accept_license = true; allowUnfree = true; }; + }; in rec { + packages.android-sdk = android-nixpkgs.sdk.${system} (sdkPkgs: with sdkPkgs; [ + cmdline-tools-latest + build-tools-30-0-3 + build-tools-32-0-0 + platform-tools + platforms-android-30 + platforms-android-31 + emulator + patcher-v4 + ]); + devShells.default = pkgs.mkShell { + packages = [ packages.android-sdk pkgs.jdk11 pkgs.gradle ]; + GRADLE_OPTS = "-Dorg.gradle.project.android.aapt2FromMavenOverride=${packages.android-sdk}/share/android-sdk/build-tools/32.0.0/aapt2"; + shellHook = '' + export PATH=${packages.android-sdk}/share/android-sdk/build-tools/32.0.0:$PATH + ''; + }; + } + ); +} diff --git a/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt b/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt index 521083a2..82755fbb 100644 --- a/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt +++ b/presentation/src/main/java/org/cryptomator/presentation/presenter/VaultListPresenter.kt @@ -133,23 +133,7 @@ class VaultListPresenter @Inject constructor( // } } - override fun onError(e: Throwable) { - val license = if (e is LicenseNotValidException) { - e.license - } else { - "" - } - val intent = Intent(context(), LicenseCheckActivity::class.java) - intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_CLEAR_TASK - intent.data = Uri.parse(String.format("app://cryptomator/%s", license)) - - try { - context().startActivity(intent) - } catch (e: ActivityNotFoundException) { - Toast.makeText(context(), "Please contact the support.", Toast.LENGTH_LONG).show() - finish() - } - } + override fun onError(e: Throwable) {} }) } }