Skip to content

Commit

Permalink
Android V2RayVpnService Impl
Browse files Browse the repository at this point in the history
  • Loading branch information
AigioL committed Feb 25, 2022
1 parent 83b6d9d commit 35adebc
Show file tree
Hide file tree
Showing 37 changed files with 1,815 additions and 163 deletions.
6 changes: 5 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,11 @@
<!--<PackageVersion Include="LeakCanaryBinding" Version="1.5.1.1" />-->
<!--<PackageVersion Include="TencentOpenApiSDK.Android" Version="3.5.4.11" />-->
<PackageVersion Include="XAB.FlexboxLayout" Version="3.0.0" />


<!-- V2Ray -->
<PackageVersion Include="XAB.AndroidLibV2rayLite" Version="1.0.0" />
<PackageVersion Include="Karamunting.KotlinX.Coroutines.Core" Version="1.4.2" />

<!-- Xamarin.AndroidX -->
<PackageVersion Include="Xamarin.AndroidX.Migration" Version="1.0.8" />
<PackageVersion Include="Xamarin.AndroidX.AppCompat" Version="1.3.1.5" />
Expand Down
38 changes: 36 additions & 2 deletions SteamToolsV2+.sln
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ST.Client.UnitTest.Resource
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Diagnostics", "src\Avalonia.Diagnostics\Avalonia.Diagnostics.csproj", "{E84FF7BC-FC2A-424E-8780-7DA9B487E23F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Avalonia.Skia.Internals", "src\Avalonia.Skia.Internals\Avalonia.Skia.Internals.csproj", "{47C151DA-D2B1-43F4-A04E-B454E2134852}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Skia.Internals", "src\Avalonia.Skia.Internals\Avalonia.Skia.Internals.csproj", "{47C151DA-D2B1-43F4-A04E-B454E2134852}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Bindings", "Bindings", "{80EBD601-28AC-4840-B9B8-E6064816A443}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ST.Client.Android.V2Ray", "src\ST.Client.Android.V2Ray\ST.Client.Android.V2Ray.csproj", "{4A79264D-5BF5-4F89-8066-44E154BF557F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -1824,6 +1828,34 @@ Global
{47C151DA-D2B1-43F4-A04E-B454E2134852}.Release|x64.Build.0 = Release|Any CPU
{47C151DA-D2B1-43F4-A04E-B454E2134852}.Release|x86.ActiveCfg = Release|Any CPU
{47C151DA-D2B1-43F4-A04E-B454E2134852}.Release|x86.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|ARM.ActiveCfg = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|ARM.Build.0 = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|ARM64.Build.0 = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|iPhone.Build.0 = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|x64.ActiveCfg = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|x64.Build.0 = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|x86.ActiveCfg = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Debug|x86.Build.0 = Debug|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|Any CPU.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|ARM.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|ARM.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|ARM64.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|ARM64.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|iPhone.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|iPhone.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|x64.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|x64.Build.0 = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|x86.ActiveCfg = Release|Any CPU
{4A79264D-5BF5-4F89-8066-44E154BF557F}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -1888,9 +1920,11 @@ Global
{FB2CA9B4-71F1-48E8-B9AE-FF4375F4FE43} = {CC46B486-00D7-49E6-ABA3-FDF8F4868D2B}
{E84FF7BC-FC2A-424E-8780-7DA9B487E23F} = {910D6A0F-42AB-4B65-B532-852E864EC006}
{47C151DA-D2B1-43F4-A04E-B454E2134852} = {910D6A0F-42AB-4B65-B532-852E864EC006}
{80EBD601-28AC-4840-B9B8-E6064816A443} = {327FDEE7-C4C8-4AA4-A7B0-8BCE3D75346F}
{4A79264D-5BF5-4F89-8066-44E154BF557F} = {80EBD601-28AC-4840-B9B8-E6064816A443}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
RESX_NeutralResourcesLanguage = zh-Hans
SolutionGuid = {9313F2B4-10DA-43AA-A481-CAA7571C740C}
RESX_NeutralResourcesLanguage = zh-Hans
EndGlobalSection
EndGlobal
Binary file not shown.
43 changes: 43 additions & 0 deletions src/ST.Client.Android.V2Ray/ST.Client.Android.V2Ray.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<Project Sdk="MSBuild.Sdk.Extras">

<PropertyGroup>
<TargetFramework>MonoAndroid11.0</TargetFramework>
<IsBindingProject>true</IsBindingProject>
<!--<GeneratePackageOnBuild>true</GeneratePackageOnBuild>-->
<PackageLicenseExpression>GPL-3.0-only</PackageLicenseExpression>
<Version>1.0.0</Version>
<RepositoryType>git</RepositoryType>
<PackageProjectUrl>https://github.com/AigioL/xamarin-bindings</PackageProjectUrl>
<RepositoryUrl>https://github.com/AigioL/xamarin-bindings.git</RepositoryUrl>
<PackageTags>v2rayNG V2Ray Xamarin Plugin Binding Xamarin.Android</PackageTags>
<Product>v2rayNG</Product>
<Company />
<PackageId>XAB.v2rayNG</PackageId>
<Title>Xamarin Android Binding Library - v2rayNG</Title>
<Authors>https://github.com/AigioL</Authors>
<Description>
v2rayNG Binding for Xamarin Android. https://github.com/2dust/v2rayNG

Commonly Used Types:
com.v2ray.ang.service.V2RayVpnService -&gt; V2RayNG.V2RayVpnService
</Description>
<!--<GenerateDocumentationFile>true</GenerateDocumentationFile>-->
<!--<AllowUnsafeBlocks>true</AllowUnsafeBlocks>-->
<!--<PublishRepositoryUrl>true</PublishRepositoryUrl>-->
<!--<EmbedUntrackedSources>true</EmbedUntrackedSources>-->
<!--<IncludeSymbols>true</IncludeSymbols>-->
<!--<SymbolPackageFormat>snupkg</SymbolPackageFormat>-->
</PropertyGroup>

<ItemGroup>
<LibraryProjectZip Include="Jars\*.aar" />
<TransformFile Include="Transforms\*.xml" />
<None Remove="Transforms\*.xml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="XAB.AndroidLibV2rayLite" />
<PackageReference Include="Karamunting.KotlinX.Coroutines.Core" />
<!--<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />-->
</ItemGroup>
</Project>
14 changes: 14 additions & 0 deletions src/ST.Client.Android.V2Ray/Transforms/Metadata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<metadata>
<!--
This sample removes the class: android.support.v4.content.AsyncTaskLoader.LoadTask:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='AsyncTaskLoader.LoadTask']" />
This sample removes the method: android.support.v4.content.CursorLoader.loadInBackground:
<remove-node path="/api/package[@name='android.support.v4.content']/class[@name='CursorLoader']/method[@name='loadInBackground']" />
-->
<remove-node path="/api/package[@name='net.steampp.app.v2ray.util']" />
<remove-node path="/api/package[@name='net.steampp.app.v2ray']" />
<remove-node path="/api/package[@name='net.steampp.app.v2ray.service.ServiceControl']" />
<attr path="/api/package[@name='net.steampp.app.v2ray.service']"
name="managedName">V2RayNG</attr>
</metadata>
101 changes: 101 additions & 0 deletions src/ST.Client.Android/Properties/SR.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions src/ST.Client.Android/Properties/SR.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="v2rayPoint_configure" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\v2rayPoint.configure.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value>
</data>
</root>
Loading

0 comments on commit 35adebc

Please sign in to comment.