Skip to content

Commit 65cfecc

Browse files
Small fixes
1 parent 52bf3cc commit 65cfecc

File tree

7 files changed

+13
-17
lines changed

7 files changed

+13
-17
lines changed

app/src/main/cpp/native-lib.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@ extern int get_default_ttl();
2323

2424
extern int get_addr(const char *str, struct sockaddr_ina *addr);
2525

26-
JNIEXPORT jint JNICALL
27-
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_00024Companion_jniInit(JNIEnv *env, jobject thiz) {
26+
JNIEXPORT jint JNI_OnLoad(JavaVM *vm, __attribute__((unused)) void *reserved) {
2827
oob_data.data = NULL;
29-
return 0;
28+
return JNI_VERSION_1_6;
3029
}
3130

3231
JNIEXPORT jint JNICALL
3332
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniCreateSocket(
3433
JNIEnv *env,
35-
jobject thiz,
34+
__attribute__((unused)) jobject thiz,
3635
jstring ip,
3736
jint port,
3837
jint max_connections,
@@ -128,8 +127,10 @@ Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniCreateSocket(
128127
}
129128

130129
JNIEXPORT jint JNICALL
131-
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStartProxy(JNIEnv *env, jobject thiz,
132-
jint fd) {
130+
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStartProxy(
131+
__attribute__((unused)) JNIEnv *env,
132+
__attribute__((unused)) jobject thiz,
133+
jint fd) {
133134
LOG(LOG_S, "start_proxy, fd: %d", fd);
134135
NOT_EXIT = 1;
135136
if (event_loop(fd) < 0) {
@@ -139,8 +140,10 @@ Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStartProxy(JNIEnv *env
139140
}
140141

141142
JNIEXPORT jint JNICALL
142-
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStopProxy(JNIEnv *env, jobject thiz,
143-
jint fd) {
143+
Java_io_github_dovecoteescapee_byedpi_core_ByeDpiProxy_jniStopProxy(
144+
__attribute__((unused)) JNIEnv *env,
145+
__attribute__((unused)) jobject thiz,
146+
jint fd) {
144147
LOG(LOG_S, "stop_proxy, fd: %d", fd);
145148
if (shutdown(fd, SHUT_RDWR) < 0) {
146149
return get_e();

app/src/main/java/io/github/dovecoteescapee/byedpi/core/ByeDpiProxy.kt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ class ByeDpiProxy {
88
companion object {
99
init {
1010
System.loadLibrary("byedpi")
11-
jniInit()
1211
}
13-
14-
private external fun jniInit(): Int
1512
}
1613

1714
private val mutex = Mutex()

app/src/main/java/io/github/dovecoteescapee/byedpi/core/ByeDpiProxyPreferences.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class ByeDpiProxyPreferences(
3434
val splitPosition: Int = splitPosition ?: 3
3535
val splitAtHost: Boolean = splitAtHost ?: false
3636
val fakeTtl: Int = fakeTtl ?: 8
37-
val fakeSni: String = fakeSni ?: "www.w3c.org"
37+
val fakeSni: String = fakeSni ?: "www.iana.org"
3838
val oobData: String = oobData ?: "a"
3939
val hostMixedCase: Boolean = hostMixedCase ?: false
4040
val domainMixedCase: Boolean = domainMixedCase ?: false

app/src/main/java/io/github/dovecoteescapee/byedpi/services/ByeDpiProxyService.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ class ByeDpiProxyService : LifecycleService() {
4040
private const val FOREGROUND_SERVICE_ID: Int = 2
4141
private const val NOTIFICATION_CHANNEL_ID: String = "ByeDPI Proxy"
4242

43-
@Volatile
4443
private var status: ServiceStatus = ServiceStatus.Disconnected
4544
}
4645

app/src/main/java/io/github/dovecoteescapee/byedpi/services/ByeDpiStatus.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ package io.github.dovecoteescapee.byedpi.services
33
import io.github.dovecoteescapee.byedpi.data.AppStatus
44
import io.github.dovecoteescapee.byedpi.data.Mode
55

6-
@Volatile
76
var appStatus = AppStatus.Halted to Mode.VPN
87
private set
98

109
fun setStatus(status: AppStatus, mode: Mode) {
1110
appStatus = status to mode
12-
1311
}

app/src/main/java/io/github/dovecoteescapee/byedpi/services/ByeDpiVpnService.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ class ByeDpiVpnService : LifecycleVpnService() {
4747
private const val FOREGROUND_SERVICE_ID: Int = 1
4848
private const val NOTIFICATION_CHANNEL_ID: String = "ByeDPIVpn"
4949

50-
@Volatile
5150
private var status: ServiceStatus = ServiceStatus.Disconnected
5251
}
5352

app/src/main/res/xml/settings.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<com.takisoft.preferencex.EditTextPreference
119119
android:key="byedpi_fake_sni"
120120
android:title="SNI of fake packet"
121-
android:defaultValue="www.w3c.org"
121+
android:defaultValue="www.iana.org"
122122
app:useSimpleSummaryProvider="true" />
123123

124124
<com.takisoft.preferencex.EditTextPreference

0 commit comments

Comments
 (0)