diff options
author | Jose Luis Marti <joseluis.marti@gmail.com> | 2023-03-15 15:38:01 +0100 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2024-01-11 04:55:52 +1000 |
commit | 4dc177bf0635a19c5180c54ce25fdf94e76e0c7e (patch) | |
tree | eac9c09edd7c776f57d4b2947622dc6b86974eeb | |
parent | 6fb2bfc7ff210748a116d5b7018ee8ae222bf580 (diff) |
[Android] Remove OBB expansion files
-rw-r--r-- | cmake/scripts/android/Install.cmake | 2 | ||||
-rw-r--r-- | tools/android/packaging/Makefile.in | 11 | ||||
-rw-r--r-- | tools/android/packaging/xbmc/src/Splash.java.in | 171 | ||||
-rw-r--r-- | tools/buildsteps/android-arm64-v8a/package | 10 | ||||
-rw-r--r-- | tools/buildsteps/android-x86_64/package | 10 | ||||
-rw-r--r-- | tools/buildsteps/android/package | 10 | ||||
-rw-r--r-- | tools/buildsteps/androidx86/package | 10 |
7 files changed, 9 insertions, 215 deletions
diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake index bbe5ea0bb8..f39b858519 100644 --- a/cmake/scripts/android/Install.cmake +++ b/cmake/scripts/android/Install.cmake @@ -150,7 +150,7 @@ add_bundle_file(${SMBCLIENT_LIBRARY} ${libdir} "") if(CPU MATCHES i686) set(CPU x86) endif() -foreach(target apk obb apk-obb apk-clean) +foreach(target apk apk-clean) add_custom_target(${target} COMMAND env PATH=${NATIVEPREFIX}/bin:$ENV{PATH} ${CMAKE_MAKE_PROGRAM} -j1 -C ${CMAKE_BINARY_DIR}/tools/android/packaging diff --git a/tools/android/packaging/Makefile.in b/tools/android/packaging/Makefile.in index d3a4d17c62..3bbaab54e6 100644 --- a/tools/android/packaging/Makefile.in +++ b/tools/android/packaging/Makefile.in @@ -61,10 +61,6 @@ all: apk apk: apk-clean sharedapk package -obb: apk-clean sharedobb - -apk-obb: apk-clean sharedobb package - xbmc/assets: mkdir -p xbmc/assets @@ -81,11 +77,6 @@ shared: sharedapk: shared | xbmc/assets cp -rfp assets/* ./xbmc/assets -sharedobb: shared - rm -f $(CMAKE_SOURCE_DIR)/main.@APP_NAME_LC@.obb - $(ZIP) -9 -q -r $(CMAKE_SOURCE_DIR)/main.@APP_NAME_LC@.obb assets - @echo "$(CMAKE_SOURCE_DIR)/main.@APP_NAME_LC@.obb created" - python: | xbmc/assets mkdir -p xbmc/assets/python@PYTHON_VERSION@/lib/ cp -rfp $(PREFIX)/lib/python@PYTHON_VERSION@ xbmc/assets/python@PYTHON_VERSION@/lib/ @@ -150,5 +141,5 @@ apk-clean: rm -f xbmc/res/drawable-xxxhdpi/splash.* rm -rf assets -.PHONY: force libs assets python sharedapk sharedobb res package +.PHONY: force libs assets python sharedapk res package diff --git a/tools/android/packaging/xbmc/src/Splash.java.in b/tools/android/packaging/xbmc/src/Splash.java.in index 3b51c7cd00..63f798d04d 100644 --- a/tools/android/packaging/xbmc/src/Splash.java.in +++ b/tools/android/packaging/xbmc/src/Splash.java.in @@ -38,8 +38,6 @@ import java.io.InputStream; import java.io.IOException; import java.io.OutputStream; import java.lang.System; -import java.net.HttpURLConnection; -import java.net.URL; import java.util.ArrayList; import java.util.Enumeration; import java.util.List; @@ -66,8 +64,6 @@ public class Splash extends Activity private static final int CheckingPermissionsInfo = 11; private static final int CheckExternalStorage = 12; private static final int RecordAudioPermission = 13; - private static final int DownloadingObb = 90; - private static final int DownloadObbDone = 91; private static final int StartingXBMC = 99; private static final String TAG = "@APP_NAME@"; @@ -178,11 +174,6 @@ public class Splash extends Activity mSplash.mTextView.setText("Clearing cache..."); mSplash.mProgress.setVisibility(View.INVISIBLE); break; - case DownloadingObb: - break; - case DownloadObbDone: - new FillCache(mSplash).execute(); - break; case Caching: if (!mCachingDone) new FillCache(mSplash).execute(); @@ -250,136 +241,6 @@ public class Splash extends Activity private StateMachine mStateMachine = new StateMachine(this); - private class DownloadObb extends AsyncTask<String, Integer, Integer> - { - private Splash mSplash = null; - private int mProgressStatus = 0; - - public DownloadObb(Splash splash) - { - this.mSplash = splash; - } - - @Override - protected Integer doInBackground(String... sUrl) - { - InputStream input = null; - OutputStream output = null; - HttpURLConnection connection = null; - - String src = sUrl[0]; - String dest = sUrl[1]; - File fObb = new File(dest); - - Log.d(TAG, "Downloading " + src + " to " + dest); - - if (!fObb.getParentFile().exists() && !fObb.getParentFile().mkdirs()) - { - Log.e(TAG, "Error creating directory " + fObb.getParentFile().getAbsolutePath()); - return -1; - } - - int ret = 0; - try - { - URL url = new URL(src); - connection = (HttpURLConnection) url.openConnection(); - connection.connect(); - - // expect HTTP 200 OK, so we don't mistakenly save error report - // instead of the file - if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) - { - return -1; - } - - // this will be useful to display download percentage - // might be -1: server did not report the length - int fileLength = connection.getContentLength(); - - // download the file - input = connection.getInputStream(); - output = new FileOutputStream(dest); - - byte data[] = new byte[4096]; - long total = 0; - int count; - mProgress.setProgress(0); - mProgress.setMax(fileLength); - while ((count = input.read(data)) != -1) - { - // allow canceling with back button - if (isCancelled()) - { - ret = -1; - break; - } - total += count; - // publishing the progress.... - if (fileLength > 0) // only if total length is known - publishProgress((int) total); - output.write(data, 0, count); - } - } - catch (Exception e) - { - return -1; - } - finally - { - try - { - if (output != null) - output.close(); - if (input != null) - input.close(); - } - catch (IOException ignored) - { - } - - if (connection != null) - connection.disconnect(); - } - if (ret == 0) - mState = DownloadObbDone; - else - fObb.delete(); - - publishProgress(0); - return ret; - } - - @Override - protected void onProgressUpdate(Integer... values) - { - switch (mState) - { - case DownloadingObb: - mSplash.mTextView.setText("Downloading OBB..."); - mSplash.mProgress.setVisibility(View.VISIBLE); - mSplash.mProgress.setProgress(values[0]); - break; - case DownloadObbDone: - mSplash.mProgress.setVisibility(View.INVISIBLE); - break; - } - } - - @Override - protected void onPostExecute(Integer result) - { - super.onPostExecute(result); - if (result < 0) - { - mState = InError; - mErrorMsg = "Cannot download obb."; - } - - mStateMachine.sendEmptyMessage(mState); - } - } - private class FillCache extends AsyncTask<Void, Integer, Integer> { @@ -649,32 +510,6 @@ public class Splash extends Activity sPackagePath = getPackageResourcePath(); fPackagePath = new File(sPackagePath); - String obbfn = ""; - if (fPackagePath.length() < 50 * 1024 * 1024) - { - sPackagePath = XBMCProperties.getStringProperty("@APP_NAME_LC@.obb", ""); - if (sPackagePath.equals("")) - { - try - { - obbfn = "main." + getPackageManager().getPackageInfo(getPackageName(), 0).versionCode + "." + getPackageName() + ".obb"; - sPackagePath = Environment.getExternalStorageDirectory() - + "/Android/obb/" + getPackageName() + "/" + obbfn; - } - catch (Exception e) - { - } - } - - fPackagePath = new File(sPackagePath); - if (fPackagePath.length() < 10 * 1024 * 1024) - fPackagePath.delete(); // borked download - if (!fPackagePath.exists()) - { - mState = DownloadingObb; - new DownloadObb(this).execute("http://mirrors.@APP_NAME_LC@.tv/releases/android/obb/" + obbfn, sPackagePath); - } - } } private boolean ParseCpuFeature() @@ -980,7 +815,7 @@ public class Splash extends Activity SetupEnvironment(); - if ((mState != DownloadingObb && mState != InError) && fXbmcHome.exists() && fXbmcHome.lastModified() >= fPackagePath.lastModified() && !mInstallLibs) + if (mState != InError && fXbmcHome.exists() && fXbmcHome.lastModified() >= fPackagePath.lastModified() && !mInstallLibs) { mState = CachingDone; mCachingDone = true; @@ -988,7 +823,7 @@ public class Splash extends Activity } } - if ((mState != DownloadingObb && mState != InError) && mCachingDone && mExternalStorageChecked && mPermissionOK) + if (mState != InError && mCachingDone && mExternalStorageChecked && mPermissionOK) { startXBMC(); return; @@ -998,7 +833,7 @@ public class Splash extends Activity mProgress = (ProgressBar) findViewById(R.id.progressBar1); mTextView = (TextView) findViewById(R.id.textView1); - if (mState == DownloadingObb || mState == InError || mState == CheckingPermissionsInfo) + if (mState == InError || mState == CheckingPermissionsInfo) { mStateMachine.sendEmptyMessage(mState); return; diff --git a/tools/buildsteps/android-arm64-v8a/package b/tools/buildsteps/android-arm64-v8a/package index 18bfe28a96..d1ddf4821d 100644 --- a/tools/buildsteps/android-arm64-v8a/package +++ b/tools/buildsteps/android-arm64-v8a/package @@ -2,11 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv -if [ "x$BUILD_OBB" == "xtrue" ]; then - TARGET=apk-obb -else - TARGET=apk -fi +TARGET=apk cd $WORKSPACE/build;make -j$BUILDTHREADS $TARGET @@ -16,7 +12,3 @@ cd $WORKSPACE #e.x. xbmc-20130314-8c2fb31-Frodo-arm64-v8a.apk UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-arm64-v8a" mv kodiapp-arm64-v8a-*.apk $UPLOAD_FILENAME.apk -if [ -f *.obb ] -then - mv *.obb $UPLOAD_FILENAME.obb -fi diff --git a/tools/buildsteps/android-x86_64/package b/tools/buildsteps/android-x86_64/package index b587134228..b477126abf 100644 --- a/tools/buildsteps/android-x86_64/package +++ b/tools/buildsteps/android-x86_64/package @@ -2,11 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv -if [ "x$BUILD_OBB" == "xtrue" ]; then - TARGET=apk-obb -else - TARGET=apk -fi +TARGET=apk cd $WORKSPACE/build;make -j$BUILDTHREADS $TARGET @@ -16,7 +12,3 @@ cd $WORKSPACE #e.x. xbmc-20130314-8c2fb31-Frodo-x86_64.apk UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-x86_64" mv kodiapp-x86_64-*.apk $UPLOAD_FILENAME.apk -if [ -f *.obb ] -then - mv *.obb $UPLOAD_FILENAME.obb -fi diff --git a/tools/buildsteps/android/package b/tools/buildsteps/android/package index 65643ed3ad..cbe3607957 100644 --- a/tools/buildsteps/android/package +++ b/tools/buildsteps/android/package @@ -2,11 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv -if [ "x$BUILD_OBB" == "xtrue" ]; then - TARGET=apk-obb -else - TARGET=apk -fi +TARGET=apk cd $WORKSPACE/build;make -j$BUILDTHREADS $TARGET @@ -16,7 +12,3 @@ cd $WORKSPACE #e.x. xbmc-20130314-8c2fb31-Frodo-armeabi-v7a.apk UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-armeabi-v7a" mv kodiapp-armeabi-*.apk $UPLOAD_FILENAME.apk -if [ -f *.obb ] -then - mv *.obb $UPLOAD_FILENAME.obb -fi diff --git a/tools/buildsteps/androidx86/package b/tools/buildsteps/androidx86/package index b0074d2e52..4e8ca13ba0 100644 --- a/tools/buildsteps/androidx86/package +++ b/tools/buildsteps/androidx86/package @@ -2,11 +2,7 @@ WORKSPACE=${WORKSPACE:-$( cd $(dirname $0)/../../.. ; pwd -P )} XBMC_PLATFORM_DIR=android . $WORKSPACE/tools/buildsteps/defaultenv -if [ "x$BUILD_OBB" == "xtrue" ]; then - TARGET=apk-obb -else - TARGET=apk -fi +TARGET=apk cd $WORKSPACE/build;make -j$BUILDTHREADS $TARGET @@ -16,7 +12,3 @@ cd $WORKSPACE #e.x. xbmc-20130314-8c2fb31-Frodo-x86.apk UPLOAD_FILENAME="kodi-$(getBuildRevDateStr)-x86" mv kodiapp-x86-*.apk $UPLOAD_FILENAME.apk -if [ -f *.obb ] -then - mv *.obb $UPLOAD_FILENAME.obb -fi |