() {}.type,
53 | JsonSerializer { src: Double?, _: Type?, _: JsonSerializationContext? ->
54 | JsonPrimitive(
55 | src?.toInt()
56 | )
57 | }
58 | )
59 | .create()
60 | return gsonPre.toJson(src)
61 | }
62 |
63 | /**
64 | * Parses a JSON string into a JsonObject.
65 | *
66 | * @param src The JSON string to parse.
67 | * @return The parsed JsonObject, or null if parsing fails.
68 | */
69 | fun parseString(src: String?): JsonObject? {
70 | if (src == null)
71 | return null
72 | try {
73 | return JsonParser.parseString(src).getAsJsonObject()
74 | } catch (e: Exception) {
75 | Log.e(AppConfig.TAG, "Failed to parse JSON string", e)
76 | return null
77 | }
78 | }
79 | }
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/java/com/v2ray/ang/util/MessageUtil.kt:
--------------------------------------------------------------------------------
1 | package com.v2ray.ang.util
2 |
3 | import android.content.ComponentName
4 | import android.content.Context
5 | import android.content.Intent
6 | import android.util.Log
7 | import com.v2ray.ang.AppConfig
8 | import com.v2ray.ang.service.V2RayTestService
9 | import java.io.Serializable
10 |
11 | object MessageUtil {
12 |
13 |
14 | /**
15 | * Sends a message to the service.
16 | *
17 | * @param ctx The context.
18 | * @param what The message identifier.
19 | * @param content The message content.
20 | */
21 | fun sendMsg2Service(ctx: Context, what: Int, content: Serializable) {
22 | sendMsg(ctx, AppConfig.BROADCAST_ACTION_SERVICE, what, content)
23 | }
24 |
25 | /**
26 | * Sends a message to the UI.
27 | *
28 | * @param ctx The context.
29 | * @param what The message identifier.
30 | * @param content The message content.
31 | */
32 | fun sendMsg2UI(ctx: Context, what: Int, content: Serializable) {
33 | sendMsg(ctx, AppConfig.BROADCAST_ACTION_ACTIVITY, what, content)
34 | }
35 |
36 | /**
37 | * Sends a message to the test service.
38 | *
39 | * @param ctx The context.
40 | * @param what The message identifier.
41 | * @param content The message content.
42 | */
43 | fun sendMsg2TestService(ctx: Context, what: Int, content: Serializable) {
44 | try {
45 | val intent = Intent()
46 | intent.component = ComponentName(ctx, V2RayTestService::class.java)
47 | intent.putExtra("key", what)
48 | intent.putExtra("content", content)
49 | ctx.startService(intent)
50 | } catch (e: Exception) {
51 | Log.e(AppConfig.TAG, "Failed to send message to test service", e)
52 | }
53 | }
54 |
55 | /**
56 | * Sends a message with the specified action.
57 | *
58 | * @param ctx The context.
59 | * @param action The action string.
60 | * @param what The message identifier.
61 | * @param content The message content.
62 | */
63 | private fun sendMsg(ctx: Context, action: String, what: Int, content: Serializable) {
64 | try {
65 | val intent = Intent()
66 | intent.action = action
67 | intent.`package` = AppConfig.ANG_PACKAGE
68 | intent.putExtra("key", what)
69 | intent.putExtra("content", content)
70 | ctx.sendBroadcast(intent)
71 | } catch (e: Exception) {
72 | Log.e(AppConfig.TAG, "Failed to send message with action: $action", e)
73 | }
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/java/com/v2ray/ang/util/MyContextWrapper.kt:
--------------------------------------------------------------------------------
1 | package com.v2ray.ang.util
2 |
3 | import android.content.Context
4 | import android.content.ContextWrapper
5 | import android.content.res.Configuration
6 | import android.content.res.Resources
7 | import android.os.Build
8 | import android.os.LocaleList
9 | import androidx.annotation.RequiresApi
10 | import java.util.Locale
11 |
12 | open class MyContextWrapper(base: Context?) : ContextWrapper(base) {
13 | companion object {
14 | /**
15 | * Wraps the context with a new locale.
16 | *
17 | * @param context The original context.
18 | * @param newLocale The new locale to set.
19 | * @return A ContextWrapper with the new locale.
20 | */
21 | @RequiresApi(Build.VERSION_CODES.N)
22 | fun wrap(context: Context, newLocale: Locale?): ContextWrapper {
23 | var mContext = context
24 | val res: Resources = mContext.resources
25 | val configuration: Configuration = res.configuration
26 | mContext = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
27 | configuration.setLocale(newLocale)
28 | val localeList = LocaleList(newLocale)
29 | LocaleList.setDefault(localeList)
30 | configuration.setLocales(localeList)
31 | mContext.createConfigurationContext(configuration)
32 | } else {
33 | configuration.setLocale(newLocale)
34 | mContext.createConfigurationContext(configuration)
35 | }
36 | return ContextWrapper(mContext)
37 | }
38 | }
39 | }
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/color/color_highlight_material.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-hdpi/ic_stat_direct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-hdpi/ic_stat_direct.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-hdpi/ic_stat_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-hdpi/ic_stat_name.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-hdpi/ic_stat_proxy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-hdpi/ic_stat_proxy.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_direct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_direct.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_name.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_name_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_name_black.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_proxy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-mdpi/ic_stat_proxy.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_about_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_action_done.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_add_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_backup_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_check_update_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_cloud_download_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_copy.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_delete_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_description_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_edit_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_fab_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_feedback_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_file_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_image_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_lock_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_logcat_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_more_vert_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_outline_filter_alt_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_per_apps_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_play_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_privacy_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_promotion_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_restore_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_routing_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_save_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_scan_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_select_all_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_settings_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_share_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_source_code_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_stop_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_subscriptions_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/ic_telegram_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-night/nav_header_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-night/nav_header_bg.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_direct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_direct.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_name.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_name_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_name_black.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_proxy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xhdpi/ic_stat_proxy.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_direct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_direct.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_name.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_name_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_name_black.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_proxy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxhdpi/ic_stat_proxy.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_direct.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_direct.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_name_black.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_name_black.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_proxy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable-xxxhdpi/ic_stat_proxy.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/custom_divider.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | -
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_about_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_action_done.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_add_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_backup_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_check_update_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_circle.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_cloud_download_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_copy.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_delete_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_description_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_edit_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_fab_check.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_feedback_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_file_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_image_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_lock_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_logcat_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
15 |
16 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_more_vert_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_outline_filter_alt_24.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_per_apps_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_play_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_privacy_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_promotion_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_qu_scan_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_qu_switch_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
13 |
14 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_restore_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_rounded_corner_active.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_rounded_corner_inactive.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_routing_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_save_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_scan_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
7 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_select_all_24dp.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_settings_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_share_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_source_code_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_stop_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_subscriptions_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/ic_telegram_24dp.xml:
--------------------------------------------------------------------------------
1 |
6 |
9 |
10 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/license_24px.xml:
--------------------------------------------------------------------------------
1 |
7 |
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/drawable/nav_header_bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/drawable/nav_header_bg.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/font/montserrat_thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/font/montserrat_thin.ttf
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_logcat.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
14 |
15 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_none.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_server_shadowsocks.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
17 |
22 |
23 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
42 |
43 |
47 |
48 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_server_socks.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
17 |
22 |
23 |
27 |
28 |
29 |
34 |
35 |
36 |
37 |
42 |
43 |
47 |
48 |
53 |
54 |
55 |
56 |
62 |
63 |
64 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_server_trojan.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
17 |
22 |
23 |
27 |
28 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_server_vmess.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
14 |
15 |
16 |
17 |
22 |
23 |
27 |
28 |
33 |
34 |
35 |
36 |
41 |
42 |
46 |
47 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
66 |
67 |
68 |
69 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
15 |
16 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_sub_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
17 |
18 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/activity_tasker.xml:
--------------------------------------------------------------------------------
1 |
10 |
11 |
15 |
16 |
24 |
25 |
33 |
34 |
35 |
36 |
41 |
42 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/dialog_config_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
11 |
12 |
17 |
18 |
24 |
25 |
26 |
27 |
32 |
33 |
37 |
38 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/item_qrcode.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
16 |
17 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/item_recycler_bypass_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
23 |
24 |
30 |
31 |
38 |
39 |
40 |
47 |
48 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/item_recycler_footer.xml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
17 |
18 |
23 |
24 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/item_recycler_logcat.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
22 |
23 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/layout_address_port.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
11 |
12 |
17 |
18 |
19 |
24 |
25 |
29 |
30 |
35 |
36 |
37 |
38 |
43 |
44 |
48 |
49 |
54 |
55 |
56 |
57 |
62 |
63 |
67 |
68 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/nav_header.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/preference_with_help_link.xml:
--------------------------------------------------------------------------------
1 |
2 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/layout/widget_switch.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
16 |
17 |
23 |
24 |
25 |
31 |
32 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/action_server.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
14 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/action_sub_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
14 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/menu_asset.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 | -
8 |
9 |
13 |
17 |
21 |
22 |
23 |
28 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/menu_bypass_list.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
15 |
16 |
21 |
22 |
27 |
28 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/menu_drawer.xml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 |
11 |
15 |
19 |
23 |
27 |
28 |
29 |
30 |
34 |
38 |
42 |
46 |
47 |
51 |
52 |
53 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/menu_logcat.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
10 |
15 |
20 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/menu_routing_setting.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
13 |
17 |
21 |
25 |
26 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/menu/menu_scanner.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
9 |
14 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-anydpi-v26/ic_banner.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
8 |
9 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_banner.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_banner_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_banner_foreground.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/raw/licenses.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Android Compatibility Library v4
4 | http://source.android.com
5 | Copyright(C) 2008-2011 The Android Open Source Project
6 | Apache Software License 2.0
7 |
8 |
9 | Android Compatibility Library v7
10 | http://source.android.com
11 | Copyright(C) 2008-2011 The Android Open Source Project
12 | Apache Software License 2.0
13 |
14 |
15 | Android Design Library
16 | http://source.android.com
17 | Copyright(C) 2008-2011 The Android Open Source Project
18 | Apache Software License 2.0
19 |
20 |
21 | Google Gson
22 | https://github.com/google/gson
23 | Copyright 2008-2011 Google Inc.
24 | Apache Software License 2.0
25 |
26 |
27 | kotlin
28 | http://kotlinlang.org/
29 | Copyright 2010-2016 JetBrains s.r.o.
30 | Apache Software License 2.0
31 |
32 |
33 | LeakCanary
34 | https://github.com/square/leakcanary
35 | Copyright 2015 Square, Inc.
36 | Apache Software License 2.0
37 |
38 |
39 | RxPermissions
40 | https://github.com/tbruyelle/RxPermissions
41 | Apache Software License 2.0
42 |
43 |
44 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values-night/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #f97910
4 | #646464
5 | #BDBDBD
6 | #424242
7 |
8 | #212121
9 | #FFFFFF
10 |
11 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values-night/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
12 |
13 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values-sw360dp-v13/values-preference.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | false
4 | 0dp
5 |
6 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values/attrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #009966
4 | #FF0099
5 | #f97910
6 |
7 | #f97910
8 | #9C9C9C
9 | #727272
10 | #E0E0E0
11 |
12 | #F5F5F5
13 | #000000
14 |
15 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 4dp
4 | 8dp
5 | 16dp
6 | 24dp
7 | 36dp
8 | 48dp
9 | 64dp
10 | 160dp
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values/ic_banner_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values/ic_launcher_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/values/themes.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
11 |
12 |
16 |
17 |
18 |
19 |
20 |
25 |
26 |
31 |
32 |
35 |
36 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/xml/app_widget_provider.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/xml/cache_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/xml/network_security_config.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/main/res/xml/shortcuts.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
10 |
11 |
15 |
16 |
17 |
24 |
25 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/pre_release/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | v2rayNG (PR)
4 |
--------------------------------------------------------------------------------
/V2rayNG/app/src/test/java/com/v2ray/ang/HttpUtilTest.kt:
--------------------------------------------------------------------------------
1 | package com.v2ray.ang
2 |
3 | import com.v2ray.ang.util.HttpUtil
4 | import org.junit.Assert.assertEquals
5 | import org.junit.Test
6 |
7 | class HttpUtilTest {
8 |
9 | @Test
10 | fun testIdnToASCII() {
11 | // Regular URL remains unchanged
12 | val regularUrl = "https://example.com/path"
13 | assertEquals(regularUrl, HttpUtil.toIdnUrl(regularUrl))
14 |
15 | // Non-ASCII URL converts to ASCII (Punycode)
16 | val nonAsciiUrl = "https://例子.测试/path"
17 | val expectedNonAscii = "https://xn--fsqu00a.xn--0zwm56d/path"
18 | assertEquals(expectedNonAscii, HttpUtil.toIdnUrl(nonAsciiUrl))
19 |
20 | // Mixed URL only converts the host part
21 | val mixedUrl = "https://例子.com/测试"
22 | val expectedMixed = "https://xn--fsqu00a.com/测试"
23 | assertEquals(expectedMixed, HttpUtil.toIdnUrl(mixedUrl))
24 |
25 | // URL with Basic Authentication using regular domain
26 | val basicAuthUrl = "https://user:password@example.com/path"
27 | assertEquals(basicAuthUrl, HttpUtil.toIdnUrl(basicAuthUrl))
28 |
29 | // URL with Basic Authentication using non-ASCII domain
30 | val basicAuthNonAscii = "https://user:password@例子.测试/path"
31 | val expectedBasicAuthNonAscii = "https://user:password@xn--fsqu00a.xn--0zwm56d/path"
32 | assertEquals(expectedBasicAuthNonAscii, HttpUtil.toIdnUrl(basicAuthNonAscii))
33 |
34 | // URL with non-ASCII username and password
35 | val nonAsciiAuth = "https://用户:密码@example.com/path"
36 | // Basic auth credentials should remain unchanged as they're percent-encoded separately
37 | assertEquals(nonAsciiAuth, HttpUtil.toIdnUrl(nonAsciiAuth))
38 | }
39 |
40 |
41 | }
--------------------------------------------------------------------------------
/V2rayNG/app/src/test/java/com/v2ray/ang/UtilsTest.kt:
--------------------------------------------------------------------------------
1 | package com.v2ray.ang
2 |
3 | import com.v2ray.ang.util.Utils
4 | import org.junit.Assert.assertEquals
5 | import org.junit.Assert.assertFalse
6 | import org.junit.Assert.assertTrue
7 | import org.junit.Test
8 |
9 | /**
10 | * Example local unit test, which will execute on the development machine (host).
11 | *
12 | * See [testing documentation](http://d.android.com/tools/testing).
13 | */
14 | class UtilsTest {
15 |
16 | @Test
17 | fun test_parseInt() {
18 | assertEquals(Utils.parseInt("1234"), 1234)
19 | }
20 |
21 | @Test
22 | fun test_isIpAddress() {
23 | assertFalse(Utils.isIpAddress("114.113.112.266"))
24 | assertFalse(Utils.isIpAddress("666.666.666.666"))
25 | assertFalse(Utils.isIpAddress("256.0.0.0"))
26 | assertFalse(Utils.isIpAddress("::ffff:127.0.0.0.1"))
27 | assertFalse(Utils.isIpAddress("baidu.com"))
28 | assertFalse(Utils.isIpAddress(""))
29 |
30 | assertTrue(Utils.isIpAddress("127.0.0.1"))
31 | assertTrue(Utils.isIpAddress("127.0.0.1:80"))
32 | assertTrue(Utils.isIpAddress("0.0.0.0/0"))
33 | assertTrue(Utils.isIpAddress("::1"))
34 | assertTrue(Utils.isIpAddress("[::1]:80"))
35 | assertTrue(Utils.isIpAddress("2605:2700:0:3::4713:93e3"))
36 | assertTrue(Utils.isIpAddress("[2605:2700:0:3::4713:93e3]:80"))
37 | assertTrue(Utils.isIpAddress("::ffff:192.168.173.22"))
38 | assertTrue(Utils.isIpAddress("[::ffff:192.168.173.22]:80"))
39 | assertTrue(Utils.isIpAddress("1::"))
40 | assertTrue(Utils.isIpAddress("::"))
41 | assertTrue(Utils.isIpAddress("::/0"))
42 | assertTrue(Utils.isIpAddress("10.24.56.0/24"))
43 | assertTrue(Utils.isIpAddress("2001:4321::1"))
44 | assertTrue(Utils.isIpAddress("240e:1234:abcd:12::6666"))
45 | assertTrue(Utils.isIpAddress("240e:1234:abcd:12::/64"))
46 | }
47 |
48 | @Test
49 | fun test_IsIpInCidr() {
50 | assertTrue(Utils.isIpInCidr("192.168.1.1", "192.168.1.0/24"))
51 | assertTrue(Utils.isIpInCidr("192.168.1.254", "192.168.1.0/24"))
52 | assertFalse(Utils.isIpInCidr("192.168.2.1", "192.168.1.0/24"))
53 |
54 | assertTrue(Utils.isIpInCidr("10.0.0.0", "10.0.0.0/8"))
55 | assertTrue(Utils.isIpInCidr("10.255.255.255", "10.0.0.0/8"))
56 | assertFalse(Utils.isIpInCidr("11.0.0.0", "10.0.0.0/8"))
57 |
58 | assertFalse(Utils.isIpInCidr("invalid-ip", "192.168.1.0/24"))
59 | assertFalse(Utils.isIpInCidr("192.168.1.1", "invalid-cidr"))
60 | }
61 |
62 | }
--------------------------------------------------------------------------------
/V2rayNG/build.gradle.kts:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 | plugins {
3 | alias(libs.plugins.android.application) apply false
4 | alias(libs.plugins.android.library) apply false
5 | alias(libs.plugins.kotlin.android) apply false
6 | }
7 |
8 | buildscript {
9 | dependencies {
10 | classpath(libs.gradle.license.plugin)
11 | }
12 | }
13 |
14 |
--------------------------------------------------------------------------------
/V2rayNG/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | org.gradle.jvmargs=-Xmx4096m -Dfile.encoding=UTF-8
10 | # When configured, Gradle will run in incubating parallel mode.
11 | # This option should only be used with decoupled projects. For more details, visit
12 | # https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects
13 | # org.gradle.parallel=true
14 | # AndroidX package structure to make it clearer which packages are bundled with the
15 | # Android operating system, and which are packaged with your app's APK
16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn
17 | android.useAndroidX=true
18 | # Kotlin code style for this project: "official" or "obsolete":
19 | kotlin.code.style=official
20 | # Enables namespacing of each library's R class so that its R class includes only the
21 | # resources declared in the library itself and none from the library's dependencies,
22 | # thereby reducing the size of the R class for that library
23 | android.nonTransitiveRClass=true
24 | kotlin.incremental=true
--------------------------------------------------------------------------------
/V2rayNG/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/V2rayNG/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/V2rayNG/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Thu Nov 14 12:42:51 BDT 2024
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
5 | zipStoreBase=GRADLE_USER_HOME
6 | zipStorePath=wrapper/dists
7 |
--------------------------------------------------------------------------------
/V2rayNG/gradlew.bat:
--------------------------------------------------------------------------------
1 | @rem
2 | @rem Copyright 2015 the original author or authors.
3 | @rem
4 | @rem Licensed under the Apache License, Version 2.0 (the "License");
5 | @rem you may not use this file except in compliance with the License.
6 | @rem You may obtain a copy of the License at
7 | @rem
8 | @rem https://www.apache.org/licenses/LICENSE-2.0
9 | @rem
10 | @rem Unless required by applicable law or agreed to in writing, software
11 | @rem distributed under the License is distributed on an "AS IS" BASIS,
12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | @rem See the License for the specific language governing permissions and
14 | @rem limitations under the License.
15 | @rem
16 |
17 | @if "%DEBUG%" == "" @echo off
18 | @rem ##########################################################################
19 | @rem
20 | @rem Gradle startup script for Windows
21 | @rem
22 | @rem ##########################################################################
23 |
24 | @rem Set local scope for the variables with windows NT shell
25 | if "%OS%"=="Windows_NT" setlocal
26 |
27 | set DIRNAME=%~dp0
28 | if "%DIRNAME%" == "" set DIRNAME=.
29 | set APP_BASE_NAME=%~n0
30 | set APP_HOME=%DIRNAME%
31 |
32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter.
33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34 |
35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
37 |
38 | @rem Find java.exe
39 | if defined JAVA_HOME goto findJavaFromJavaHome
40 |
41 | set JAVA_EXE=java.exe
42 | %JAVA_EXE% -version >NUL 2>&1
43 | if "%ERRORLEVEL%" == "0" goto execute
44 |
45 | echo.
46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47 | echo.
48 | echo Please set the JAVA_HOME variable in your environment to match the
49 | echo location of your Java installation.
50 |
51 | goto fail
52 |
53 | :findJavaFromJavaHome
54 | set JAVA_HOME=%JAVA_HOME:"=%
55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56 |
57 | if exist "%JAVA_EXE%" goto execute
58 |
59 | echo.
60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61 | echo.
62 | echo Please set the JAVA_HOME variable in your environment to match the
63 | echo location of your Java installation.
64 |
65 | goto fail
66 |
67 | :execute
68 | @rem Setup the command line
69 |
70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
71 |
72 |
73 | @rem Execute Gradle
74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
75 |
76 | :end
77 | @rem End local scope for the variables with windows NT shell
78 | if "%ERRORLEVEL%"=="0" goto mainEnd
79 |
80 | :fail
81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82 | rem the _cmd.exe /c_ return code!
83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84 | exit /b 1
85 |
86 | :mainEnd
87 | if "%OS%"=="Windows_NT" endlocal
88 |
89 | :omega
90 |
--------------------------------------------------------------------------------
/V2rayNG/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | repositories {
3 | google {
4 | content {
5 | includeGroupByRegex("com\\.android.*")
6 | includeGroupByRegex("com\\.google.*")
7 | includeGroupByRegex("androidx.*")
8 | }
9 | }
10 | mavenCentral()
11 | gradlePluginPortal()
12 | }
13 | }
14 | dependencyResolutionManagement {
15 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
16 | repositories {
17 | google()
18 | mavenCentral()
19 | maven { url = uri("https://jitpack.io") }
20 | }
21 | }
22 |
23 | rootProject.name = "v2rayNG"
24 | include(":app")
25 |
--------------------------------------------------------------------------------
/compile-tun2socks.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -o errexit
3 | set -o pipefail
4 | set -o nounset
5 | # Set magic variables for current file & dir
6 | __dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
7 | __file="${__dir}/$(basename "${BASH_SOURCE[0]}")"
8 | __base="$(basename ${__file} .sh)"
9 | if [[ ! -d $NDK_HOME ]]; then
10 | echo "Android NDK: NDK_HOME not found. please set env \$NDK_HOME"
11 | exit 1
12 | fi
13 | TMPDIR=$(mktemp -d)
14 | clear_tmp () {
15 | rm -rf $TMPDIR
16 | }
17 | trap 'echo -e "Aborted, error $? in command: $BASH_COMMAND"; trap ERR; clear_tmp; exit 1' ERR INT
18 | install -m644 $__dir/tun2socks.mk $TMPDIR/
19 | pushd $TMPDIR
20 | ln -s $__dir/badvpn badvpn
21 | ln -s $__dir/libancillary libancillary
22 | $NDK_HOME/ndk-build \
23 | NDK_PROJECT_PATH=. \
24 | APP_BUILD_SCRIPT=./tun2socks.mk \
25 | APP_ABI=all \
26 | APP_PLATFORM=android-21 \
27 | NDK_LIBS_OUT=$TMPDIR/libs \
28 | NDK_OUT=$TMPDIR/tmp \
29 | APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -j4
30 | cp -r $TMPDIR/libs $__dir/
31 | popd
32 | rm -rf $TMPDIR
33 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/full_description.txt:
--------------------------------------------------------------------------------
1 | A V2Ray client for Android, support Xray core and v2fly core
2 |
3 | Telegram Channel
4 |
5 | github_2dust
6 |
7 | Usage
8 |
9 | Geoip and Geosite
10 |
11 |
12 | geoip.dat and geosite.dat files are in Android/data/com.v2ray.ang/files/assets
(path may differ on some Android device)
13 | download feature will get enhanced version in this repo (Note it need a working proxy)
14 | latest official domain list and ip list can be imported manually
15 | possible to use third party dat file in the same folder, like h2y
16 |
17 |
18 | More in our wiki
19 |
20 | Development guide
21 |
22 | Android project under V2rayNG folder can be compiled directly in Android Studio, or using Gradle wrapper. But the v2ray core inside the aar is (probably) outdated.
23 | The aar can be compiled from the Golang project AndroidLibV2rayLite or AndroidLibXrayLite .
24 | For a quick start, read guide for Go Mobile and Makefiles for Go Developers
25 |
26 | v2rayNG can run on Android Emulators. For WSA, VPN permission need to be granted via
27 | appops set [package name] ACTIVATE_VPN allow
28 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/images/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/2dust/v2rayNG/9d1f98ff34c2e085389357c500e2ce22987cae9e/fastlane/metadata/android/en-US/images/icon.png
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/short_description.txt:
--------------------------------------------------------------------------------
1 | A V2Ray client for Android, support Xray core and v2fly core
2 |
--------------------------------------------------------------------------------
/fastlane/metadata/android/en-US/title.txt:
--------------------------------------------------------------------------------
1 | v2rayNG
2 |
--------------------------------------------------------------------------------
/libhysteria2.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | targets=(
4 | "aarch64-linux-android21 arm64 arm64-v8a"
5 | "armv7a-linux-androideabi21 arm armeabi-v7a"
6 | "x86_64-linux-android21 amd64 x86_64"
7 | "i686-linux-android21 386 x86"
8 | )
9 |
10 | cd "hysteria" || exit
11 |
12 | for target in "${targets[@]}"; do
13 | IFS=' ' read -r ndk_target goarch abi <<< "$target"
14 |
15 | echo "Building for ${abi} with ${ndk_target} (${goarch})"
16 |
17 | CC="${NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/${ndk_target}-clang" CGO_ENABLED=1 GOOS=android GOARCH=$goarch go build -o libs/$abi/libhysteria2.so -trimpath -ldflags "-s -w -buildid=" -buildvcs=false ./app
18 |
19 | echo "Built libhysteria2.so for ${abi}"
20 | done
21 |
--------------------------------------------------------------------------------