From 882e0100525b67d03827bd9494b7af664247ca51 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner <hans@eds.org> Date: Mon, 5 May 2014 20:52:01 -0400 Subject: [PATCH] create initial repo with only FDroid in it This automatically creates a repo with only FDroid in it the first time the user goes to the Local Repo view. Having an empty repo is useless if the user is trying to swap with someone. Having FDroid in there is not a privacy leak since FDroid is needed for the swap process, and it will then enable people to automatically get updates from each other, and do the bootstrap process from the web browser. fixes #2954 https://dev.guardianproject.info/issues/2954 --- src/org/fdroid/fdroid/views/LocalRepoActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/org/fdroid/fdroid/views/LocalRepoActivity.java b/src/org/fdroid/fdroid/views/LocalRepoActivity.java index 4b87f4d39..81b82fb2f 100644 --- a/src/org/fdroid/fdroid/views/LocalRepoActivity.java +++ b/src/org/fdroid/fdroid/views/LocalRepoActivity.java @@ -54,6 +54,11 @@ public class LocalRepoActivity extends Activity { resetNetworkInfo(); LocalBroadcastManager.getInstance(this).registerReceiver(onWifiChange, new IntentFilter(WifiStateChangeService.BROADCAST)); + // if no local repo exists, create one with only FDroid in it + if (!FDroidApp.localRepo.xmlIndex.exists()) + new UpdateAsyncTask(this, new String[] { + getPackageName(), + }).execute(); } @Override