Merge commit '3c526f3'
This commit is contained in:
commit
7c602d892a
@ -223,10 +223,10 @@ public class RepoXMLHandler extends DefaultHandler {
|
|||||||
|
|
||||||
public static boolean doUpdates(Context ctx, DB db) {
|
public static boolean doUpdates(Context ctx, DB db) {
|
||||||
long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
boolean success = true;
|
|
||||||
db.beginUpdate();
|
db.beginUpdate();
|
||||||
Vector<DB.Repo> repos = db.getRepos();
|
Vector<DB.Repo> repos = db.getRepos();
|
||||||
for (DB.Repo repo : repos) {
|
for (DB.Repo repo : repos) {
|
||||||
|
boolean success = false;
|
||||||
if (repo.inuse) {
|
if (repo.inuse) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -263,12 +263,12 @@ public class RepoXMLHandler extends DefaultHandler {
|
|||||||
jar.close();
|
jar.close();
|
||||||
if (certs == null) {
|
if (certs == null) {
|
||||||
Log.d("FDroid", "No signature found in index");
|
Log.d("FDroid", "No signature found in index");
|
||||||
return success = false;
|
return false;
|
||||||
}
|
}
|
||||||
if (certs.length != 1) {
|
if (certs.length != 1) {
|
||||||
Log.d("FDroid", "Expected one signature - found "
|
Log.d("FDroid", "Expected one signature - found "
|
||||||
+ certs.length);
|
+ certs.length);
|
||||||
return success = false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] sig = certs[0].getEncoded();
|
byte[] sig = certs[0].getEncoded();
|
||||||
@ -286,7 +286,7 @@ public class RepoXMLHandler extends DefaultHandler {
|
|||||||
|
|
||||||
if (!ssig.equals(repo.pubkey)) {
|
if (!ssig.equals(repo.pubkey)) {
|
||||||
Log.d("FDroid", "Index signature mismatch");
|
Log.d("FDroid", "Index signature mismatch");
|
||||||
return success = false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -321,11 +321,12 @@ public class RepoXMLHandler extends DefaultHandler {
|
|||||||
repo.pubkey = handler.pubkey;
|
repo.pubkey = handler.pubkey;
|
||||||
db.updateRepoByAddress(repo);
|
db.updateRepoByAddress(repo);
|
||||||
}
|
}
|
||||||
|
success = true;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Log.e("FDroid", "Exception updating from " + repo.address
|
Log.e("FDroid", "Exception updating from " + repo.address
|
||||||
+ ":\n" + Log.getStackTraceString(e));
|
+ ":\n" + Log.getStackTraceString(e));
|
||||||
return success = false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
ctx.deleteFile("tempindex.xml");
|
ctx.deleteFile("tempindex.xml");
|
||||||
ctx.deleteFile("tempindex.jar");
|
ctx.deleteFile("tempindex.jar");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user