mirror of
https://github.com/dovecoteescapee/ByeDPIAndroid.git
synced 2024-12-22 06:15:44 +00:00
Small fixes
This commit is contained in:
parent
52bf3cc272
commit
65cfecc679
@ -23,16 +23,15 @@ extern int get_default_ttl();
|
||||
|
||||
extern int get_addr(const char *str, struct sockaddr_ina *addr);
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_00024Companion_jniInit(JNIEnv *env, jobject thiz) {
|
||||
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, __attribute__((unused)) void *reserved) {
|
||||
oob_data.data = NULL;
|
||||
return 0;
|
||||
return JNI_VERSION_1_6;
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniCreateSocket(
|
||||
JNIEnv *env,
|
||||
jobject thiz,
|
||||
__attribute__((unused)) jobject thiz,
|
||||
jstring ip,
|
||||
jint port,
|
||||
jint max_connections,
|
||||
@ -128,8 +127,10 @@ Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniCreateSocket(
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStartProxy(JNIEnv *env, jobject thiz,
|
||||
jint fd) {
|
||||
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStartProxy(
|
||||
__attribute__((unused)) JNIEnv *env,
|
||||
__attribute__((unused)) jobject thiz,
|
||||
jint fd) {
|
||||
LOG(LOG_S, "start_proxy, fd: %d", fd);
|
||||
NOT_EXIT = 1;
|
||||
if (event_loop(fd) < 0) {
|
||||
@ -139,8 +140,10 @@ Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStartProxy(JNIEnv *env
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStopProxy(JNIEnv *env, jobject thiz,
|
||||
jint fd) {
|
||||
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStopProxy(
|
||||
__attribute__((unused)) JNIEnv *env,
|
||||
__attribute__((unused)) jobject thiz,
|
||||
jint fd) {
|
||||
LOG(LOG_S, "stop_proxy, fd: %d", fd);
|
||||
if (shutdown(fd, SHUT_RDWR) < 0) {
|
||||
return get_e();
|
||||
|
@ -8,10 +8,7 @@ class ByeDpiProxy {
|
||||
companion object {
|
||||
init {
|
||||
System.loadLibrary("byedpi")
|
||||
jniInit()
|
||||
}
|
||||
|
||||
private external fun jniInit(): Int
|
||||
}
|
||||
|
||||
private val mutex = Mutex()
|
||||
|
@ -34,7 +34,7 @@ class ByeDpiProxyPreferences(
|
||||
val splitPosition: Int = splitPosition ?: 3
|
||||
val splitAtHost: Boolean = splitAtHost ?: false
|
||||
val fakeTtl: Int = fakeTtl ?: 8
|
||||
val fakeSni: String = fakeSni ?: "www.w3c.org"
|
||||
val fakeSni: String = fakeSni ?: "www.iana.org"
|
||||
val oobData: String = oobData ?: "a"
|
||||
val hostMixedCase: Boolean = hostMixedCase ?: false
|
||||
val domainMixedCase: Boolean = domainMixedCase ?: false
|
||||
|
@ -40,7 +40,6 @@ class ByeDpiProxyService : LifecycleService() {
|
||||
private const val FOREGROUND_SERVICE_ID: Int = 2
|
||||
private const val NOTIFICATION_CHANNEL_ID: String = "ByeDPI Proxy"
|
||||
|
||||
@Volatile
|
||||
private var status: ServiceStatus = ServiceStatus.Disconnected
|
||||
}
|
||||
|
||||
|
@ -3,11 +3,9 @@ package io.github.dovecoteescapee.byedpi.services
|
||||
import io.github.dovecoteescapee.byedpi.data.AppStatus
|
||||
import io.github.dovecoteescapee.byedpi.data.Mode
|
||||
|
||||
@Volatile
|
||||
var appStatus = AppStatus.Halted to Mode.VPN
|
||||
private set
|
||||
|
||||
fun setStatus(status: AppStatus, mode: Mode) {
|
||||
appStatus = status to mode
|
||||
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ class ByeDpiVpnService : LifecycleVpnService() {
|
||||
private const val FOREGROUND_SERVICE_ID: Int = 1
|
||||
private const val NOTIFICATION_CHANNEL_ID: String = "ByeDPIVpn"
|
||||
|
||||
@Volatile
|
||||
private var status: ServiceStatus = ServiceStatus.Disconnected
|
||||
}
|
||||
|
||||
|
@ -118,7 +118,7 @@
|
||||
<com.takisoft.preferencex.EditTextPreference
|
||||
android:key="byedpi_fake_sni"
|
||||
android:title="SNI of fake packet"
|
||||
android:defaultValue="www.w3c.org"
|
||||
android:defaultValue="www.iana.org"
|
||||
app:useSimpleSummaryProvider="true" />
|
||||
|
||||
<com.takisoft.preferencex.EditTextPreference
|
||||
|
Loading…
Reference in New Issue
Block a user