Implement plugin interface in mobile app

This commit is contained in:
Mygod
2017-01-16 22:30:26 +08:00
parent c54745e241
commit 0ffae32a44
9 changed files with 136 additions and 103 deletions
@@ -31,7 +31,6 @@ object Executable {
}
object ConfigUtils {
val SHADOWSOCKS = "{\"server\": \"%s\", \"server_port\": %d, \"local_port\": %d, \"password\": \"%s\", \"method\":\"%s\", \"timeout\": %d}"
val REDSOCKS = "base {\n" +
" log_debug = off;\n" +
" log_info = off;\n" +
@@ -21,7 +21,7 @@
package com.github.shadowsocks.utils
import com.github.shadowsocks.utils.CloseUtils._
import java.io.{FileWriter, InputStream, OutputStream}
import java.io._
/**
* @author Mygod
@@ -39,4 +39,10 @@ object IOUtils {
def writeString(file: String, content: String): Unit =
autoClose(new FileWriter(file))(writer => writer.write(content))
@throws[FileNotFoundException]
def deleteRecursively(file: File) {
if (file.isDirectory) file.listFiles().foreach(deleteRecursively)
if (!file.delete()) throw new FileNotFoundException("Failed to delete: " + file.getAbsolutePath)
}
}