@@ -46,48 +46,62 @@ public boolean recover(UnsatisfiedLinkError error, SoSource[] soSources) {
46
46
47
47
File nativeLibStandardDir = new File (mContext .getApplicationInfo ().nativeLibraryDir );
48
48
if (!nativeLibStandardDir .exists ()) {
49
- LogUtil .e (
50
- SoLoader .TAG ,
51
- "Native library directory "
52
- + nativeLibStandardDir
53
- + " does not exist, exiting /data/app recovery." );
54
- return false ;
55
- }
49
+ for (SoSource soSource : soSources ) {
50
+ if (!(soSource instanceof BackupSoSource )) {
51
+ continue ;
52
+ }
53
+ BackupSoSource uss = (BackupSoSource ) soSource ;
54
+ try {
56
55
57
- ArrayList <String > missingLibs = new ArrayList <>();
58
- for (SoSource soSource : soSources ) {
59
- if (!(soSource instanceof BackupSoSource )) {
60
- continue ;
56
+ LogUtil .e (
57
+ SoLoader .TAG ,
58
+ "Native library directory "
59
+ + nativeLibStandardDir
60
+ + " does not exist, will unpack everything under /data/data." );
61
+ uss .prepare (0 );
62
+ break ;
63
+ } catch (Exception e ) {
64
+ LogUtil .e (
65
+ SoLoader .TAG , "Encountered an exception while recovering from /data/app failure " , e );
66
+ return false ;
67
+ }
61
68
}
62
- BackupSoSource uss = (BackupSoSource ) soSource ;
63
- try {
64
- Dso [] dsosFromArchive = uss .getDsosBaseApk ();
65
- for (Dso dso : dsosFromArchive ) {
66
- File soFile = new File (nativeLibStandardDir , dso .name );
67
- if (soFile .exists ()) {
68
- continue ;
69
- }
70
- missingLibs .add (dso .name );
69
+ } else {
70
+ ArrayList <String > missingLibs = new ArrayList <>();
71
+ for (SoSource soSource : soSources ) {
72
+ if (!(soSource instanceof BackupSoSource )) {
73
+ continue ;
71
74
}
75
+ BackupSoSource uss = (BackupSoSource ) soSource ;
76
+ try {
77
+ Dso [] dsosFromArchive = uss .getDsosBaseApk ();
78
+ for (Dso dso : dsosFromArchive ) {
79
+ File soFile = new File (nativeLibStandardDir , dso .name );
80
+ if (soFile .exists ()) {
81
+ continue ;
82
+ }
83
+ missingLibs .add (dso .name );
84
+ }
72
85
73
- if (missingLibs .isEmpty ()) {
74
- LogUtil .e (SoLoader .TAG , "No libraries missing from " + nativeLibStandardDir );
86
+ if (missingLibs .isEmpty ()) {
87
+ LogUtil .e (SoLoader .TAG , "No libraries missing from " + nativeLibStandardDir );
88
+ return false ;
89
+ }
90
+
91
+ LogUtil .e (
92
+ SoLoader .TAG ,
93
+ "Missing libraries from "
94
+ + nativeLibStandardDir
95
+ + ": "
96
+ + missingLibs .toString ()
97
+ + ", will run prepare on tbe backup so source" );
98
+ uss .prepare (0 );
99
+ break ;
100
+ } catch (Exception e ) {
101
+ LogUtil .e (
102
+ SoLoader .TAG , "Encountered an exception while recovering from /data/app failure " , e );
75
103
return false ;
76
104
}
77
-
78
- LogUtil .e (
79
- SoLoader .TAG ,
80
- "Missing libraries from "
81
- + nativeLibStandardDir
82
- + ": "
83
- + missingLibs .toString ()
84
- + ", will run prepare on tbe backup so source" );
85
- uss .prepare (0 );
86
- break ;
87
- } catch (Exception e ) {
88
- LogUtil .e (
89
- SoLoader .TAG , "Encountered an exception while recovering from /data/app failure " , e );
90
- return false ;
91
105
}
92
106
}
93
107
0 commit comments