@@ -125,19 +125,25 @@ public static boolean initSo(String libName, int version, IWXUserTrackAdapter ut
125
125
126
126
boolean InitSuc = false ;
127
127
// if (checkSoIsValid(libName, BuildConfig.ARMEABI_Size) ||checkSoIsValid(libName, BuildConfig.X86_Size)) {
128
-
129
-
130
- try {
131
- // If a library loader adapter exists, use this adapter to load library
132
- // instead of System.loadLibrary.
133
- if (mSoLoader != null ) {
134
- mSoLoader .doLoadLibrary ("c++_shared" );
135
- } else {
136
- System .loadLibrary ("c++_shared" );
128
+ try {
129
+ // If a library loader adapter exists, use this adapter to load library
130
+ // instead of System.loadLibrary.
131
+ if (mSoLoader != null ) {
132
+ mSoLoader .doLoadLibrary ("c++_shared" );
133
+ } else {
134
+ System .loadLibrary ("c++_shared" );
135
+ }
136
+ } catch (Exception | Error e ) {
137
+ WXExceptionUtils .commitCriticalExceptionRT (null ,
138
+ WXErrorCode .WX_KEY_EXCEPTION_SDK_INIT ,
139
+ "initSo" ,
140
+ "load c++_shared failed Detail Error is: " +e .getMessage (),
141
+ null );
142
+
143
+ if (WXEnvironment .isApkDebugable ()) {
144
+ throw e ;
145
+ }
137
146
}
138
- } catch (Exception e ) {
139
- e .printStackTrace ();
140
- }
141
147
142
148
/**
143
149
* Load library with {@link System#loadLibrary(String)}
@@ -160,40 +166,44 @@ public static boolean initSo(String libName, int version, IWXUserTrackAdapter ut
160
166
"\n Detail Error is: " +e2 .getMessage (),
161
167
null );
162
168
}
163
- InitSuc = false ;
164
- }
165
-
166
- try {
167
-
168
- if (!InitSuc ) {
169
-
170
- //File extracted from apk already exists.
171
- if (isExist (libName , version )) {
172
- boolean res = _loadUnzipSo (libName , version , utAdapter );
173
- if (res ) {
174
- return res ;
175
- } else {
176
- //Delete the corrupt so library, and extract it again.
177
- removeSoIfExit (libName , version );
178
- }
179
- }
180
-
181
- //Fail for loading file from libs, extract so library from so and load it.
182
- if (cpuType .equalsIgnoreCase (MIPS )) {
183
- return false ;
184
- } else {
185
- try {
186
- InitSuc = unZipSelectedFiles (libName , version , utAdapter );
187
- } catch (IOException e2 ) {
188
- e2 .printStackTrace ();
189
- }
190
- }
191
169
170
+ if (WXEnvironment .isApkDebugable ()) {
171
+ throw e2 ;
192
172
}
193
- } catch (Exception | Error e ) {
194
173
InitSuc = false ;
195
- e .printStackTrace ();
196
174
}
175
+
176
+ // try {
177
+
178
+ // if (!InitSuc) {
179
+ //
180
+ // //File extracted from apk already exists.
181
+ // if (isExist(libName, version)) {
182
+ // boolean res = _loadUnzipSo(libName, version, utAdapter);
183
+ // if (res) {
184
+ // return res;
185
+ // } else {
186
+ // //Delete the corrupt so library, and extract it again.
187
+ // removeSoIfExit(libName, version);
188
+ // }
189
+ // }
190
+ //
191
+ // //Fail for loading file from libs, extract so library from so and load it.
192
+ // if (cpuType.equalsIgnoreCase(MIPS)) {
193
+ // return false;
194
+ // } else {
195
+ // try {
196
+ // InitSuc = unZipSelectedFiles(libName, version, utAdapter);
197
+ // } catch (IOException e2) {
198
+ // e2.printStackTrace();
199
+ // }
200
+ // }
201
+ //
202
+ // }
203
+ // } catch (Exception | Error e) {
204
+ // InitSuc = false;
205
+ // e.printStackTrace();
206
+ // }
197
207
// }
198
208
return InitSuc ;
199
209
}
0 commit comments