diff --git a/VRCExternalTools.sln b/VRCExternalTools.sln
new file mode 100644
index 0000000..96ee09d
--- /dev/null
+++ b/VRCExternalTools.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.29926.136
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRCExternalTools", "VRCExternalTools\VRCExternalTools.csproj", "{12F51A26-2AE2-4798-9087-516F7BC3B788}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {12F51A26-2AE2-4798-9087-516F7BC3B788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {12F51A26-2AE2-4798-9087-516F7BC3B788}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {12F51A26-2AE2-4798-9087-516F7BC3B788}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {12F51A26-2AE2-4798-9087-516F7BC3B788}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {8C051168-3506-465E-A54B-B3E613B01B97}
+ EndGlobalSection
+EndGlobal
diff --git a/VRCExternalTools/App.config b/VRCExternalTools/App.config
new file mode 100644
index 0000000..550a390
--- /dev/null
+++ b/VRCExternalTools/App.config
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/VRCExternalTools/App.xaml b/VRCExternalTools/App.xaml
new file mode 100644
index 0000000..4929cd9
--- /dev/null
+++ b/VRCExternalTools/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/VRCExternalTools/App.xaml.cs b/VRCExternalTools/App.xaml.cs
new file mode 100644
index 0000000..3a0c1dc
--- /dev/null
+++ b/VRCExternalTools/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace VRCExternalTools
+{
+ ///
+ /// App.xaml の相互作用ロジック
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/VRCExternalTools/Friend.cs b/VRCExternalTools/Friend.cs
new file mode 100644
index 0000000..79265a5
--- /dev/null
+++ b/VRCExternalTools/Friend.cs
@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace VRCExternalTools
+{
+ class Friend
+ {
+ public String id { get; set; }
+
+ public Friend(String userId)
+ {
+ id = userId;
+ }
+ }
+}
+
diff --git a/VRCExternalTools/MainWindow.xaml b/VRCExternalTools/MainWindow.xaml
new file mode 100644
index 0000000..d19ec9a
--- /dev/null
+++ b/VRCExternalTools/MainWindow.xaml
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/VRCExternalTools/MainWindow.xaml.cs b/VRCExternalTools/MainWindow.xaml.cs
new file mode 100644
index 0000000..95fdc82
--- /dev/null
+++ b/VRCExternalTools/MainWindow.xaml.cs
@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using VRCExternalTools.VRCAPI;
+
+namespace VRCExternalTools
+{
+ ///
+ /// MainWindow.xaml の相互作用ロジック
+ ///
+ public partial class MainWindow : Window
+ {
+
+ ObservableCollection friendsCollection = new ObservableCollection();
+ ObservableCollection avatarsCollection = new ObservableCollection();
+ private VRCAPI.VRCAPI api;
+ public MainWindow()
+ {
+ InitializeComponent();
+ friends.ItemsSource = friendsCollection;
+ avatars.ItemsSource = avatarsCollection;
+ BindingOperations.EnableCollectionSynchronization(this.friendsCollection, new object());
+ BindingOperations.EnableCollectionSynchronization(this.avatarsCollection, new object());
+ }
+
+ private void loginButton_Click(object sender, RoutedEventArgs e)
+ {
+ var authenticator = new VRCAuthenticator(userName.Text, password.Password);
+ api = authenticator.loginAsync().Result;
+
+ if (api != null && !authenticator.isTwoAuthentication())
+ {
+ loginButton.IsEnabled = false;
+ } else if (api != null && authenticator.isTwoAuthentication())
+ {
+ var result = authenticator.verifyTwoFactor(int.Parse(oneTimePassword.Text));
+ if (result)
+ {
+ loginButton.IsEnabled = false;
+ var userConfig = api.getUserConfig();
+ Name.Content = userConfig.username;
+
+ var avatars = api.searchAvatars(user: "me", releaseStatus: "all");
+ foreach (var avatar in avatars)
+ {
+ avatarsCollection.Add(avatar);
+ }
+ }
+ else
+ {
+ MessageBox.Show("2FA Failed.");
+ }
+ }
+ else if (api == null)
+ {
+ MessageBox.Show("Invalid Username or Password");
+ }
+ }
+
+ private void reloadFriends_Click(object sender, RoutedEventArgs e)
+ {
+ if (api != null)
+ {
+ var friends = api.getFriends(500,true,0);
+ friendsCollection.Clear();
+ foreach (var friend in friends)
+ {
+ friendsCollection.Add(friend);
+ }
+ }
+ }
+ }
+}
diff --git a/VRCExternalTools/Properties/AssemblyInfo.cs b/VRCExternalTools/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..4076195
--- /dev/null
+++ b/VRCExternalTools/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// アセンブリに関する一般情報は以下の属性セットをとおして制御されます。
+// アセンブリに関連付けられている情報を変更するには、
+// これらの属性値を変更してください。
+[assembly: AssemblyTitle("VRCExternalTools")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("VRCExternalTools")]
+[assembly: AssemblyCopyright("Copyright © 2020")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// ComVisible を false に設定すると、このアセンブリ内の型は COM コンポーネントから
+// 参照できなくなります。COM からこのアセンブリ内の型にアクセスする必要がある場合は、
+// その型の ComVisible 属性を true に設定してください。
+[assembly: ComVisible(false)]
+
+//ローカライズ可能なアプリケーションのビルドを開始するには、
+//.csproj ファイルの CultureYouAreCodingWith を
+// 内部で設定します。たとえば、
+//ソース ファイルで英語を使用している場合、 を en-US に設定します。次に、
+//下の NeutralResourceLanguage 属性のコメントを解除します。下の行の "en-US" を
+//プロジェクト ファイルの UICulture 設定と一致するよう更新します。
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //テーマ固有のリソース ディクショナリが置かれている場所
+ //(リソースがページ、
+ // またはアプリケーション リソース ディクショナリに見つからない場合に使用されます)
+ ResourceDictionaryLocation.SourceAssembly //汎用リソース ディクショナリが置かれている場所
+ //(リソースがページ、
+ //アプリケーション、またはいずれのテーマ固有のリソース ディクショナリにも見つからない場合に使用されます)
+)]
+
+
+// アセンブリのバージョン情報は次の 4 つの値で構成されています:
+//
+// メジャー バージョン
+// マイナー バージョン
+// ビルド番号
+// リビジョン
+//
+// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
+// 既定値にすることができます:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/VRCExternalTools/Properties/Resources.Designer.cs b/VRCExternalTools/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..be30ca3
--- /dev/null
+++ b/VRCExternalTools/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// このコードはツールによって生成されました。
+// ランタイム バージョン:4.0.30319.42000
+//
+// このファイルへの変更は、正しくない動作の原因になったり、
+// コードが再生成されるときに失われたりします。
+//
+//------------------------------------------------------------------------------
+
+namespace VRCExternalTools.Properties
+{
+
+
+ ///
+ /// ローカライズされた文字列などを検索するための、厳密に型指定されたリソース クラスです。
+ ///
+ // このクラスは StronglyTypedResourceBuilder クラスによって ResGen
+ // または Visual Studio のようなツールを使用して自動生成されました。
+ // メンバーを追加または削除するには、.ResX ファイルを編集して、/str オプションと共に
+ // ResGen を実行し直すか、または VS プロジェクトをリビルドします。
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// このクラスで使用されるキャッシュされた ResourceManager インスタンスを返します。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("VRCExternalTools.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// すべてについて、現在のスレッドの CurrentUICulture プロパティをオーバーライドします
+ /// 現在のスレッドの CurrentUICulture プロパティをオーバーライドします。
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/VRCExternalTools/Properties/Resources.resx b/VRCExternalTools/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/VRCExternalTools/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/VRCExternalTools/Properties/Settings.Designer.cs b/VRCExternalTools/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..26b8b93
--- /dev/null
+++ b/VRCExternalTools/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace VRCExternalTools.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/VRCExternalTools/Properties/Settings.settings b/VRCExternalTools/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/VRCExternalTools/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/VRCExternalTools/VRCAPI/VRCAPI.cs b/VRCExternalTools/VRCAPI/VRCAPI.cs
new file mode 100644
index 0000000..321dc56
--- /dev/null
+++ b/VRCExternalTools/VRCAPI/VRCAPI.cs
@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using Newtonsoft.Json;
+using JsonSerializer = System.Text.Json.JsonSerializer;
+
+namespace VRCExternalTools.VRCAPI
+{
+ class VRCAPI
+ {
+ public String apiKey;
+ public String authToken;
+ private HttpClientHandler handler = new HttpClientHandler();
+ public VRCAPI(String key, String token)
+ {
+ apiKey = key;
+ authToken = token;
+ handler.CookieContainer = new CookieContainer();
+ handler.CookieContainer.Add(new Cookie("auth", authToken, "/", "api.vrchat.cloud"));
+ }
+
+ public VRCAPIBase.UserDataReturn getUserConfig()
+ {
+ Uri uri = new Uri(VRCAPIBase.api_base + "/auth/user");
+ using (var client = new HttpClient(handler, false))
+ {
+ var request = new HttpRequestMessage(HttpMethod.Get, uri);
+ var result = client.SendAsync(request).Result.Content.ReadAsStringAsync().Result;
+ return JsonSerializer.Deserialize(result);
+ }
+ }
+
+ public List searchAvatars(String user = null, bool featured = false, String userId = null, int n = -1, int offset = -1, string order = null, string releaseStatus = null, string sort = null, string maxUnityVersion = null, string minUnityVersion = null, string maxAssetVersion = null, string minAssetVersion = null, string platform = null)
+ {
+ string urlParams = "?";
+ if (user != null) { urlParams += "user=" + user + "&"; }
+ urlParams += "featured=" + featured + "&";
+ if (userId != null) { urlParams += "userId=" + userId + "&"; }
+ if (n != -1) { urlParams += "n=" + n + "&"; }
+ if (offset != -1) { urlParams += "offset=" + offset + "&"; }
+ if (order != null) { urlParams += "order=" + order + "&"; }
+ if (releaseStatus != null) { urlParams += "releaseStatus=" + releaseStatus + "&"; }
+ if (sort != null) { urlParams += "sort=" + sort + "&"; }
+ if (maxUnityVersion != null) { urlParams += "maxUnityVersion=" + maxUnityVersion + "&"; }
+ if (minUnityVersion != null) { urlParams += "minUnityVersion=" + minUnityVersion + "&"; }
+ if (maxAssetVersion != null) { urlParams += "maxAssetVersion=" + maxAssetVersion + "&"; }
+ if (minAssetVersion != null) { urlParams += "minAssetVersion=" + minAssetVersion + "&"; }
+ if (platform != null) { urlParams += "platform=" + platform + "&"; }
+
+ urlParams += "apiKey=" + apiKey;
+
+ Uri uri = new Uri(VRCAPIBase.api_base + "/avatars" + urlParams);
+ using (var client = new HttpClient(handler, false))
+ {
+ var request = new HttpRequestMessage(HttpMethod.Get, uri);
+ var result = client.SendAsync(request).Result.Content.ReadAsStringAsync().Result;
+ return JsonConvert.DeserializeObject>(result);
+ }
+ }
+
+ public List getFriends(int n, bool offline, int offset)
+ {
+ using (var client = new HttpClient(handler, false))
+ {
+ Uri uri = new Uri(VRCAPIBase.api_base + "/auth/user/friends?apiKey=" + apiKey + "&offline=" + offline + "&offset=" + Convert.ToString(offset));
+ //request.Content = new StringContent(JsonSerializer.Serialize(new VRCAPIBase.FriendsRequest() { apiKey = apiKey, n = n, offline = offline, offset = offset }), Encoding.UTF8, "application/json");
+ var request = new HttpRequestMessage(HttpMethod.Get, uri);
+ var result = client.SendAsync(request).Result.Content.ReadAsStringAsync().Result;
+ MessageBox.Show(result);
+ return JsonConvert.DeserializeObject>(result);
+ }
+ }
+ }
+}
diff --git a/VRCExternalTools/VRCAPI/VRCAPIBase.cs b/VRCExternalTools/VRCAPI/VRCAPIBase.cs
new file mode 100644
index 0000000..f66a21b
--- /dev/null
+++ b/VRCExternalTools/VRCAPI/VRCAPIBase.cs
@@ -0,0 +1,243 @@
+using System;
+using System.Collections.Generic;
+using System.Dynamic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Runtime.Serialization;
+using System.Security.RightsManagement;
+
+namespace VRCExternalTools.VRCAPI
+{
+ class VRCAPIBase
+ {
+ public static readonly String api_base = "https://api.vrchat.cloud/api/1";
+
+ public class AvatarObject
+ {
+ public String id { get; set; }
+ public String name { get; set; }
+ public String description { get; set; }
+ public String authorId { get; set; }
+ public String authorName { get; set; }
+ }
+
+ public class PastDisplayNameObject
+ {
+ public String displayName { get; set; }
+ public String updated_at { get; set; }
+ }
+
+ public class CurrentUserObject
+ {
+ public String username { get; set; }
+ public String displayName { get; set; }
+ public PastDisplayNameObject[] pastDisplayNames { get; set; }
+ public String id { get; set; }
+ public String bio { get; set; }
+ public String[] bioLinks { get; set; }
+ public String email { get; set; }
+ public bool emailVerified { get; set; }
+ public bool hasEmail { get; set; }
+ public bool hasPendingEmail { get; set; }
+ public String obfuscatedEmail { get; set; }
+ public String obfuscatedPendingEmail { get; set; }
+ public String steamId { get; set; }
+ public String[] steamDetails { get; set; }
+ public String oculusId { get; set; }
+ public int acceptedTOSVersion { get; set; }
+ public bool hasBirthday { get; set; }
+ public String[] friends { get; set; }
+ public String[] onlineFriends { get; set; }
+ public String[] activeFriends { get; set; }
+ public String[] offlineFriends { get; set; }
+ public String[] friendGroupNames { get; set; }
+ public String state { get; set; }
+ public String status { get; set; }
+
+
+ }
+
+ public class WorldUnityPackageObject
+ {
+ public String id { get; set; }
+ public String platform { get; set; }
+ public String assetUrl { get; set; }
+ public String unityVersion { get; set; }
+ public int unitySortNumber { get; set; }
+ public int assetVersion { get; set; }
+ public String created_at { get; set; }
+ public String assetUrlObject { get; set; }
+ public String pluginUrl { get; set; }
+ public String pluginUrlObject { get; set; }
+ }
+
+ public class LimitedWorldObject
+ {
+ public String name { get; set; }
+ public String id { get; set; }
+ public String authorName { get; set; }
+ public int authorId { get; set; }
+ public String[] tags { get; set; }
+ public String created_at { get; set; }
+ public String updated_at { get; set; }
+ public String releaseStatus { get; set; }
+ public int visits { get; set; }
+ public int occupants { get; set; }
+ public int capacity { get; set; }
+ public int favorites { get; set; }
+ public int popularity { get; set; }
+ public String imageUrl { get; set; }
+ public String thumbnailImageUrl { get; set; }
+ public String organization { get; set; }
+ public int heat { get; set; }
+ public String publicationDate { get; set; }
+ public String labsPublicationDate { get; set; }
+ public WorldUnityPackageObject[] unityPackages { get; set; }
+ }
+
+ public class LimitedUserObject
+ {
+ public String username { get; set; }
+ public String displayName { get; set; }
+ public String id { get; set; }
+ public String bio { get; set; }
+ public String statys { get; set; }
+ public String currentAvatarImageUrl { get; set; }
+ public String currentAvatarThumbnailImageUrl { get; set; }
+ public String last_platform { get; set; }
+ public String[] tags { get; set; }
+ public String developerType { get; set; }
+ public bool isFriend { get; set; }
+ //public LimitedWorldObject location { get; set; }
+ }
+
+ public class FriendsRequest
+ {
+ public int offset { get; set; }
+ public int n { get; set; }
+ public bool offline { get; set; }
+ public String apiKey { get; set; }
+ }
+
+ public class TwoFactorRequest
+ {
+ public String apiKey { get; set; }
+ public String code { get; set; }
+ }
+
+ public class TwoFactorAuthReturn
+ {
+ public bool verified { get; set; }
+ }
+
+ public class DisplayNameObject
+ {
+ public String displayName { get; set; }
+ public String updated_at { get; set; }
+ }
+
+ public class UserDataReturn
+ {
+ public String id { get; set; }
+ public String username { get; set; }
+ public String displayName { get; set; }
+ public String userIcon { get; set; }
+ public String bio { get; set; }
+ public String[] bioLinks { get; set; }
+ public DisplayNameObject[] pastDisplayNames { get; set; }
+ public bool hasEmail { get; set; }
+ public bool hasPendingEmail { get; set; }
+ public String email { get; set; }
+ public String obfuscatedEmail { get; set; }
+ public String obfuscatedPendingEmail { get; set; }
+ public bool emailVerified { get; set; }
+ public bool hasBirthday { get; set; }
+ public bool unsubscribe { get; set; }
+ public String[] friends { get; set; }
+ public String[] friendGroupNames { get; set; }
+ public String currentAvatarImageUrl { get; set; }
+ public String currentAvatarThumbnailImageUrl { get; set; }
+ public String fallbackAvatar { get; set; }
+ public String currentAvatar { get; set; }
+ public String currentAvatarAssetUrl { get; set; }
+ public String accountDeletionDate { get; set; }
+ public int acceptedTOSVersion { get; set; }
+ public String steamId { get; set; }
+ public String oculusId { get; set; }
+ public bool hasLoggedInFromClient { get; set; }
+ public String homeLocation { get; set; }
+ public bool twoFactorAuthEnabled { get; set; }
+ public String status { get; set; }
+ public String statusDescription { get; set; }
+ public String state { get; set; }
+ public String[] tags { get; set; }
+ public String developerType { get; set; }
+ public String last_login { get; set; }
+ public String last_platform { get; set; }
+ public bool allowAvatarCopying { get; set; }
+ public bool isFriend { get; set; }
+ public String friendKey { get; set; }
+ public String[] onlineFriends { get; set; }
+ public String[] activeFriends { get; set; }
+ public String[] offlineFriends { get; set; }
+
+ }
+
+
+ public class ConfigDataReturn
+ {
+ public String messageOfTheDay { get; set; }
+ public String timeOutWorldId { get; set; }
+ public String gearDemoRoomId { get; set; }
+ public String releaseServerVersionStandalone { get; set; }
+ public String downloadLinkWindows { get; set; }
+ public String releaseAppVersionStandalone { get; set; }
+ public String devAppVersionStandalone { get; set; }
+ public String devServerVersionStandalone { get; set; }
+ public String devDownloadLinkWindows { get; set; }
+ public int currentTOSVersiona { get; set; }
+ public String releaseSdkUrl { get; set; }
+ public String releaseSdkVersion { get; set; }
+ public String devSdkUrl { get; set; }
+ public String devSdkVersion { get; set; }
+ public String[] whiteListedAssetUrls { get; set; }
+ public String clientApiKey { get; set; }
+ public String viveWindowsUrl { get; set; }
+ public String sdkUnityVersion { get; set; }
+ public String hubWorldId { get; set; }
+ public String homeWorldId { get; set; }
+ public String tutorialWorldId { get; set; }
+ public bool disableEventStream { get; set; }
+ public bool disableAvatarGating { get; set; }
+ public bool disableFeedbackGating { get; set; }
+ public bool disableRegistration { get; set; }
+ public String plugin { get; set; }
+ public String sdkNotAllowedToPublishMessage { get; set; }
+ public String sdkDeveloperFaqUrl { get; set; }
+ public String sdkDiscordUrl { get; set; }
+ public String notAllowedToSelectAvatarInPrivateWorldMessage { get; set; }
+ public int userVerificationTimeout { get; set; }
+ public int userUpdatePeriod { get; set; }
+ public int userVerificationDelay { get; set; }
+ public int userVerificationRetry { get; set; }
+ public int worldUpdatePeriod { get; set; }
+ public int moderationQueryPeriod { get; set; }
+ public String defaultAvatar { get; set; }
+ // public String dynamicWorldRows { get; set; } // Array of DynamicWorldRows WIP
+ public String address { get; set; }
+ public String contactEmail { get; set; }
+ public String supportEmail { get; set; }
+ public String jobsEmail { get; set; }
+ public String copyrightEmail { get; set; }
+ public String moderationEmail { get; set; }
+ public bool disableEmail { get; set; }
+ public String appName { get; set; }
+ public String serverName { get; set; }
+ public String deploymentGroup { get; set; }
+ public String buildVersionTag { get; set; }
+ public String apiKey { get; set; }
+ }
+ }
+}
diff --git a/VRCExternalTools/VRCAPI/VRCAuthenticator.cs b/VRCExternalTools/VRCAPI/VRCAuthenticator.cs
new file mode 100644
index 0000000..4b797c5
--- /dev/null
+++ b/VRCExternalTools/VRCAPI/VRCAuthenticator.cs
@@ -0,0 +1,108 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Threading.Tasks;
+using System.Runtime.Serialization;
+using System.Text.Json;
+using System.Windows;
+
+namespace VRCExternalTools.VRCAPI
+{
+ class VRCAuthenticator
+ {
+ private String userName;
+ private String password;
+ private String apiKey;
+ private String authToken;
+ private bool twoFactor = false;
+
+ public VRCAuthenticator(String name, String pass)
+ {
+ userName = name;
+ password = pass;
+ }
+
+ public async Task getApiKey()
+ {
+ Uri uri = new Uri(VRCAPIBase.api_base + "/config");
+ using (var client = new HttpClient())
+ {
+ VRCAPIBase.ConfigDataReturn config = JsonSerializer.Deserialize(await client.GetAsync(uri).Result.Content.ReadAsStringAsync());
+
+ return config.apiKey;
+ }
+ }
+
+ public string getAuthToken(String name, String pass)
+ {
+ var cookieContainer = new CookieContainer();
+
+ CookieContainer cookies = new CookieContainer();
+ HttpClientHandler handler = new HttpClientHandler();
+ handler.CookieContainer = cookies;
+
+ using (var client = new HttpClient(handler))
+ {
+ var uri = new Uri(VRCAPIBase.api_base + "/auth/user");
+
+ client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes(string.Format("{0}:{1}", name, pass))));
+ client.DefaultRequestHeaders.Add("apiKey", apiKey);
+
+ var response = client.GetAsync(uri).Result.Content.ReadAsStringAsync().Result;
+
+ if (response.Contains("requiresTwoFactorAuth") && response.Contains("otp"))
+ {
+ twoFactor = true;
+ }
+
+ IEnumerable responseCookies = cookies.GetCookies(uri).Cast();
+ foreach (Cookie cookie in responseCookies)
+ {
+ if (cookie.Name == "auth")
+ {
+ return cookie.Value;
+ }
+ }
+ }
+
+ return String.Empty;
+ }
+
+ public async Task loginAsync()
+ {
+ apiKey = await getApiKey();
+ authToken = getAuthToken(userName, password);
+ if (authToken == String.Empty)
+ {
+ return null;
+ }
+ return new VRCAPI(apiKey, authToken);
+ }
+
+ public bool verifyTwoFactor(int pass)
+ {
+ Uri uri = new Uri(VRCAPIBase.api_base + "/auth/twofactorauth/totp/verify");
+ HttpClientHandler handler = new HttpClientHandler();
+ handler.CookieContainer = new CookieContainer();
+ handler.CookieContainer.Add(new Cookie("auth", authToken, "/", "api.vrchat.cloud"));
+ using (var client = new HttpClient(handler))
+ {
+ var request = new HttpRequestMessage(HttpMethod.Post, uri);
+
+ request.Content = new StringContent(JsonSerializer.Serialize(new VRCAPIBase.TwoFactorRequest() { apiKey = apiKey, code = Convert.ToString(pass)}), Encoding.UTF8, "application/json");
+ var result = client.SendAsync(request).Result.Content.ReadAsStringAsync().Result;
+
+ return JsonSerializer.Deserialize < VRCAPIBase.TwoFactorAuthReturn > (result).verified;
+ }
+ }
+
+ public bool isTwoAuthentication()
+ {
+ return twoFactor;
+ }
+ }
+}
diff --git a/VRCExternalTools/VRCExternalTools.csproj b/VRCExternalTools/VRCExternalTools.csproj
new file mode 100644
index 0000000..30ae8e1
--- /dev/null
+++ b/VRCExternalTools/VRCExternalTools.csproj
@@ -0,0 +1,135 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {12F51A26-2AE2-4798-9087-516F7BC3B788}
+ WinExe
+ VRCExternalTools
+ VRCExternalTools
+ v4.7.2
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll
+
+
+ ..\packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll
+
+
+
+ ..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
+
+
+
+ ..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll
+
+
+
+ ..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+
+ ..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+
+ ..\packages\System.Text.Encodings.Web.4.7.1\lib\net461\System.Text.Encodings.Web.dll
+
+
+ ..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll
+
+
+ ..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll
+
+
+ ..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/VRCExternalTools/packages.config b/VRCExternalTools/packages.config
new file mode 100644
index 0000000..2812da4
--- /dev/null
+++ b/VRCExternalTools/packages.config
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file