Fix file permission
This commit is contained in:
parent
99033aa7a4
commit
ab21b7c259
|
|
@ -11,16 +11,12 @@ import java.io.InputStreamReader;
|
|||
|
||||
public class FileUtil {
|
||||
|
||||
public static File getExternalCacheDir() {
|
||||
public static File getCacheDir() {
|
||||
return Init.context().getExternalCacheDir();
|
||||
}
|
||||
|
||||
public static File getCacheDir() {
|
||||
return Init.context().getCacheDir();
|
||||
}
|
||||
|
||||
public static File getCacheFile(String fileName) {
|
||||
return getExternalCacheDir().canWrite() ? new File(getExternalCacheDir(), fileName) : new File(getCacheDir(), fileName);
|
||||
return new File(getCacheDir(), fileName);
|
||||
}
|
||||
|
||||
public static void write(File file, String data) {
|
||||
|
|
@ -33,11 +29,23 @@ public class FileUtil {
|
|||
fos.write(data);
|
||||
fos.flush();
|
||||
fos.close();
|
||||
chmod(file);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static File chmod(File file) {
|
||||
try {
|
||||
Process process = Runtime.getRuntime().exec("chmod 777 " + file);
|
||||
process.waitFor();
|
||||
return file;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return file;
|
||||
}
|
||||
}
|
||||
|
||||
public static String read(File file) {
|
||||
try {
|
||||
return read(new FileInputStream(file));
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
176b1654119d82e6231a4f6046f630e2
|
||||
d81491287f85debfc69e10a2ec775b4d
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;630997f2d36dde4644f99300f559ff68",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;d81491287f85debfc69e10a2ec775b4d",
|
||||
"wallpaper": "https://gao.chuqiuyu.tk",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;630997f2d36dde4644f99300f559ff68",
|
||||
"spider": "https://raw.githubusercontent.com/FongMi/CatVodSpider/main/jar/custom_spider.jar;md5;d81491287f85debfc69e10a2ec775b4d",
|
||||
"wallpaper": "http://饭太硬.ga/深色壁纸/api.php",
|
||||
"sites": [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue