diff options
author | fuzzard <fuzzard@users.noreply.github.com> | 2024-02-19 18:30:01 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-19 18:30:01 +1000 |
commit | 511d828268122060b01023c99912859eecfb17a0 (patch) | |
tree | f5583e8ecbebddf3a79df61bb5068fbe331c951d | |
parent | eb2363a08f81118f0f11ed642277f5f276873be9 (diff) | |
parent | 05941129d4fa8aedeba2af4e3c6f91c9aeb3dd1b (diff) |
Merge pull request #24735 from joseluismarti/splash
[Android] Remove unused code and improve extraction of the apk file
-rw-r--r-- | tools/android/packaging/xbmc/src/Splash.java.in | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/tools/android/packaging/xbmc/src/Splash.java.in b/tools/android/packaging/xbmc/src/Splash.java.in index d720e13119..930e05f571 100644 --- a/tools/android/packaging/xbmc/src/Splash.java.in +++ b/tools/android/packaging/xbmc/src/Splash.java.in @@ -28,20 +28,16 @@ import android.view.View; import android.widget.ProgressBar; import android.widget.TextView; -import java.io.BufferedOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStream; import java.io.IOException; import java.lang.System; -import java.util.ArrayList; import java.util.Enumeration; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -69,7 +65,6 @@ public class Splash extends Activity private static final int RECORDAUDIO_RESULT_CODE = 8946; private static final int PERMISSION_RESULT_CODE = 8947; - private ArrayList<String> mMounts = new ArrayList<String>(); private String mErrorMsg = ""; private ProgressBar mProgress = null; @@ -84,7 +79,6 @@ public class Splash extends Activity private File fPackagePath = null; private File fXbmcHome = null; private String sXbmcTemp = ""; - private File fXbmcTemp = null; private BroadcastReceiver mExternalStorageReceiver = null; private boolean mExternalStorageChecked = false; @@ -335,9 +329,8 @@ public class Splash extends Activity try { InputStream in = zip.getInputStream(e); - BufferedOutputStream out = new BufferedOutputStream( - new FileOutputStream(sFullPath)); - while ((n = in.read(buf, 0, 4096)) > -1) + FileOutputStream out = new FileOutputStream(sFullPath); + while ((n = in.read(buf)) > 0) out.write(buf, 0, n); in.close(); @@ -523,56 +516,6 @@ public class Splash extends Activity fPackagePath = new File(sPackagePath); } - // 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 - // devices and nothing else seems available. - // - // ParseMounts() was part of the attempts to solve the issue and is not in use currently, - // but kept for possible future use. - private boolean ParseMounts() - { - ProcessBuilder cmd; - final Pattern reMount = Pattern.compile("^(.+?)\\s+(.+?)\\s+(.+?)\\s"); - String strMounts = ""; - - try - { - String[] args = {"/system/bin/cat", "/proc/mounts"}; - cmd = new ProcessBuilder(args); - - Process process = cmd.start(); - InputStream in = process.getInputStream(); - byte[] re = new byte[1024]; - while (in.read(re) != -1) - { - strMounts = strMounts + new String(re); - } - in.close(); - } - catch (IOException ex) - { - ex.printStackTrace(); - return false; - } - - String[] Mounts = strMounts.split("\n"); - for (int i = 0; i < Mounts.length; ++i) - { - Log.d(TAG, "mount: " + Mounts[i]); - Matcher m = reMount.matcher(Mounts[i]); - if (m.find()) - { - if (m.group(1).startsWith("/dev/block/vold") && !m.group(2).startsWith("/mnt/secure/asec")) - { - Log.d(TAG, "adding mount: " + m.group(2)); - mMounts.add(m.group(2)); - } - } - } - return true; - } - private boolean CheckPermissions() { boolean retVal = false; |