@@ -103,11 +103,10 @@ public void postKey(SQLiteDatabase database){
103
103
}
104
104
}
105
105
106
- private static void loadICUData (Context context ) {
107
-
106
+ private static void loadICUData (Context context , File workingDir ) {
107
+
108
108
try {
109
- File applicationFilesDirectory = context .getFilesDir ();
110
- File icuDir = new File (applicationFilesDirectory , "icu" );
109
+ File icuDir = new File (workingDir , "icu" );
111
110
if (!icuDir .exists ()) icuDir .mkdirs ();
112
111
File icuDataFile = new File (icuDir , "icudt46l.dat" );
113
112
if (!icuDataFile .exists ()) {
@@ -130,19 +129,23 @@ private static void loadICUData(Context context) {
130
129
}
131
130
}
132
131
133
- public static void loadLibs (Context context )
132
+ public static void loadLibs (Context context ) {
133
+ loadLibs (context , context .getFilesDir ());
134
+ }
135
+
136
+ public static void loadLibs (Context context , File workingDir )
134
137
{
135
138
System .loadLibrary ("stlport_shared" );
136
139
System .loadLibrary ("sqlcipher_android" );
137
140
System .loadLibrary ("database_sqlcipher" );
138
141
139
142
boolean systemICUFileExists = new File ("/system/usr/icu/icudt46l.dat" ).exists ();
140
- File applicationFilesDirectory = context . getFilesDir ();
141
- String icuRootPath = systemICUFileExists ? "/system/usr" : applicationFilesDirectory .getAbsolutePath ();
143
+
144
+ String icuRootPath = systemICUFileExists ? "/system/usr" : workingDir .getAbsolutePath ();
142
145
setICURoot (icuRootPath );
143
146
144
147
if (!systemICUFileExists ){
145
- loadICUData (context );
148
+ loadICUData (context , workingDir );
146
149
}
147
150
}
148
151
0 commit comments