8000 updated to support icu assets in zip format · Sjith/android-database-sqlcipher@91cc9aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 91cc9aa

Browse files
committed
updated to support icu assets in zip format
1 parent 7df0fba commit 91cc9aa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

assets/icudt44l.zip

1.96 MB
Binary file not shown.

src/info/guardianproject/database/sqlcipher/SQLiteDatabase.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@
4040
import java.util.WeakHashMap;
4141
import java.util.concurrent.locks.ReentrantLock;
4242
import java.util.regex.Pattern;
43+
import java.util.zip.ZipInputStream;
44+
import java.util.zip.ZipOutputStream;
4345

4446
import android.content.ContentValues;
4547
import android.content.Context;
@@ -82,8 +84,10 @@ private static void loadICUData(Context context) {
8284
if(!icuDir.exists()) icuDir.mkdirs();
8385
File icuDataFile = new File(icuDir, "icudt44l.dat");
8486
if(!icuDataFile.exists()) {
85-
InputStream in = context.getAssets().open("icudt44l.mp3");
86-
OutputStream out = new FileOutputStream(icuDataFile);
87+
ZipInputStream in = new ZipInputStream(context.getAssets().open("icudt44l.zip"));
88+
in.getNextEntry();
89+
90+
OutputStream out = new FileOutputStream(icuDataFile);
8791
byte[] buf = new byte[1024];
8892
int len;
8993
while ((len = in.read(buf)) > 0) {

0 commit comments

Comments
 (0)
0