diff --git a/res/values/strings-no-translate.xml b/res/values/strings-no-translate.xml index 8624b335ab..c4bc21c709 100644 --- a/res/values/strings-no-translate.xml +++ b/res/values/strings-no-translate.xml @@ -9,6 +9,7 @@ http://github.com/paulscode/mupen64plus-ae/issues http://www.paulscode.com/forum/index.php?topic=836.msg7873#msg7873 http://www.paulscode.com/forum/index.php?topic=96.msg2243#msg2243 + tinyurl.com/bfbb4jc true/0:22,0:-31,1:21,1:-32,2:20,2:-33,3:19,3:-34,4:108,6:99,7:96,7:23,12:103,13:102,16:-1,17:-2,18:-3,19:-4 diff --git a/res/values/strings.xml b/res/values/strings.xml index 6fbb8ccb3c..a4ed4c6d7e 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -288,6 +288,7 @@ Initializing %1$.0f%% done: %2$s Finished + Error extracting app data.\nPlease unplug USB cable, reboot device, and re-launch app.\nFor help, please visit %1$s. Cheats for %1$s diff --git a/src/paulscode/android/mupen64plusae/MainActivity.java b/src/paulscode/android/mupen64plusae/MainActivity.java index abd84415ad..b0e719b786 100644 --- a/src/paulscode/android/mupen64plusae/MainActivity.java +++ b/src/paulscode/android/mupen64plusae/MainActivity.java @@ -119,24 +119,34 @@ public void run() { // This runs on non-UI thread and ensures that the app is responsive during the lengthy // extraction process + boolean success = true; // Extract the assets if they are out of date if( mAppData.getAssetVersion() != ASSET_VERSION ) { FileUtil.deleteFolder( new File( mAppData.dataDir ) ); mAssetsExtracted = 0; - AssetExtractor.extractAssets( getAssets(), SOURCE_DIR, mAppData.dataDir, + success = AssetExtractor.extractAssets( getAssets(), SOURCE_DIR, mAppData.dataDir, MainActivity.this ); - mAppData.putAssetVersion( ASSET_VERSION ); } - updateText( R.string.assetExtractor_finished ); - - // Launch the MenuActivity - startActivity( new Intent( MainActivity.this, MenuActivity.class ) ); - - // We never want to come back to this activity, so finish it - finish(); + // Launch menu activity if successful; post failure notice otherwise + if( success ) + { + mAppData.putAssetVersion( ASSET_VERSION ); + updateText( R.string.assetExtractor_finished ); + + // Launch the MenuActivity + startActivity( new Intent( MainActivity.this, MenuActivity.class ) ); + + // We never want to come back to this activity, so finish it + finish(); + } + else + { + String weblink = getResources().getString( R.string.assetExtractor_help ); + updateText( R.string.assetExtractor_failed, weblink ); + } } }; diff --git a/src/paulscode/android/mupen64plusae/util/AssetExtractor.java b/src/paulscode/android/mupen64plusae/util/AssetExtractor.java index 1bc10fcb32..f295dcdf83 100644 --- a/src/paulscode/android/mupen64plusae/util/AssetExtractor.java +++ b/src/paulscode/android/mupen64plusae/util/AssetExtractor.java @@ -39,9 +39,11 @@ public interface OnExtractionProgressListener public void onExtractionProgress( String nextFileExtracted ); } - public static void extractAssets( AssetManager assetManager, String srcPath, String dstPath, + public static boolean extractAssets( AssetManager assetManager, String srcPath, String dstPath, OnExtractionProgressListener onProgress ) { + boolean result = true; + if( srcPath.startsWith( "/" ) ) srcPath = srcPath.substring( 1 ); @@ -89,8 +91,11 @@ public static void extractAssets( AssetManager assetManager, String srcPath, Str catch( IOException e ) { Log.w( "AssetExtractor", "Failed to extract asset file: " + srcPath ); + result = false; } } + + return result; } public static int countAssets( AssetManager assetManager, String srcPath )