From f7a7da55d4aac02ef4489789c4517bb0b53de821 Mon Sep 17 00:00:00 2001 From: Jose Luis Marti Date: Sun, 18 Feb 2024 19:07:24 +0100 Subject: Remove unused ParseMounts() method and related code --- tools/android/packaging/xbmc/src/Splash.java.in | 54 ------------------------- 1 file changed, 54 deletions(-) diff --git a/tools/android/packaging/xbmc/src/Splash.java.in b/tools/android/packaging/xbmc/src/Splash.java.in index d720e13119..4280571cdf 100644 --- a/tools/android/packaging/xbmc/src/Splash.java.in +++ b/tools/android/packaging/xbmc/src/Splash.java.in @@ -35,13 +35,10 @@ 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 +66,6 @@ public class Splash extends Activity private static final int RECORDAUDIO_RESULT_CODE = 8946; private static final int PERMISSION_RESULT_CODE = 8947; - private ArrayList mMounts = new ArrayList(); private String mErrorMsg = ""; private ProgressBar mProgress = null; @@ -523,56 +519,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; -- cgit v1.2.3 From bdca4d86e9e54b9f65cffa64fe5aade13a02c042 Mon Sep 17 00:00:00 2001 From: Jose Luis Marti Date: Sun, 18 Feb 2024 19:20:25 +0100 Subject: Remove unnecessary fXbmcTemp variable --- tools/android/packaging/xbmc/src/Splash.java.in | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/android/packaging/xbmc/src/Splash.java.in b/tools/android/packaging/xbmc/src/Splash.java.in index 4280571cdf..f8f90460ff 100644 --- a/tools/android/packaging/xbmc/src/Splash.java.in +++ b/tools/android/packaging/xbmc/src/Splash.java.in @@ -80,7 +80,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; -- cgit v1.2.3 From 05941129d4fa8aedeba2af4e3c6f91c9aeb3dd1b Mon Sep 17 00:00:00 2001 From: Jose Luis Marti Date: Sun, 18 Feb 2024 20:04:16 +0100 Subject: Improve code that extracts the apk file --- tools/android/packaging/xbmc/src/Splash.java.in | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tools/android/packaging/xbmc/src/Splash.java.in b/tools/android/packaging/xbmc/src/Splash.java.in index f8f90460ff..930e05f571 100644 --- a/tools/android/packaging/xbmc/src/Splash.java.in +++ b/tools/android/packaging/xbmc/src/Splash.java.in @@ -28,7 +28,6 @@ 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; @@ -330,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(); -- cgit v1.2.3