mirror of
https://github.com/openlibrecommunity/olcng.git
synced 2026-07-03 14:05:17 +02:00
02a9d641880b85b4718972409917e0d8c84770ef
* Add unit tests for ShadowsocksFmt protocol formatter - Add comprehensive test coverage for Shadowsocks URL parsing - Test SIP002 format (modern) with base64 encoded userinfo - Test legacy format with full base64 encoding - Test URI generation and round-trip consistency - Cover edge cases: IPv6 addresses, empty remarks, various encryption methods - Mock Android Base64 and Log classes for unit test execution * Adding URL decoding before Base64 decoding. The flow is now: extract → URL decode → Base64 decode. * Fix test naming convention to match project standards Change test method names from backtick-delimited descriptive names to underscore-separated format with test_ prefix to align with existing project conventions (e.g., test_parseInt in UtilsTest). Before: `parseSip002 valid URL with base64 encoded userinfo`() After: test_parseSip002_validUrlWithBase64EncodedUserinfo() * Fix Base64 mock to properly handle encoding flags The mock now inspects the flags parameter and applies URL-safe encoding and padding removal conditionally based on actual flag values (URL_SAFE, NO_PADDING) instead of unconditionally using withoutPadding(). * Fix Base64 decode mock to propagate exceptions The mock now properly handles the URL_SAFE flag and propagates exceptions on invalid input instead of silently returning an empty ByteArray. This matches Android's actual Base64 behavior where IllegalArgumentException is thrown on invalid input. * Extract helper functions to reduce code duplication Add createSip002Url() and createLegacyUrl() helper functions to centralize URL construction logic. Add SS_SCHEME constant to avoid magic strings. This improves maintainability by reducing repeated Base64 encoding and URL construction patterns. * Add URI format verification before extracting base64 Verify that toUri() returns a URI string without the scheme prefix before extracting the base64 content. This ensures the test correctly validates the URI format and prevents incorrect data extraction if the implementation changes. * Add scheme verification in round-trip test Explicitly verify that toUri() returns a URI string without the scheme prefix before prepending it. This documents the expected behavior and ensures the test fails gracefully if the implementation changes. * mockito-inline version 6.1.0 does not exist - The latest available version is 5.2.0 (released March 2023) - The mockito-inline artifact was effectively deprecated after 5.2.0; mocking final classes is now built into mockito-core since Mockito 5.x
v2rayNG
A V2Ray client for Android, support Xray core and v2fly core
Telegram Channel
Usage
Geoip and Geosite
- geoip.dat and geosite.dat files are in
Android/data/com.v2ray.ang/files/assets(path may differ on some Android device) - download feature will get enhanced version in this repo (Note it need a working proxy)
- latest official domain list and ip list can be imported manually
- possible to use third party dat file in the same folder, like h2y
More in our wiki
Development guide
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.
The aar can be compiled from the Golang project AndroidLibV2rayLite or AndroidLibXrayLite.
For a quick start, read guide for Go Mobile and Makefiles for Go Developers
v2rayNG can run on Android Emulators. For WSA, VPN permission need to be granted via
appops set [package name] ACTIVATE_VPN allow