| Index: src/org/adblockplus/android/Utils.java |
| diff --git a/src/org/adblockplus/android/Utils.java b/src/org/adblockplus/android/Utils.java |
| index 6bc4c348ff562544b5903288b1999df090bc1f57..a07b668faa4127b45fefca8d8acb2ddcde1d7fd4 100644 |
| --- a/src/org/adblockplus/android/Utils.java |
| +++ b/src/org/adblockplus/android/Utils.java |
| @@ -17,6 +17,9 @@ |
| package org.adblockplus.android; |
| +import java.io.BufferedReader; |
| +import java.io.InputStreamReader; |
| + |
| import org.adblockplus.android.updater.UpdaterActivity; |
| import org.adblockplus.libadblockplus.JsValue; |
| import org.adblockplus.libadblockplus.Subscription; |
| @@ -120,4 +123,31 @@ public final class Utils |
| .putExtra("status", status) |
| .putExtra("time", time * 1000L)); |
| } |
| + |
| + public static void appendRawTextFile(final Context context, final StringBuilder text, final int id) |
| + { |
| + try |
| + { |
| + final BufferedReader buf = new BufferedReader(new InputStreamReader(context.getResources().openRawResource(id))); |
| + |
| + try |
| + { |
| + String line; |
| + while ((line = buf.readLine()) != null) |
| + { |
| + text.append(line); |
| + text.append('\n'); |
|
Felix Dahlke
2014/11/11 09:21:46
I wonder why it worked before when we were cutting
René Jeschke
2014/11/11 11:57:00
Yep, seems like we always only loaded HTML so far,
|
| + } |
| + } |
| + finally |
| + { |
| + buf.close(); |
| + } |
| + |
| + } |
| + catch (final Exception e) |
| + { |
| + // Ignored for now |
| + } |
| + } |
| } |