From ffc1f27e33e764292c0e964e95fb6d0960429d81 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 2 Dec 2013 18:53:33 -0500 Subject: [PATCH 1/6] remove trailing spaces from .java files to placate the more finicky formats the Eclipse Android mode loves to remove all trailing whitespaces quite religiously. This commit just removes trailing whitespace. It was done by running this: sed -i 's/[[:space:]]*$//' *.java */*.java --- src/org/fdroid/fdroid/DB.java | 2 +- src/org/fdroid/fdroid/FDroid.java | 2 +- src/org/fdroid/fdroid/FDroidApp.java | 2 +- src/org/fdroid/fdroid/ManageRepo.java | 4 ++-- src/org/fdroid/fdroid/PackageReceiver.java | 2 +- src/org/fdroid/fdroid/PreferencesActivity.java | 2 +- src/org/fdroid/fdroid/RepoXMLHandler.java | 4 ++-- src/org/fdroid/fdroid/SearchResults.java | 2 +- src/org/fdroid/fdroid/StartupReceiver.java | 2 +- src/org/fdroid/fdroid/UpdateService.java | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/org/fdroid/fdroid/DB.java b/src/org/fdroid/fdroid/DB.java index ef950ef69..75b27efdc 100644 --- a/src/org/fdroid/fdroid/DB.java +++ b/src/org/fdroid/fdroid/DB.java @@ -11,7 +11,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/src/org/fdroid/fdroid/FDroid.java b/src/org/fdroid/fdroid/FDroid.java index 63353ffec..e78135ef9 100644 --- a/src/org/fdroid/fdroid/FDroid.java +++ b/src/org/fdroid/fdroid/FDroid.java @@ -11,7 +11,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/src/org/fdroid/fdroid/FDroidApp.java b/src/org/fdroid/fdroid/FDroidApp.java index b7dea120d..a9cb64ab0 100644 --- a/src/org/fdroid/fdroid/FDroidApp.java +++ b/src/org/fdroid/fdroid/FDroidApp.java @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index 4185e89fc..a9df1b347 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -11,7 +11,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -103,7 +103,7 @@ public class ManageRepo extends ListActivity { s_lastUpdateCheck = getString(R.string.never); } else { Date d = new Date(lastUpdate); - s_lastUpdateCheck = DateFormat.getDateFormat(this).format(d) + + s_lastUpdateCheck = DateFormat.getDateFormat(this).format(d) + " " + DateFormat.getTimeFormat(this).format(d); } tv_lastCheck.setText(getString(R.string.last_update_check,s_lastUpdateCheck)); diff --git a/src/org/fdroid/fdroid/PackageReceiver.java b/src/org/fdroid/fdroid/PackageReceiver.java index 5716c5dc7..180aa3f8c 100644 --- a/src/org/fdroid/fdroid/PackageReceiver.java +++ b/src/org/fdroid/fdroid/PackageReceiver.java @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/src/org/fdroid/fdroid/PreferencesActivity.java b/src/org/fdroid/fdroid/PreferencesActivity.java index d0690d808..1303e9f09 100644 --- a/src/org/fdroid/fdroid/PreferencesActivity.java +++ b/src/org/fdroid/fdroid/PreferencesActivity.java @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/src/org/fdroid/fdroid/RepoXMLHandler.java b/src/org/fdroid/fdroid/RepoXMLHandler.java index 8af50821f..29648f7c9 100644 --- a/src/org/fdroid/fdroid/RepoXMLHandler.java +++ b/src/org/fdroid/fdroid/RepoXMLHandler.java @@ -11,7 +11,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -359,7 +359,7 @@ public class RepoXMLHandler extends DefaultHandler { // This is a signed repo - we download the jar file, // check the signature, and extract the index... - Log.d("FDroid", "Getting signed index from " + repo.address + " at " + + Log.d("FDroid", "Getting signed index from " + repo.address + " at " + logDateFormat.format(new Date(System.currentTimeMillis()))); String address = repo.address + "/index.jar?" + ctx.getString(R.string.version_name); diff --git a/src/org/fdroid/fdroid/SearchResults.java b/src/org/fdroid/fdroid/SearchResults.java index e1b2ece03..e8afcb002 100644 --- a/src/org/fdroid/fdroid/SearchResults.java +++ b/src/org/fdroid/fdroid/SearchResults.java @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/src/org/fdroid/fdroid/StartupReceiver.java b/src/org/fdroid/fdroid/StartupReceiver.java index db82be4ca..2d04342dd 100644 --- a/src/org/fdroid/fdroid/StartupReceiver.java +++ b/src/org/fdroid/fdroid/StartupReceiver.java @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. diff --git a/src/org/fdroid/fdroid/UpdateService.java b/src/org/fdroid/fdroid/UpdateService.java index 5323d0e60..c9854f331 100644 --- a/src/org/fdroid/fdroid/UpdateService.java +++ b/src/org/fdroid/fdroid/UpdateService.java @@ -10,7 +10,7 @@ * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. From e063636d618dcbacebfe70c5a067f81e7e24b86e Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 2 Dec 2013 19:27:58 -0500 Subject: [PATCH 2/6] make all incoming repo URLs all lowercase --- src/org/fdroid/fdroid/ManageRepo.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index a9df1b347..b9913b293 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -116,13 +116,25 @@ public class ManageRepo extends ListActivity { /* an URL from a click or a QRCode scan */ Uri uri = intent.getData(); if (uri != null) { - // scheme should only ever be pure ASCII: + // scheme should only ever be pure ASCII aka Locale.ENGLISH String scheme = intent.getScheme().toLowerCase(Locale.ENGLISH); String fingerprint = uri.getUserInfo(); + String host = uri.getHost().toLowerCase(Locale.ENGLISH); if (scheme.equals("fdroidrepos") || scheme.equals("fdroidrepo") || scheme.equals("https") || scheme.equals("http")) { - String uriString = uri.toString().replace("fdroidrepo", "http"). - replace(fingerprint + "@", ""); + // QRCode are more efficient in all upper case, so some incoming + // URLs might be encoded in all upper case. Therefore, we allow + // the standard paths to be encoded all upper case, then they'll + // be forced to lower case. The scheme and host are downcased + // just to make them more readable in the dialog. + String uriString = uri.toString() + .replace(fingerprint + "@", "") // remove fingerprint + .replaceAll("/*$", "") // remove all trailing slashes + .replaceAll("/FDROID/REPO$", "/fdroid/repo") + .replaceAll("/FDROID/ARCHIVE$", "/fdroid/archive") + .replace(uri.getHost(), host) // downcase host name + .replace(intent.getScheme(), scheme) // downcase scheme + .replace("fdroidrepo", "http"); // make proper URL showAddRepo(uriString, fingerprint); Log.i("ManageRepo", uriString + " fingerprint: " + fingerprint); } From 711a1418b6a33be18b4edfaa0536696a15441c70 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 2 Dec 2013 19:54:07 -0500 Subject: [PATCH 3/6] make DB.calcFingerprint() return null if pubkey is null Handling it here seems to keep the flow simple. --- src/org/fdroid/fdroid/DB.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/org/fdroid/fdroid/DB.java b/src/org/fdroid/fdroid/DB.java index 75b27efdc..73236124e 100644 --- a/src/org/fdroid/fdroid/DB.java +++ b/src/org/fdroid/fdroid/DB.java @@ -465,6 +465,8 @@ public class DB { public static String calcFingerprint(String pubkey) { String ret = null; + if (pubkey == null) + return null; try { // keytool -list -v gives you the SHA-256 fingerprint MessageDigest digest = MessageDigest.getInstance("SHA-256"); @@ -1410,7 +1412,7 @@ public class DB { String calcedFingerprint = DB.calcFingerprint(pubkey); if (fingerprint == null) { fingerprint = calcedFingerprint; - } else { + } else if (calcedFingerprint != null) { fingerprint = fingerprint.toUpperCase(); if (!fingerprint.equals(calcedFingerprint)) { throw new SecurityException("Given fingerprint does not match calculated one! (" From c7b076e5ea29869c0c240421607e22f940ef421b Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 2 Dec 2013 20:12:52 -0500 Subject: [PATCH 4/6] add detailed checking of incoming repos based on fingerprint in DB When a new repo is being added, whether manually or via an incoming Intent, check the address and fingerprint against repos in the DB. If the repo is not in the DB, offer to add it. If the repo address is in the DB, then do more checks: * If that address has no fingerprint in the DB, then offer to add the new repo including that fingerprint. This might happen when upgrading a repo from unsigned to signed. * if the incoming info matches a repo in the DB, offer to enable that repo * if the address matches a repo in the DB but the incoming fingerprint does not match the fingerprint in the DB, warn the user, and tell them to delete the existing repo if they truly want to override the existing info --- res/layout/addrepo.xml | 23 ++---- res/values/strings.xml | 7 +- src/org/fdroid/fdroid/ManageRepo.java | 107 ++++++++++++++++++-------- 3 files changed, 86 insertions(+), 51 deletions(-) diff --git a/res/layout/addrepo.xml b/res/layout/addrepo.xml index 95882888e..0638049ee 100644 --- a/res/layout/addrepo.xml +++ b/res/layout/addrepo.xml @@ -4,17 +4,6 @@ android:layout_height="wrap_content" android:orientation="vertical" > - - - diff --git a/res/values/strings.xml b/res/values/strings.xml index 58f105812..fcf48814a 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -56,6 +56,9 @@ Add Cancel + Enable + Add Key + Overwrite Choose repository to remove Update repositories @@ -72,7 +75,9 @@ Repository address fingerprint (optional) This repo already exists! - Overwrite the existing repo? + This repo is already setup, this will add new key information. + This repo is already setup, confirm that you want to re-enable it. + You must first delete this repo before you can add one with a different key! The list of used repositories has changed.\nDo you diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index b9913b293..8555d90d8 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -35,24 +35,21 @@ import android.content.SharedPreferences; import android.net.Uri; import android.os.Bundle; import android.preference.PreferenceManager; +import android.support.v4.app.NavUtils; +import android.support.v4.view.MenuItemCompat; import android.text.format.DateFormat; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; -import android.view.View.OnClickListener; import android.widget.Button; -import android.widget.CheckBox; import android.widget.EditText; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.TextView; import org.fdroid.fdroid.DB.Repo; -import android.support.v4.app.NavUtils; -import android.support.v4.view.MenuItemCompat; - import org.fdroid.fdroid.compat.ActionBarCompat; public class ManageRepo extends ListActivity { @@ -62,6 +59,11 @@ public class ManageRepo extends ListActivity { private boolean changed = false; + private enum PositiveAction { + ADD_NEW, ENABLE, IGNORE + } + private PositiveAction positiveAction; + private List repos; private static List reposToDisable; @@ -231,10 +233,10 @@ public class ManageRepo extends ListActivity { return repos; } - protected Repo getRepo(String repoUri, List repos) { - if (repoUri != null) + protected Repo getRepoByAddress(String address, List repos) { + if (address != null) for (Repo repo : repos) - if (repoUri.equals(repo.address)) + if (address.equals(repo.address)) return repo; return null; } @@ -249,7 +251,7 @@ public class ManageRepo extends ListActivity { return super.onOptionsItemSelected(item); } - private void showAddRepo(String uriString, String fingerprint) { + private void showAddRepo(String newAddress, String newFingerprint) { LayoutInflater li = LayoutInflater.from(this); View view = li.inflate(R.layout.addrepo, null); Builder p = new AlertDialog.Builder(this).setView(view); @@ -257,6 +259,9 @@ public class ManageRepo extends ListActivity { final EditText uriEditText = (EditText) view.findViewById(R.id.edit_uri); final EditText fingerprintEditText = (EditText) view.findViewById(R.id.edit_fingerprint); + List repos = getRepos(); + final Repo repo = getRepoByAddress(newAddress, repos); + alrt.setIcon(android.R.drawable.ic_menu_add); alrt.setTitle(getString(R.string.repo_add_title)); alrt.setButton(DialogInterface.BUTTON_POSITIVE, @@ -264,10 +269,15 @@ public class ManageRepo extends ListActivity { new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { - addRepo(uriEditText.getText().toString(), - fingerprintEditText.getText().toString()); - changed = true; - redraw(); + String fp = fingerprintEditText.getText().toString(); + // the DB uses null for no fingerprint but the above + // code returns "" rather than null if its blank + if (fp.equals("")) + fp = null; + if (positiveAction == PositiveAction.ADD_NEW) + addRepoPositiveAction(uriEditText.getText().toString(), fp, null); + else if (positiveAction == PositiveAction.ENABLE) + addRepoPositiveAction(null, null, repo); } }); @@ -281,30 +291,59 @@ public class ManageRepo extends ListActivity { }); alrt.show(); - List repos = getRepos(); - Repo repo = getRepo(uriString, repos); - if (repo != null) { - TextView tv = (TextView) view.findViewById(R.id.repo_alert); - tv.setVisibility(0); - tv.setText(R.string.repo_exists); + final TextView overwriteMessage = (TextView) view.findViewById(R.id.overwrite_message); + overwriteMessage.setVisibility(View.GONE); + if (repo == null) { + // no existing repo, add based on what we have + positiveAction = PositiveAction.ADD_NEW; + } else { + // found the address in the DB of existing repos final Button addButton = alrt.getButton(DialogInterface.BUTTON_POSITIVE); - addButton.setEnabled(false); - final CheckBox overwriteCheckBox = (CheckBox) view.findViewById(R.id.overwrite_repo); - overwriteCheckBox.setVisibility(0); - overwriteCheckBox.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - addButton.setEnabled(overwriteCheckBox.isChecked()); - } - }); - // TODO if address and fingerprint match, then enable existing repo - // TODO if address matches but fingerprint doesn't, handle this with extra widgets + alrt.setTitle(R.string.repo_exists); + overwriteMessage.setVisibility(View.VISIBLE); + if (repo.fingerprint == null && newFingerprint != null) { + // we're upgrading from unsigned to signed repo + overwriteMessage.setText(R.string.repo_exists_add_fingerprint); + addButton.setText(R.string.add_key); + positiveAction = PositiveAction.ADD_NEW; + } else if (newFingerprint == null || newFingerprint.equals(repo.fingerprint)) { + // this entry already exists, offer to enable it + overwriteMessage.setText(R.string.repo_exists_enable); + addButton.setText(R.string.enable); + positiveAction = PositiveAction.ENABLE; + } else { + // same address with different fingerprint, this could be + // malicious, so force the user to manually delete the repo + // before adding this one + overwriteMessage.setTextColor(getResources().getColor(R.color.red)); + overwriteMessage.setText(R.string.repo_delete_to_overwrite); + addButton.setText(R.string.overwrite); + addButton.setEnabled(false); + positiveAction = PositiveAction.IGNORE; + } } - if (uriString != null) - uriEditText.setText(uriString); - if (fingerprint != null) - fingerprintEditText.setText(fingerprint); + if (newAddress != null) + uriEditText.setText(newAddress); + if (newFingerprint != null) + fingerprintEditText.setText(newFingerprint); + } + + private void addRepoPositiveAction(String address, String fingerprint, Repo repo) { + if (address != null) { + addRepo(address, fingerprint); + } else if (repo != null) { + // force-enable an existing repo + repo.inuse = true; + try { + DB db = DB.getDB(); + db.updateRepoByAddress(repo); + } finally { + DB.releaseDB(); + } + } + changed = true; + redraw(); } @Override From f9d2fbb0ae423606fc61ecec2aacc0e771f626f9 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 2 Dec 2013 20:19:50 -0500 Subject: [PATCH 5/6] if incoming repo already exists and is enabled, show Toast and hide dialog No need to show the dialog if it won't let you take any action. --- res/values/strings.xml | 1 + src/org/fdroid/fdroid/ManageRepo.java | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/res/values/strings.xml b/res/values/strings.xml index fcf48814a..1093ddcd3 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -77,6 +77,7 @@ This repo already exists! This repo is already setup, this will add new key information. This repo is already setup, confirm that you want to re-enable it. + The incoming repo is already setup and enabled! You must first delete this repo before you can add one with a different key! The list of used repositories has diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index 8555d90d8..ae2047705 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -48,6 +48,7 @@ import android.widget.EditText; import android.widget.ListView; import android.widget.SimpleAdapter; import android.widget.TextView; +import android.widget.Toast; import org.fdroid.fdroid.DB.Repo; import org.fdroid.fdroid.compat.ActionBarCompat; @@ -307,10 +308,16 @@ public class ManageRepo extends ListActivity { addButton.setText(R.string.add_key); positiveAction = PositiveAction.ADD_NEW; } else if (newFingerprint == null || newFingerprint.equals(repo.fingerprint)) { - // this entry already exists, offer to enable it - overwriteMessage.setText(R.string.repo_exists_enable); - addButton.setText(R.string.enable); - positiveAction = PositiveAction.ENABLE; + // this entry already exists and is not enabled, offer to enable it + if (repo.inuse) { + alrt.dismiss(); + Toast.makeText(this, R.string.repo_exists_and_enabled, Toast.LENGTH_LONG).show(); + return; + } else { + overwriteMessage.setText(R.string.repo_exists_enable); + addButton.setText(R.string.enable); + positiveAction = PositiveAction.ENABLE; + } } else { // same address with different fingerprint, this could be // malicious, so force the user to manually delete the repo From 1ad693931ffec031db499dda27c844c240920160 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 2 Dec 2013 21:55:55 -0500 Subject: [PATCH 6/6] if incoming repo Intent is handled, then return to the sending Activity --- AndroidManifest.xml | 5 +++-- src/org/fdroid/fdroid/ManageRepo.java | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/AndroidManifest.xml b/AndroidManifest.xml index e9e3f1a3a..6040a50d6 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -60,10 +60,11 @@ android:name="android.app.default_searchable" android:value=".SearchResults" /> - - + diff --git a/src/org/fdroid/fdroid/ManageRepo.java b/src/org/fdroid/fdroid/ManageRepo.java index ae2047705..de5b6c884 100644 --- a/src/org/fdroid/fdroid/ManageRepo.java +++ b/src/org/fdroid/fdroid/ManageRepo.java @@ -26,6 +26,7 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import android.app.Activity; import android.app.AlertDialog; import android.app.AlertDialog.Builder; import android.app.ListActivity; @@ -287,6 +288,8 @@ public class ManageRepo extends ListActivity { new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { + setResult(Activity.RESULT_CANCELED); + finish(); return; } }); @@ -351,6 +354,8 @@ public class ManageRepo extends ListActivity { } changed = true; redraw(); + setResult(Activity.RESULT_OK); + finish(); } @Override