Bump android SDK version back up to 26 to avoid 'this app was built for an older version of android and doesn't include the latest privacy protections' message when installing

I also set StrictMode.disableDeathOnFileUriExposure using some disgusting reflection so screenshots can continue to use file:// urls instead of content:// urls
This commit is contained in:
UnknownShadow200 2020-10-22 23:54:50 +11:00
parent d717c51059
commit 856c7a2f2a
2 changed files with 12 additions and 2 deletions

View File

@ -1,12 +1,12 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 23 compileSdkVersion 26
defaultConfig { defaultConfig {
applicationId = 'com.classicube.android.client' applicationId = 'com.classicube.android.client'
minSdkVersion 13 minSdkVersion 13
targetSdkVersion 23 targetSdkVersion 26
externalNativeBuild { externalNativeBuild {
cmake { cmake {
arguments '-DANDROID_STL=c++_static' arguments '-DANDROID_STL=c++_static'

View File

@ -1,6 +1,7 @@
package com.classicube; package com.classicube;
import java.io.File; import java.io.File;
import java.io.InputStream; import java.io.InputStream;
import java.lang.reflect.Method;
import java.net.HttpURLConnection; import java.net.HttpURLConnection;
import java.net.URL; import java.net.URL;
import java.util.ArrayList; import java.util.ArrayList;
@ -20,6 +21,7 @@ import android.content.res.Configuration;
import android.graphics.PixelFormat; import android.graphics.PixelFormat;
import android.net.Uri; import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.StrictMode;
import android.text.Editable; import android.text.Editable;
import android.text.InputType; import android.text.InputType;
import android.text.Selection; import android.text.Selection;
@ -140,6 +142,14 @@ public class MainActivity extends Activity implements SurfaceHolder.Callback2 {
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_UNSPECIFIED | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
// TODO: semaphore for destroyed and surfaceDestroyed // TODO: semaphore for destroyed and surfaceDestroyed
// avoid FileUriExposed exceptions when taking screenshots
try {
Method m = StrictMode.class.getMethod("disableDeathOnFileUriExposure");
m.invoke(null);
} catch (Exception ex) {
ex.printStackTrace();
}
Log.i("CC_WIN", "handing off to native.."); Log.i("CC_WIN", "handing off to native..");
System.loadLibrary("classicube"); System.loadLibrary("classicube");