mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
Enable libcurl on android
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
android:name="android.hardware.type.pc"
|
||||
android:required="false"
|
||||
/>
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
@ANDROID_PERMISSIONS@
|
||||
<application
|
||||
android:label="@string/app_name"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
@@ -43,6 +43,7 @@
|
||||
>
|
||||
<activity
|
||||
android:name=".PowderActivity"
|
||||
android:screenOrientation="landscape"
|
||||
android:label="@string/app_name"
|
||||
android:alwaysRetainTaskState="true"
|
||||
android:launchMode="singleInstance"
|
||||
|
@@ -1,7 +1,42 @@
|
||||
package @APPID@;
|
||||
|
||||
import org.libsdl.app.SDLActivity;
|
||||
import java.security.KeyStore;
|
||||
import java.security.KeyStoreException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.Enumeration;
|
||||
import java.io.IOException;
|
||||
import java.util.Base64;
|
||||
|
||||
public class PowderActivity extends SDLActivity
|
||||
{
|
||||
public static String getCertificateBundle()
|
||||
{
|
||||
String allPems = "";
|
||||
try {
|
||||
KeyStore ks = KeyStore.getInstance("AndroidCAStore");
|
||||
if (ks != null) {
|
||||
ks.load(null, null);
|
||||
Enumeration<String> aliases = ks.aliases();
|
||||
while (aliases.hasMoreElements()) {
|
||||
String alias = (String)aliases.nextElement();
|
||||
java.security.cert.X509Certificate cert = (java.security.cert.X509Certificate)ks.getCertificate(alias);
|
||||
allPems += "-----BEGIN CERTIFICATE-----\n" + Base64.getMimeEncoder().encodeToString(cert.getEncoded()) + "\n-----END CERTIFICATE-----\n";;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
} catch (KeyStoreException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
} catch (java.security.cert.CertificateException e) {
|
||||
e.printStackTrace();
|
||||
return "";
|
||||
}
|
||||
return allPems;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user