@@ -78,9 +78,9 @@ private static void loadICUData(Context context) {
78
78
File applicationFilesDirectory = context .getFilesDir ();
79
79
File icuDir = new File (applicationFilesDirectory , "icu" );
80
80
if (!icuDir .exists ()) icuDir .mkdirs ();
81
- File icuDataFile = new File (icuDir , "icudt44l .dat" );
81
+ File icuDataFile = new File (icuDir , "icudt46l .dat" );
82
82
if (!icuDataFile .exists ()) {
83
- ZipInputStream in = new ZipInputStream (context .getAssets ().open ("icudt44l .zip" ));
83
+ ZipInputStream in = new ZipInputStream (context .getAssets ().open ("icudt46l .zip" ));
84
84
in .getNextEntry ();
85
85
86
86
OutputStream out = new FileOutputStream (icuDataFile );
@@ -104,12 +104,13 @@ public static void loadLibs (Context context)
104
104
System .loadLibrary ("stlport_shared" );
105
105
System .loadLibrary ("sqlcipher_android" );
106
106
System .loadLibrary ("database_sqlcipher" );
107
-
107
+
108
+ boolean systemICUFileExists = new File ("/system/usr/icu/icudt46l.dat" ).exists ();
108
109
File applicationFilesDirectory = context .getFilesDir ();
109
- String icuRootPath = android .os .Build .VERSION .SDK_INT < 9 ? applicationFilesDirectory .getAbsolutePath ()
110
- : "/system/usr" ;
110
+ String icuRootPath = systemICUFileExists ? "/system/usr" : applicationFilesDirectory .getAbsolutePath ();
111
111
setICURoot (icuRootPath );
112
- if (android .os .Build .VERSION .SDK_INT < 9 ){
112
+
113
+ if (!systemICUFileExists ){
113
114
loadICUData (context );
114
115
}
115
116
}
@@ -917,6 +918,7 @@ public static SQLiteDatabase create(CursorFactory factory, String password) {
917
918
* Close the database.
918
919
*/
919
920
public void close () {
921
+
920
922
if (!isOpen ()) {
921
923
return ; // already closed
922
924
}
0 commit comments