Skip to content

Commit 1fd88bb

Browse files
committed
Merge branch 'dev'
2 parents 23d7df8 + 2df580b commit 1fd88bb

File tree

94 files changed

+2545
-423
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2545
-423
lines changed

AndroidLibXrayLite/libv2ray_support.go

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func (d *ProtectedDialer) Dial(ctx context.Context,
250250
}
251251

252252
curIP := d.vServer.currentIP()
253-
conn, err := d.fdConn(ctx, curIP, d.vServer.Port, fd)
253+
conn, err := d.fdConn(ctx, curIP, d.vServer.Port, dest.Network, fd)
254254
if err != nil {
255255
d.vServer.NextIP()
256256
return nil, err
@@ -273,14 +273,14 @@ func (d *ProtectedDialer) Dial(ctx context.Context,
273273

274274
// use the first resolved address.
275275
// the result IP may vary, eg: IPv6 addrs comes first if client has ipv6 address
276-
return d.fdConn(ctx, resolved.IPs[0], resolved.Port, fd)
276+
return d.fdConn(ctx, resolved.IPs[0], resolved.Port, dest.Network, fd)
277277
}
278278

279279
func (d *ProtectedDialer) DestIpAddress() net.IP {
280280
return d.vServer.currentIP()
281281
}
282282

283-
func (d *ProtectedDialer) fdConn(ctx context.Context, ip net.IP, port int, fd int) (net.Conn, error) {
283+
func (d *ProtectedDialer) fdConn(ctx context.Context, ip net.IP, port int, network v2net.Network, fd int) (net.Conn, error) {
284284

285285
defer unix.Close(fd)
286286

@@ -295,9 +295,16 @@ func (d *ProtectedDialer) fdConn(ctx context.Context, ip net.IP, port int, fd in
295295
}
296296
copy(sa.Addr[:], ip.To16())
297297

298-
if err := unix.Connect(fd, sa); err != nil {
299-
log.Printf("fdConn unix.Connect err, Close Fd: %d Err: %v", fd, err)
300-
return nil, err
298+
if network == v2net.Network_UDP {
299+
if err := unix.Bind(fd, &unix.SockaddrInet6{}); err != nil {
300+
log.Printf("fdConn unix.Bind err, Close Fd: %d Err: %v", fd, err)
301+
return nil, err
302+
}
303+
} else {
304+
if err := unix.Connect(fd, sa); err != nil {
305+
log.Printf("fdConn unix.Connect err, Close Fd: %d Err: %v", fd, err)
306+
return nil, err
307+
}
301308
}
302309

303310
file := os.NewFile(uintptr(fd), "Socket")
@@ -308,11 +315,25 @@ func (d *ProtectedDialer) fdConn(ctx context.Context, ip net.IP, port int, fd in
308315

309316
defer file.Close()
310317
//Closing conn does not affect file, and closing file does not affect conn.
311-
conn, err := net.FileConn(file)
312-
if err != nil {
313-
log.Printf("fdConn FileConn Close Fd: %d Err: %v", fd, err)
314-
return nil, err
318+
if network == v2net.Network_UDP {
319+
packetConn, err := net.FilePacketConn(file)
320+
if err != nil {
321+
log.Printf("fdConn FilePacketConn Close Fd: %d Err: %v", fd, err)
322+
return nil, err
323+
}
324+
return &v2internet.PacketConnWrapper{
325+
Conn: packetConn,
326+
Dest: &net.UDPAddr{
327+
IP: ip,
328+
Port: port,
329+
},
330+
}, nil
331+
} else {
332+
conn, err := net.FileConn(file)
333+
if err != nil {
334+
log.Printf("fdConn FileConn Close Fd: %d Err: %v", fd, err)
335+
return nil, err
336+
}
337+
return conn, nil
315338
}
316-
317-
return conn, nil
318339
}

app/libs/particlesview-1.0.9.aar

-14.8 KB
Binary file not shown.

app/src/main/AndroidManifest.xml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
android:name="com.neko.splash.SplashActivity"
6262
android:exported="true"
6363
android:launchMode="singleTask"
64+
android:screenOrientation="portrait"
6465
android:theme="@style/uwu_splash_theme">
6566
<intent-filter>
6667
<action android:name="android.intent.action.MAIN" />
@@ -80,70 +81,84 @@
8081
android:theme="@style/AppThemeDayNight.NoActionBar"
8182
android:name="com.neko.v2ray.ui.MainActivity"
8283
android:exported="true"
83-
android:launchMode="singleTask"
84-
android:screenOrientation="portrait" />
84+
android:screenOrientation="portrait"
85+
android:launchMode="singleTask" />
8586
<activity
8687
android:exported="false"
8788
android:theme="@style/AppThemeDayNight.NoActionBar"
8889
android:name=".ui.ServerActivity"
90+
android:screenOrientation="portrait"
8991
android:windowSoftInputMode="adjustPan" />
9092
<activity
9193
android:exported="false"
9294
android:theme="@style/AppThemeDayNight.NoActionBar"
9395
android:name=".ui.ServerCustomConfigActivity"
96+
android:screenOrientation="portrait"
9497
android:windowSoftInputMode="adjustPan" />
9598
<activity
9699
android:exported="false"
97100
android:theme="@style/AppThemeDayNight.NoActionBar"
101+
android:screenOrientation="portrait"
98102
android:name=".ui.SettingsActivity" />
99103
<activity
100104
android:exported="false"
101105
android:theme="@style/AppThemeDayNight.NoActionBar"
106+
android:screenOrientation="portrait"
102107
android:name=".ui.PerAppProxyActivity" />
103108
<activity
104109
android:exported="false"
105110
android:theme="@style/AppThemeDayNight.NoActionBar"
111+
android:screenOrientation="portrait"
106112
android:name=".ui.ScannerActivity" />
107113
<activity
108114
android:exported="false"
109115
android:theme="@style/AppThemeDayNight.NoActionBar"
116+
android:screenOrientation="portrait"
110117
android:name=".ui.LogcatActivity" />
111118
<activity
112119
android:exported="false"
113120
android:theme="@style/AppThemeDayNight.NoActionBar"
114121
android:name=".ui.RoutingSettingsActivity"
122+
android:screenOrientation="portrait"
115123
android:windowSoftInputMode="adjustPan" />
116124
<activity
117125
android:exported="false"
118126
android:theme="@style/AppThemeDayNight.NoActionBar"
127+
android:screenOrientation="portrait"
119128
android:name=".ui.SubSettingActivity" />
120129
<activity
121130
android:exported="false"
122131
android:theme="@style/AppThemeDayNight.NoActionBar"
132+
android:screenOrientation="portrait"
123133
android:name=".ui.UserAssetActivity" />
124134
<activity
125135
android:exported="false"
126136
android:theme="@style/AppThemeDayNight.NoActionBar"
137+
android:screenOrientation="portrait"
127138
android:name=".ui.UserAssetUrlActivity"
128139
android:windowSoftInputMode="adjustPan" />
129140

130141
<activity
131142
android:exported="false"
132143
android:theme="@style/AppThemeDayNight.NoActionBar"
144+
android:screenOrientation="portrait"
133145
android:name=".ui.SubEditActivity"
134146
android:windowSoftInputMode="adjustPan" />
135147
<activity
136148
android:exported="false"
149+
android:screenOrientation="portrait"
137150
android:name=".ui.ScScannerActivity" />
138151
<activity
139152
android:exported="false"
140153
android:name=".ui.ScSwitchActivity"
141154
android:excludeFromRecents="true"
142155
android:process=":RunSoLibV2RayDaemon"
156+
android:screenOrientation="portrait"
143157
android:theme="@style/AppTheme.NoActionBar.Translucent" />
144158

145159
<activity
146160
android:exported="true"
161+
android:screenOrientation="portrait"
147162
android:name=".ui.UrlSchemeActivity">
148163
<intent-filter>
149164
<action android:name="android.intent.action.SEND" />
@@ -163,35 +178,40 @@
163178
</activity>
164179
<activity
165180
android:exported="false"
181+
android:screenOrientation="portrait"
166182
android:name=".ui.AboutActivity" />
167183

168184
<activity
169185
android:theme="@style/AppThemeDayNight.NoActionBar"
170186
android:name="com.neko.v2ray.ui.CreditsActivity"
171187
android:parentActivityName="com.neko.v2ray.ui.MainActivity"
188+
android:screenOrientation="portrait"
172189
android:exported="false" />
173190

174191
<activity
175192
android:theme="@style/AppThemeDayNight.NoActionBar"
176193
android:name="com.neko.v2ray.ui.NekoAboutActivity"
177194
android:parentActivityName="com.neko.v2ray.ui.MainActivity"
195+
android:screenOrientation="portrait"
178196
android:exported="false" />
179197

180198
<activity
181199
android:theme="@style/AppThemeDayNight.NoActionBar"
182200
android:name="com.neko.v2ray.ui.NekoBackupActivity"
183201
android:parentActivityName="com.neko.v2ray.ui.MainActivity"
202+
android:screenOrientation="portrait"
184203
android:exported="false" />
185204

186205
<activity
187206
android:name="com.neko.tools.NetworkSwitcher"
207+
android:screenOrientation="portrait"
188208
android:exported="false" />
189209

190210
<activity
191211
android:theme="@style/AppThemeDayNight.NoActionBar"
192212
android:name="com.neko.tools.SpeedTestActivity"
193-
android:exported="false"
194-
android:screenOrientation="portrait" />
213+
android:screenOrientation="portrait"
214+
android:exported="false" />
195215

196216
<activity
197217
android:theme="@style/AppThemeDayNight.NoActionBar"
@@ -216,8 +236,8 @@
216236

217237
<activity android:name="com.mikepenz.aboutlibraries.ui.LibsActivity"
218238
android:theme="@style/AppThemeDayNight.NoActionBar"
219-
android:exported="false"
220-
android:screenOrientation="portrait" />
239+
android:screenOrientation="portrait"
240+
android:exported="false" />
221241

222242
<service
223243
android:name=".service.V2RayVpnService"
@@ -287,6 +307,7 @@
287307
<!-- =====================Tasker===================== -->
288308
<activity
289309
android:exported="true"
310+
android:screenOrientation="portrait"
290311
android:name=".ui.TaskerActivity"
291312
android:icon="@mipmap/ic_launcher"
292313
android:label="@string/app_name">

app/src/main/kotlin/com/neko/v2ray/ui/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,15 +211,15 @@ class MainActivity : BaseActivity(), NavigationView.OnNavigationItemSelectedList
211211
mainViewModel.isRunning.observe(this) { isRunning ->
212212
adapter.isRunning = isRunning
213213
if (isRunning) {
214-
binding.fab.setImageResource(R.drawable.uwu_ic_service_busy)
214+
binding.fab.setImageResource(R.drawable.ic_stop_24dp)
215215
expandableConnection.expand()
216216
expandableConnection.orientation = ExpandableView.HORIZONTAL
217217
expandableConnection.setExpansion(true)
218218
// binding.fab.backgroundTintList = ColorStateList.valueOf(ContextCompat.getColor(this, R.color.color_fab_orange))
219219
setTestState(getString(R.string.connection_connected))
220220
binding.layoutTest.isFocusable = true
221221
} else {
222-
binding.fab.setImageResource(R.drawable.uwu_ic_service_idle)
222+
binding.fab.setImageResource(R.drawable.ic_play_24dp)
223223
expandableConnection.collapse()
224224
expandableConnection.orientation = ExpandableView.HORIZONTAL
225225
expandableConnection.setExpansion(false)

app/src/main/res/color/uwu_accent_alpha.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<selector
33
xmlns:android="http://schemas.android.com/apk/res/android">
44
<item
5-
android:color="?colorPrimary"
5+
android:color="?attr/colorThemeUwu"
66
android:alpha="0.3" />
77
</selector>

app/src/main/res/color/uwu_accent_alpha1.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<selector
33
xmlns:android="http://schemas.android.com/apk/res/android">
44
<item
5-
android:color="?attr/colorPrimary"
5+
android:color="?attr/colorThemeUwu"
66
android:alpha="0.4" />
77
</selector>

app/src/main/res/color/uwu_switch_on_bg.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
<selector
33
xmlns:android="http://schemas.android.com/apk/res/android">
44
<item
5-
android:color="?attr/colorPrimary" />
5+
android:color="?attr/colorThemeUwu" />
66
</selector>

app/src/main/res/drawable/round.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<selector xmlns:android="http://schemas.android.com/apk/res/android">
33
<item>
44
<shape android:shape="rectangle">
5-
<solid android:color="?colorPrimary" />
5+
<solid android:color="?attr/colorThemeUwu" />
66
<corners android:radius="500dp" />
77
</shape>
88
</item>

app/src/main/res/drawable/uwu_background_lengkung.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<shape
66
android:shape="rectangle">
77
<solid
8-
android:color="?attr/colorPrimary" />
8+
android:color="?attr/colorThemeUwu" />
99
</shape>
1010
</item>
1111
<item>

app/src/main/res/drawable/uwu_background_lengkung_bottom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<shape
66
android:shape="rectangle">
77
<solid
8-
android:color="?attr/colorPrimary" />
8+
android:color="?attr/colorThemeUwu" />
99
</shape>
1010
</item>
1111
<item>

0 commit comments

Comments
 (0)