Misc refinements
* Refine Kotlin codes; * Support RTL; * Use VectorDrawable for notification; * Remove redundant resources; * Better IDE integration.
This commit is contained in:
@@ -28,13 +28,12 @@ import java.io.File
|
||||
|
||||
object Executable {
|
||||
const val REDSOCKS = "libredsocks.so"
|
||||
const val PDNSD = "libpdnsd.so"
|
||||
const val SS_LOCAL = "libss-local.so"
|
||||
const val SS_TUNNEL = "libss-tunnel.so"
|
||||
const val TUN2SOCKS = "libtun2socks.so"
|
||||
const val OVERTURE = "liboverture.so"
|
||||
|
||||
val EXECUTABLES = setOf(SS_LOCAL, SS_TUNNEL, PDNSD, REDSOCKS, TUN2SOCKS, OVERTURE)
|
||||
val EXECUTABLES = setOf(SS_LOCAL, SS_TUNNEL, REDSOCKS, TUN2SOCKS, OVERTURE)
|
||||
|
||||
fun killAll() {
|
||||
for (process in File("/proc").listFiles { _, name -> TextUtils.isDigitsOnly(name) }) {
|
||||
|
||||
@@ -69,7 +69,7 @@ class ServiceNotification(private val service: BaseService.Interface, profileNam
|
||||
.setContentTitle(profileName)
|
||||
.setContentIntent(PendingIntent.getActivity(service, 0, Intent(service, MainActivity::class.java)
|
||||
.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT), 0))
|
||||
.setSmallIcon(R.drawable.ic_stat_shadowsocks)
|
||||
.setSmallIcon(R.drawable.ic_start_connected)
|
||||
private val style = NotificationCompat.BigTextStyle(builder)
|
||||
private var isVisible = true
|
||||
|
||||
|
||||
@@ -35,11 +35,11 @@ object TrafficMonitor {
|
||||
var rxTotal = 0L
|
||||
|
||||
// Bytes for the last query
|
||||
var txLast = 0L
|
||||
var rxLast = 0L
|
||||
var timestampLast = 0L
|
||||
private var txLast = 0L
|
||||
private var rxLast = 0L
|
||||
private var timestampLast = 0L
|
||||
@Volatile
|
||||
var dirty = true
|
||||
private var dirty = true
|
||||
|
||||
private val units = arrayOf("KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB", "BB", "NB", "DB", "CB")
|
||||
private val numberFormat = DecimalFormat("@@@")
|
||||
|
||||
Reference in New Issue
Block a user