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
This commit is contained in:
Hans-Christoph Steiner 2014-05-05 20:52:01 -04:00
parent 5f31703316
commit 882e010052

View File

@ -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