aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Luis Marti <joseluis.marti@gmail.com>2024-01-15 17:33:07 +0100
committerJose Luis Marti <joseluis.marti@gmail.com>2024-01-22 09:17:45 +0100
commitd27f1b16049564b73abce620635d41b23e0558aa (patch)
tree2122557138ffe1f17eba0f5d58d71c4a7a80a729
parentec5fff32835210b9c8bc1b74ab57681ca895d7b6 (diff)
[Android] ABI check removal
-rw-r--r--tools/android/packaging/Makefile.in4
-rw-r--r--tools/android/packaging/xbmc/src/Splash.java.in105
2 files changed, 1 insertions, 108 deletions
diff --git a/tools/android/packaging/Makefile.in b/tools/android/packaging/Makefile.in
index 3bbaab54e6..236b67f257 100644
--- a/tools/android/packaging/Makefile.in
+++ b/tools/android/packaging/Makefile.in
@@ -83,8 +83,7 @@ python: | xbmc/assets
cd xbmc/assets/python@PYTHON_VERSION@/lib/python@PYTHON_VERSION@/; rm -rf test config config-@PYTHON_VERSION@ lib-dynload ; find . -name "*.so" -exec rm -f {} \;
res:
- mkdir -p xbmc/res xbmc/res/raw xbmc/res/values images
- @echo "native_arch=$(CPU)" > xbmc/res/raw/xbmc.properties
+ mkdir -p xbmc/res xbmc/res/values images
cp -fp $(CMAKE_SOURCE_DIR)/media/splash.* xbmc/res/drawable/
cp -fp media/drawable-hdpi/ic_launcher.png xbmc/res/drawable-hdpi/ic_launcher.png
cp -fp media/drawable-ldpi/ic_launcher.png xbmc/res/drawable-ldpi/ic_launcher.png
@@ -135,7 +134,6 @@ apk-clean:
rm -rf xbmc/lib
rm -rf xbmc/assets
rm -rf xbmc/obj
- rm -rf xbmc/res/raw
rm -rf xbmc/res/values
rm -f xbmc/res/drawable/splash.*
rm -f xbmc/res/drawable-xxxhdpi/splash.*
diff --git a/tools/android/packaging/xbmc/src/Splash.java.in b/tools/android/packaging/xbmc/src/Splash.java.in
index 63f798d04d..3a3df22e75 100644
--- a/tools/android/packaging/xbmc/src/Splash.java.in
+++ b/tools/android/packaging/xbmc/src/Splash.java.in
@@ -13,8 +13,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentFilter;
-import android.content.res.Resources;
-import android.content.res.Resources.NotFoundException;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
@@ -36,7 +34,6 @@ import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.IOException;
-import java.io.OutputStream;
import java.lang.System;
import java.util.ArrayList;
import java.util.Enumeration;
@@ -71,7 +68,6 @@ public class Splash extends Activity
private static final int RECORDAUDIO_RESULT_CODE = 8946;
private static final int PERMISSION_RESULT_CODE = 8947;
- private String mCpuinfo = "";
private ArrayList<String> mMounts = new ArrayList<String>();
private String mErrorMsg = "";
@@ -512,32 +508,6 @@ public class Splash extends Activity
fPackagePath = new File(sPackagePath);
}
- private boolean ParseCpuFeature()
- {
- ProcessBuilder cmd;
-
- try
- {
- String[] args = {"/system/bin/cat", "/proc/cpuinfo"};
- cmd = new ProcessBuilder(args);
-
- Process process = cmd.start();
- InputStream in = process.getInputStream();
- byte[] re = new byte[1024];
- while (in.read(re) != -1)
- {
- mCpuinfo = mCpuinfo + new String(re);
- }
- in.close();
- }
- catch (IOException ex)
- {
- ex.printStackTrace();
- return false;
- }
- return true;
- }
-
// We can't find a way to properly detect and monitor status of
// a physical sdcard currently.
// "External storage" points to internal flash storage on modern
@@ -588,13 +558,6 @@ public class Splash extends Activity
return true;
}
- private boolean CheckCpuFeature(String feat)
- {
- final Pattern FeaturePattern = Pattern.compile("(?i):.*?\\s" + feat + "(?:\\s|$)");
- Matcher m = FeaturePattern.matcher(mCpuinfo);
- return m.find();
- }
-
private boolean CheckPermissions()
{
boolean retVal = false;
@@ -730,74 +693,6 @@ public class Splash extends Activity
mStateMachine.sendEmptyMessage(Checking);
- String pkg_arch = "";
- // Read the properties
- try
- {
- Resources resources = this.getResources();
- InputStream xbmcprop = resources.openRawResource(R.raw.xbmc);
- Properties properties = new Properties();
- properties.load(xbmcprop);
- pkg_arch = properties.getProperty("native_arch");
- }
- catch (NotFoundException e)
- {
- mErrorMsg = "Cannot find properties file";
- Log.e(TAG, mErrorMsg);
- mState = InError;
- }
- catch (IOException e)
- {
- mErrorMsg = "Failed to open properties file";
- Log.e(TAG, mErrorMsg);
- mState = InError;
- }
-
- boolean arch_ok = false;
- String[] abis = Build.SUPPORTED_ABIS;
- for (int i = 0; i < abis.length; ++i)
- {
- Log.i(TAG, "ABI: " + abis[i]);
- if (abis[i].equalsIgnoreCase(pkg_arch))
- {
- arch_ok = true;
- //break;
- }
- }
-
- if (!arch_ok)
- {
- mErrorMsg = "This package is not compatible with your device (" + pkg_arch + ").\nPlease check the <a href=\"http://wiki.@APP_NAME_LC@.tv/index.php?title=XBMC_for_Android_specific_FAQ\">@APP_NAME@ Android wiki</a> for more information.";
- Log.e(TAG, mErrorMsg);
- mState = InError;
- }
-
- if (mState != InError)
- {
- if (pkg_arch.equalsIgnoreCase("armeabi-v7a"))
- {
- // arm arch: check if the cpu supports neon
- boolean ret = ParseCpuFeature();
- //Log.d(TAG, "/proc/cpuinfo = " + mCpuinfo);
- if (!ret)
- {
- mErrorMsg = "Error! Cannot parse CPU features.";
- Log.e(TAG, mErrorMsg);
- mState = InError;
- }
- else
- {
- ret = CheckCpuFeature("neon") || CheckCpuFeature("aarch64") || CheckCpuFeature("asimd"); // aarch64 is always neon; asimd feature also represents neon
- if (!ret)
- {
- mErrorMsg = "This @APP_NAME@ package is not compatible with your device (NEON).\nPlease check the <a href=\"http://wiki.@APP_NAME_LC@.tv/index.php?title=XBMC_for_Android_specific_FAQ\">@APP_NAME@ Android wiki</a> for more information.";
- Log.e(TAG, mErrorMsg);
- mState = InError;
- }
- }
- }
- }
-
Log.d(TAG, "External storage = " + Environment.getExternalStorageDirectory().getAbsolutePath() + "; state = " + Environment.getExternalStorageState());
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()))
mExternalStorageChecked = true;