Install provider

This commit is contained in:
M66B 2023-12-06 21:25:36 +01:00
parent 2fde15a52c
commit 7195603350
11 changed files with 93 additions and 8 deletions

View File

@ -513,6 +513,7 @@ dependencies {
def exif_version = "1.3.6"
def biometric_version = "1.2.0-alpha05"
def billingclient_version = "6.0.1"
def playservicesbase_version = "18.2.0";
def javamail_version = "1.6.7"
def jsoup_version = "1.16.2"
def jsonpath_version = "2.8.0"
@ -654,6 +655,12 @@ dependencies {
largeImplementation "com.android.billingclient:billing:$billingclient_version"
playImplementation "com.android.billingclient:billing:$billingclient_version"
// https://mvnrepository.com/artifact/com.google.android.gms/play-services-base
//githubImplementation "com.google.android.gms:play-services-basement:$playservicesbase_version"
//largeImplementation "com.google.android.gms:play-services-basement:$playservicesbase_version"
//playImplementation "com.google.android.gms:play-services-basement:$playservicesbase_version"
implementation "com.google.android.gms:play-services-basement:$playservicesbase_version"
// https://developer.amazon.com/docs/in-app-purchasing/iap-get-started.html
amazonImplementation files('lib/in-app-purchasing-2.0.76.jar')

View File

@ -111,7 +111,7 @@
</queries>
<application
android:name=".ApplicationEx"
android:name=".ApplicationSecure"
android:allowBackup="false"
android:appCategory="productivity"
android:dataExtractionRules="@xml/data_extraction_rules"

View File

@ -0,0 +1,26 @@
package eu.faircode.email;
import android.content.Intent;
import com.google.android.gms.security.ProviderInstaller;
public class ApplicationSecure extends ApplicationEx implements ProviderInstaller.ProviderInstallListener {
@Override
public void onCreate() {
super.onCreate();
Log.i("Security provider check");
ProviderInstaller.installIfNeededAsync(this, this);
}
@Override
public void onProviderInstalled() {
Log.i("Security provider installed");
}
@Override
public void onProviderInstallFailed(int errorCode, Intent recoveryIntent) {
Log.i("Security provider install failed" +
" errorCode=" + errorCode +
" recoveryIntent=" + recoveryIntent);
}
}

View File

@ -119,7 +119,7 @@
</queries>
<application
android:name=".ApplicationEx"
android:name=".ApplicationSecure"
android:allowBackup="false"
android:appCategory="productivity"
android:dataExtractionRules="@xml/data_extraction_rules"

View File

@ -118,7 +118,7 @@
</queries>
<application
android:name=".ApplicationEx"
android:name=".ApplicationSecure"
android:allowBackup="false"
android:appCategory="productivity"
android:dataExtractionRules="@xml/data_extraction_rules"

View File

@ -0,0 +1,26 @@
package eu.faircode.email;
import android.content.Intent;
import com.google.android.gms.security.ProviderInstaller;
public class ApplicationSecure extends ApplicationEx implements ProviderInstaller.ProviderInstallListener {
@Override
public void onCreate() {
super.onCreate();
Log.i("Security provider check");
ProviderInstaller.installIfNeededAsync(this, this);
}
@Override
public void onProviderInstalled() {
Log.i("Security provider installed");
}
@Override
public void onProviderInstallFailed(int errorCode, Intent recoveryIntent) {
Log.i("Security provider install failed" +
" errorCode=" + errorCode +
" recoveryIntent=" + recoveryIntent);
}
}

View File

@ -118,7 +118,7 @@
</queries>
<application
android:name=".ApplicationEx"
android:name=".ApplicationSecure"
android:allowBackup="false"
android:appCategory="productivity"
android:dataExtractionRules="@xml/data_extraction_rules"

View File

@ -111,7 +111,7 @@
</queries>
<application
android:name=".ApplicationEx"
android:name=".ApplicationSecure"
android:allowBackup="false"
android:appCategory="productivity"
android:dataExtractionRules="@xml/data_extraction_rules"

View File

@ -235,14 +235,14 @@ public class EmailService implements AutoCloseable {
Log.i("Timeout=" + timeout);
if (purpose == PURPOSE_SEARCH) {
properties.put("mail." + protocol + ".connectiontimeout", Integer.toString(timeout));
properties.put("mail." + protocol + ".writetimeout", Integer.toString(SEARCH_TIMEOUT));
//properties.put("mail." + protocol + ".writetimeout", Integer.toString(SEARCH_TIMEOUT));
properties.put("mail." + protocol + ".timeout", Integer.toString(SEARCH_TIMEOUT));
} else {
int factor = 2;
if ("smtp".equals(protocol) || "smtps".equals(protocol))
factor *= 2;
properties.put("mail." + protocol + ".connectiontimeout", Integer.toString(timeout));
properties.put("mail." + protocol + ".writetimeout", Integer.toString(timeout * factor));
//properties.put("mail." + protocol + ".writetimeout", Integer.toString(timeout * factor));
properties.put("mail." + protocol + ".timeout", Integer.toString(timeout * factor));
}

View File

@ -111,7 +111,7 @@
</queries>
<application
android:name=".ApplicationEx"
android:name=".ApplicationSecure"
android:allowBackup="false"
android:appCategory="productivity"
android:dataExtractionRules="@xml/data_extraction_rules"

View File

@ -0,0 +1,26 @@
package eu.faircode.email;
import android.content.Intent;
import com.google.android.gms.security.ProviderInstaller;
public class ApplicationSecure extends ApplicationEx implements ProviderInstaller.ProviderInstallListener {
@Override
public void onCreate() {
super.onCreate();
Log.i("Security provider check");
ProviderInstaller.installIfNeededAsync(this, this);
}
@Override
public void onProviderInstalled() {
Log.i("Security provider installed");
}
@Override
public void onProviderInstallFailed(int errorCode, Intent recoveryIntent) {
Log.i("Security provider install failed" +
" errorCode=" + errorCode +
" recoveryIntent=" + recoveryIntent);
}
}