Anonymous avatar Anonymous committed 0b578b5 Draft

Fix a couple bugs

Comments (0)

Files changed (6)

AndroidManifest.xml

 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.jrummy.busybox.installer"
-    android:versionCode="40"
+    android:versionCode="20"
     android:versionName="4.0" >
 
     <uses-permission android:name="android.permission.INTERNET" />

res/values/strings.xml

     <string name="six_hours">6 hours</string>
     <string name="one_day">1 day</string>
     <string name="never">Never</string>
+    <string name="default_interval">3600</string>
 
 </resources>

src/com/jrummy/busybox/installer/BusyboxActivity.java

 	}
 
 	private void startNewsUpdateService() {
+		String defaultInterval = getString(R.string.default_interval);
 		int intervalInSeconds = Integer.parseInt(mPrefs.getString(
-				"news_check_frequency", "3600"));
+				"news_check_frequency", defaultInterval));
 		if (intervalInSeconds != -1) {
 			Intent it = new Intent(getApplicationContext(), NewsReceiver.class);
 			PendingIntent pi = MainUtil.getPendingIntent(getApplicationContext(), it);

src/com/jrummy/busybox/installer/BusyboxInstaller.java

 					if (mAdvInstallCheckBox.isChecked()
 							&& mBinaryName.equals("busybox")) {
 						startAdvancedInstaller();
-					} else {
+					} else if (!mActivity.isFinishing()) {
 						installBinary();
 					}
 					break;
 								.runWaitFor("busybox");
 						if (result.success()) {
 							installSuccess = true;
-						} else if (result.stderr.contains("CANNOT LINK EXECUTABLE")
-								|| result.stderr.contains("reloc_library")
-								|| result.stderr.contains("permission denied")) {
+						} else if (result.stderr != null 
+								&& (result.stderr.contains("CANNOT LINK EXECUTABLE")
+										|| result.stderr.contains("reloc_library")
+										|| result.stderr.contains("permission denied"))) {
 							mErrorMessage = SYSTEM_ERROR_MESSAGE;
 							mStderr = result.stderr;
 						}

src/com/jrummy/busybox/installer/ScripterDB.java

 import android.database.Cursor;
 import android.database.SQLException;
 import android.database.sqlite.SQLiteDatabase;
+import android.database.sqlite.SQLiteException;
 import android.database.sqlite.SQLiteOpenHelper;
 import android.provider.BaseColumns;
 import android.util.Log;
 		mCtx = ctx;
 	}
 
-	public ScripterDB open(final Boolean rw) throws SQLException {
+	public ScripterDB open(final Boolean rw) throws SQLiteException {
 		if (mDb != null) {
 			mDbHelper.close();
 		}

src/com/jrummy/busybox/installer/service/BootReceiver.java

 import android.content.SharedPreferences;
 import android.preference.PreferenceManager;
 
+import com.jrummy.busybox.installer.R;
 import com.jrummy.busybox.installer.util.MainUtil;
 
 public class BootReceiver extends BroadcastReceiver {
 	public void onReceive(final Context context, final Intent intent) {
 		SharedPreferences preferences = PreferenceManager
 				.getDefaultSharedPreferences(context);
+		String defaultInterval = context.getString(R.string.default_interval);
 		int intervalInSeconds = Integer.parseInt(preferences.getString(
-				"news_check_frequency", "3600"));
+				"news_check_frequency", defaultInterval));
 		if (intervalInSeconds != -1) {
 			Intent it = new Intent(context, NewsReceiver.class);
 			PendingIntent pi = MainUtil.getPendingIntent(context, it);
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.