Fix java launcher

This commit is contained in:
mittorn 2016-11-07 17:36:08 +00:00
parent 5a96a53b7d
commit 6ef6d0d27a
1 changed files with 1 additions and 24 deletions

View File

@ -56,7 +56,7 @@ public class LauncherActivity extends Activity {
launcher.addView(startButton);
setContentView(launcher);
mPref = getSharedPreferences("mod", 0);
extractPAK(this, false);
InstallReceiver.extractPAK(this, false);
cmdArgs.setText(mPref.getString("argv","-dev 3 -log"));
}
@ -77,27 +77,4 @@ public class LauncherActivity extends Activity {
intent.putExtra("pakfile", getFilesDir().getAbsolutePath() + "/extras.pak" );
startActivity(intent);
}
public static void extractPAK(Context context, Boolean force) {
if(isExtracting)
return;
isExtracting = true;
try {
if( mPref == null )
mPref = context.getSharedPreferences("mod", 0);
if( mPref.getInt( "pakversion", 0 ) == PAK_VERSION && !force )
return;
extractFile(context, "extras.pak");
SharedPreferences.Editor editor = mPref.edit();
editor.putInt( "pakversion", PAK_VERSION );
editor.commit();
editor.apply();
} catch( Exception e )
{
Log.e( TAG, "Failed to extract PAK:" + e.toString() );
}
isExtracting = false;
}
}