1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-02 00:10:22 +02:00

fix downloading mods on Android 4.4

fixes TLS issue
This commit is contained in:
Andrey Filipenkov 2023-03-04 14:35:56 +03:00
parent cd454143be
commit c62d945b2d
2 changed files with 15 additions and 0 deletions

View File

@ -157,4 +157,6 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-base:18.2.0'
implementation 'com.google.android.gms:play-services-basement:18.1.0'
}

View File

@ -19,6 +19,11 @@ import android.view.MenuItem;
import android.view.View;
import android.widget.TextView;
import com.google.android.gms.common.GooglePlayServicesNotAvailableException;
import com.google.android.gms.common.GooglePlayServicesRepairableException;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.security.ProviderInstaller;
import org.json.JSONException;
import org.json.JSONObject;
@ -78,6 +83,14 @@ public class ActivityMods extends ActivityWithToolbar
mRecycler.setAdapter(mModsAdapter);
new AsyncLoadLocalMods().execute((Void) null);
try {
ProviderInstaller.installIfNeeded(this);
} catch (GooglePlayServicesRepairableException e) {
GooglePlayServicesUtil.getErrorDialog(e.getConnectionStatusCode(), this, 0);
} catch (GooglePlayServicesNotAvailableException e) {
Log.e("SecurityException", "Google Play Services not available.");
}
}
private void loadLocalModData() throws IOException, JSONException