File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
lib/src/main/java/andhook/lib Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
1
package andhook .lib ;
2
2
3
+ import java .io .File ;
3
4
import java .lang .reflect .Member ;
4
5
import java .lang .reflect .Modifier ;
5
6
6
7
import android .os .Build ;
7
8
import android .util .Log ;
8
9
9
10
/**
10
- * @author rrrfff
11
- * @version 3.5.1
11
+ * @author Rprop
12
+ * @version 3.5.2
12
13
*/
13
14
@ SuppressWarnings ({"unused" , "WeakerAccess" , "JniMissingFunction" })
14
15
public final class AndHook {
15
- public final static String VERSION = "3.5.1 " ;
16
+ public final static String VERSION = "3.5.2 " ;
16
17
public final static String LOG_TAG = "AndHook" ;
17
18
18
19
static {
20
+ // Check if there is a usable directory for temporary files
21
+ final File tmpdir = new File (System .getProperty ("java.io.tmpdir" , "/data/local/tmp/" ));
22
+ if (!tmpdir .canWrite () || !tmpdir .canExecute ())
23
+ throw new RuntimeException ("Unable to load AndHook due to missing cache directory" );
24
+
19
25
try {
20
26
System .loadLibrary ("AndHook" );
21
27
} catch (final UnsatisfiedLinkError e ) {
22
28
try {
23
29
// compatible with libhoudini
24
30
System .loadLibrary ("AndHookCompat" );
25
31
} catch (final UnsatisfiedLinkError ignored ) {
26
- throw new RuntimeException ("incompatible platform" , e );
32
+ throw new RuntimeException ("Incompatible platform" , e );
27
33
}
28
34
}
29
35
}
You can’t perform that action at this time.
0 commit comments