revert to previous, proven index.xml writing

It was added in c831cf77ccf9ecfa792d0ffdc84f272053fa945a and changed in
42d31eb0e6e5d5c9e7fe9c35435a56258ad90578
This commit is contained in:
Hans-Christoph Steiner 2015-09-11 11:17:51 +02:00
parent ce2fa5cf80
commit 003f5331fa

View File

@ -345,11 +345,13 @@ public class LocalRepoManager {
serializer = XmlPullParserFactory.newInstance().newSerializer();
}
public void build(Writer output) throws IOException, LocalRepoKeyStore.InitException {
public void build(File file) throws IOException, LocalRepoKeyStore.InitException {
Writer output = new FileWriter(file);
serializer.setOutput(output);
serializer.startDocument(null, null);
tagFdroid();
serializer.endDocument();
output.close();
}
private void tagFdroid() throws IOException, LocalRepoKeyStore.InitException {
@ -485,16 +487,12 @@ public class LocalRepoManager {
public void writeIndexJar() throws IOException {
FileWriter writer = null;
try {
writer = new FileWriter(xmlIndex);
new IndexXmlBuilder(context, apps).build(writer);
new IndexXmlBuilder(context, apps).build(xmlIndex);
} catch (Exception e) {
Log.e(TAG, "Could not write index jar", e);
Toast.makeText(context, R.string.failed_to_create_index, Toast.LENGTH_LONG).show();
return;
} finally {
Utils.closeQuietly(writer);
}
BufferedOutputStream bo = new BufferedOutputStream(new FileOutputStream(xmlIndexJarUnsigned));