Skip to content

Commit 90a9849

Browse files
authored
Update dev-client-winrt.rst (#19)
Saving progress and still working through functionality. I'll need to have public testers of this tutorial to iron out kinks.
1 parent a3e5451 commit 90a9849

File tree

1 file changed

+126
-115
lines changed

1 file changed

+126
-115
lines changed
Lines changed: 126 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -1,193 +1,204 @@
1-
Setting Up a Development Game Client (Windows 8.1+)
2-
=======================================================
3-
4-
Requirements
5-
------------
1+
.. _dev-client-winrt:
62

7-
* Visual Studio or Visual Studio Build Tools installed on your system
8-
* `Microsoft Visual C++ Runtime Package 12.0 for x86 <https://github.com/M1k3G0/Win10_LTSC_VP9_Installer/blob/master/Microsoft.VCLibs.120.00_12.0.21005.1_x86__8wekyb3d8bbwe.appx>`_
9-
* A copy of the Brave Frontier package (APPX) for Windows (`Share Drive link <https://drive.google.com/file/d/1NB64gzQOe-QQx9fY0mkoZiCSfe3WlTYi/view?usp=sharing>`_)
10-
* Developer Mode enabled on your system
11-
* Development game server setup and running (see `Setting Up a Development Game Server <dev-server.html>`_)
3+
.. role:: raw-html(raw)
4+
:format: html
125

13-
.. warning::
14-
15-
If Developer Mode is not installed or enabled in Windows, the proxy will not function, and you will not see the command prompt.
6+
Setting Up a Development Game Client (Windows 8.1+)
7+
====================================================
168

17-
Cloning the Repository
18-
----------------------
9+
.. contents::
10+
:local:
1911

20-
To clone the offline-proxy repository, run the following command:
12+
Introduction
13+
-------------
2114

22-
::
15+
This tutorial guides you through setting up a development game client for Brave Frontier on Windows 8.1 and later, enabling offline play via a local proxy server. It assumes you have Visual Studio 2022 installed with the Desktop development with C++ workload and the Windows 10 SDK. The process involves cloning the repository, building the proxy, generating certificates, modifying the game client, and enabling loopback for local testing.
2316

24-
git clone --depth=1 https://github.com/decompfrontier/offline-proxy
17+
.. note::
18+
If you are brand new to development, follow the exact folder structure shown in this tutorial (e.g., creating a folder named BF under your user profile directory). This will make storage and following along easier. You are free to use any folder structure you are comfortable with, but adjust paths in commands accordingly.
2519

26-
Building the Proxy
27-
------------------
20+
Requirements
21+
-------------
2822

2923
.. warning::
24+
If Developer Mode is not installed or enabled in Windows, the proxy will not function, and you will not see the command prompt.
3025

31-
The client *only* supports 32-bit platforms. Ensure you use the MINGW32 (i686-w64-mingw32) toolchain.
26+
- Windows 8.1 or later
27+
- Visual Studio 2022 with Desktop development with C++ workload and Windows 10 SDK
28+
- Microsoft Visual C++ Runtime Package 12.0 for x86 (from https://github.com/M1k3G0/Win10_LTSC_VP9_Installer/blob/master/Microsoft.VCLibs.120.00_12.0.21005.1_x86__8wekyb3d8bbwe.appx)
29+
- Git for Windows
30+
- Administrator privileges
3231

33-
Using CMake, configure the proxy with one of the following options:
32+
Cloning the Repository
33+
-----------------------
3434

35-
* For Visual Studio as your compiler: ``cmake --preset debug-vs``
36-
* For MSYS/MinGW as your compiler: ``cmake --preset debug-mingw``
35+
To clone the offline-proxy repository, open PowerShell and run the following command:
3736

38-
After compilation, navigate to your CMake build directory. Inside the ``bin`` folder, you should find a ``libcurl.dll`` file. Keep track of this file, as it will be required later in the tutorial.
37+
.. code-block:: console
3938
40-
Generating UWP Development Certificates
41-
---------------------------------------
42-
43-
.. warning::
39+
cd $env:USERPROFILE\BF
40+
git clone --depth=1 https://github.com/decompfrontier/offline-proxy
41+
cd $env:USERPROFILE\BF\offline-proxy
4442
45-
It is recommended to remove these certificates when they are no longer needed to prevent them from compromising system trust.
43+
.. note::
44+
The `$env:USERPROFILE` variable automatically points to your user directory (e.g., `C:\Users\YourUsername`). Adjust the path if you use a different structure.
4645

47-
.. important::
46+
Building the Proxy
47+
-------------------
4848

49-
All commands in this section must be executed in PowerShell. Ensure you are using PowerShell, or the system will not recognize the required applications.
49+
.. warning::
50+
The client only supports 32-bit platforms. Ensure the build targets Win32.
5051

51-
.. note::
52+
First, configure the project to generate the necessary solution file (`.sln`):
5253

53-
If you have previously generated a PFX certificate for deploying applications to the Windows Store or have already completed this section, skip ahead to the "Modifying Brave Frontier APPX" section.
54+
.. code-block:: console
5455
55-
.. hint::
56+
cmake --preset debug-vs
5657
57-
This section provides a simplified process adapted from `this MSDN page <https://learn.microsoft.com/en-us/windows/msix/package/create-certificate-package-signing>`_.
58+
This command uses the Visual Studio preset to set up the project for a Debug build, creating the `.sln` file. If you encounter issues (e.g., "CMakePresets.json not found"), ensure your Visual Studio environment is correctly installed, or proceed manually with `cmake -G "Visual Studio 17 2022" -A Win32`.
5859

59-
To install custom Windows Store apps, you must first generate a development certificate. Run the following command in PowerShell to create a certificate:
60+
Build the proxy using the following steps:
6061

61-
::
62+
.. code-block:: console
6263
63-
New-SelfSignedCertificate -Type Custom -Subject "CN=<Name>" -KeyUsage DigitalSignature -FriendlyName "Your friendly name goes here" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")
64+
cmake --build . --config Debug
6465
65-
.. note::
66+
If the build fails, open ``offline-proxy.sln`` in Visual Studio 2022, set the solution platform to Win32 and configuration to Debug, then build (F7 or, with an "Fn Lock" keyboard, ``Fn`` + ``F7``). After a successful build, locate ``libcurl.dll`` in ``$env:USERPROFILE\BF\offline-proxy\bin\libcurl.dll`` (or search the bin folder).
6667

67-
Replace ``<Name>`` with a name of your choice (e.g., "My BraveFrontier"). Write down this name, as it will be needed later.
68+
Generating UWP Development Certificates
69+
----------------------------------------
6870

69-
Take note of the certificate's **Thumbprint**, as it will be used to export the certificate. Then, run the following commands to export it:
71+
Generate a development certificate to sign the modified client:
7072

71-
::
73+
.. code-block:: powershell
7274
73-
$password = ConvertTo-SecureString -String "<Your Password>" -Force -AsPlainText
74-
Export-PfxCertificate -cert "Cert:\CurrentUser\My\<Certificate Thumbprint>" -FilePath MyKey.pfx -Password $password
75+
$certName = "MyBraveFrontier"
76+
$friendlyName = "Brave Frontier Dev Cert"
77+
New-SelfSignedCertificate -Type Custom -Subject "CN=$certName" -KeyUsage DigitalSignature -FriendlyName "$friendlyName" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")
7578
7679
.. note::
80+
The output will show a Thumbprint (e.g., ``ABC123...``). Highlight the first line of the output (starting with "Thumbprint") with your mouse, right-click to copy, then paste it into the next command using right-click paste. Use arrow keys (up/down/left/right) to navigate and edit the ``$thumbprint`` variable. This is a basic CLI skill: right-click pastes copied text, and arrow keys move the cursor without needing the mouse.
7781

78-
- Replace ``<Your Password>`` with a strong password of your choosing.
79-
80-
- Replace ``<Certificate Thumbprint>`` with the Thumbprint from the previous step.
82+
Export the certificate:
8183

82-
You should now have a ``MyKey.pfx`` file. Keep this file safe, as it will be used to sign the modified Brave Frontier client.
84+
.. code-block:: powershell
8385
84-
Installing the Certificate
85-
~~~~~~~~~~~~~~~~~~~~~~~~~~
86+
$thumbprint = "ABC123..." # Paste and edit your Thumbprint here using right-click paste and arrow keys
87+
$password = ConvertTo-SecureString -String "YourStrongPassword" -Force -AsPlainText # Change password
88+
Export-PfxCertificate -cert "Cert:\CurrentUser\My\$thumbprint" -FilePath $env:USERPROFILE\BF\MyKey.pfx -Password $password
8689
87-
1. Open the ``MyKey.pfx`` file to launch the Certificate Import Wizard.
88-
2. Select ``Local Machine`` and proceed.
89-
3. When prompted for the certificate store, choose ``Place all certificates in the following store``.
90-
4. Browse and select ``Trusted Root Certification Authorities``.
91-
5. Click ``Finish``, then confirm with ``Yes`` when prompted.
90+
Install the certificate:
9291

93-
.. image::
94-
../../images/dev-client-winrt/certpath_win.png
92+
#. Double-click ``$env:USERPROFILE\BF\MyKey.pfx`` to launch the Certificate Import Wizard.
93+
#. Select ``Local Machine`` and proceed.
94+
#. Choose ``Trusted Root Certification Authorities`` as the store.
95+
#. Click ``Finish``, then confirm with ``Yes``.
9596

96-
Modifying Brave Frontier APPX
97-
-----------------------------
97+
.. warning::
98+
Remove these certificates when you are done with Brave Frontier development to prevent compromising system trust. Removing the certificate after installing the patched BraveFrontier APPX is a safety step and will prevent launching the patched APPX if it relies on ongoing verification.
9899

99100
.. important::
101+
All commands must be executed in PowerShell with administrator privileges.
100102

101-
All commands in this section must be executed in a Developer Command Prompt for Visual Studio. Ensure you use this environment, or the required tools will not be recognized.
102-
103-
To unpack the game client, run the following command:
103+
Obtaining the APPX File
104+
------------------------
104105

105-
::
106+
Download the unmodified Brave Frontier APPX file from the provided link:
106107

107-
makeappx unpack /p gumi.BraveFrontier_2.19.6.0_x86__tdae4wqex79w6.appx /d BraveFrontierAppxClient
108+
- URL: https://drive.google.com/file/d/1NB64gzQOe-QQx9fY0mkoZiCSfe3WlTYi/view?usp=sharing
109+
- Save as: ``$env:USERPROFILE\BF\BraveFrontier_2.19.6.0_x86.appx`` (right-click link > Save As).
108110

109-
A new folder named ``BraveFrontierAppxClient`` will be created, containing the extracted game client files for modification.
110-
111-
1. Copy the ``libcurl.dll`` file from the "`Building the Proxy <https://github.com/decompfrontier/offline-proxy>`_" section and place it in the root of the ``BraveFrontierAppxClient`` directory. When prompted to replace the original file, select ``Yes``.
112-
2. Delete the following files from the ``BraveFrontierAppxClient`` directory:
111+
.. note::
112+
Verify the file size (~100MB) to ensure integrity. This file is not publicly hosted elsewhere; direct downloads are rare and often risky (e.g., APKs from APKPure/BlueStacks). If issues arise, extract from an installed app: ``Get-AppxPackage *BraveFrontier* | Export-AppxPackage -Path $env:USERPROFILE\BF\BraveFrontier.appx``.
113113

114-
- ``AppxMetadata``
114+
Modifying Brave Frontier APPX
115+
------------------------------
115116

116-
- ``AppxSignature.p7x``
117+
Unpack and modify the APPX file using Developer PowerShell for Visual Studio 2022:
117118

118-
- ``AppxBlockMap.xml``
119+
.. code-block:: console
119120
120-
- ``ApplicationInsights.config``
121+
makeappx unpack /p $env:USERPROFILE\BF\BraveFrontier_2.19.6.0_x86.appx /d $env:USERPROFILE\BF\BraveFrontierAppxClient
121122
122-
3. Open ``AppxManifest.xml`` in a text editor (e.g., Notepad++) and locate this line:
123+
.. note::
124+
Launch "Developer PowerShell for Visual Studio 2022" from the Start menu to ensure SDK access.
123125

124-
::
126+
Copy the proxy library:
125127

126-
<Identity Name="gumi.BraveFrontier" Publisher="CN=5AA816A3-ED94-4AA2-A2B4-3ADDA1FABFB6" Version="2.19.6.0" ProcessorArchitecture="x86" />
128+
.. code-block:: console
127129
128-
Replace ``CN=5AA816A3-ED94-4AA2-A2B4-3ADDA1FABFB6`` with ``CN=<Name>``, where ``<Name>`` matches the name used during certificate generation (e.g., "My BraveFrontier"). This ensures the application installs correctly.
130+
Copy-Item $env:USERPROFILE\BF\offline-proxy\bin\libcurl.dll $env:USERPROFILE\BF\BraveFrontierAppxClient -Force
129131
130-
4. (Optional) Modify the ``Properties`` tag to customize the app’s display details, such as:
132+
Delete unnecessary files:
131133

132-
::
134+
.. code-block:: console
133135
134-
<Properties>
135-
<DisplayName>Brave Frontier</DisplayName>
136-
<PublisherDisplayName>株式会社gumi</PublisherDisplayName>
137-
<Logo>Assets\StoreLogo.png</Logo>
138-
</Properties>
136+
Remove-Item $env:USERPROFILE\BF\BraveFrontierAppxClient\AppxMetadata -Recurse -Force
137+
Remove-Item $env:USERPROFILE\BF\BraveFrontierAppxClient\AppxSignature.p7x, $env:USERPROFILE\BF\BraveFrontierAppxClient\AppxBlockMap.xml, $env:USERPROFILE\BF\BraveFrontierAppxClient\ApplicationInsights.config -Force
139138
140-
5. (Optional) To change the app’s name in the Windows Start menu, edit this tag:
139+
Edit the manifest:
141140

142-
::
141+
#. Open ``$env:USERPROFILE\BF\BraveFrontierAppxClient\AppxManifest.xml`` in Notepad++.
142+
#. Locate the line: ``<Identity Name="gumi.BraveFrontier" Publisher="CN=5AA816A3-ED94-4AA2-A2B4-3ADDA1FABFB6" ... />``.
143+
#. Replace the Publisher CN with ``CN=MyBraveFrontier``.
144+
#. (Optional) Update ``DisplayName`` to "Brave Frontier Offline" under ``<Properties>``.
145+
#. Save and close.
143146

144-
<m2:VisualElements DisplayName="Brave Frontier"
147+
.. important::
148+
All commands must be executed in Developer PowerShell for Visual Studio 2022.
145149

146-
6. Save and close the file.
150+
Packing and Signing the Modified Client
151+
-----------------------------------------
147152

148-
Next, pack and sign the modified client with these commands:
153+
Pack and sign the modified APPX in Developer PowerShell for Visual Studio 2022:
149154

150-
::
155+
.. code-block:: console
151156
152-
makeappx pack /d BraveFrontierAppxClient /p BraveFrontierPatched.appx
153-
SignTool sign /a /v /fd SHA256 /f MyKey.pfx /p "<Your Password>" BraveFrontierPatched.appx
157+
makeappx pack /d $env:USERPROFILE\BF\BraveFrontierAppxClient /p $env:USERPROFILE\BF\BraveFrontierPatched.appx
158+
SignTool sign /a /v /fd SHA256 /f $env:USERPROFILE\BF\MyKey.pfx /p "YourStrongPassword" $env:USERPROFILE\BF\BraveFrontierPatched.appx
154159
155160
.. note::
156-
157-
Replace ``<Your Password>`` with the password used when exporting the certificate.
161+
Ensure the password matches the one used during certificate export.
158162

159163
Running the Game
160-
----------------
164+
-----------------
161165

162-
Install the newly generated ``BraveFrontierPatched.appx`` file and launch the client. If all steps were followed correctly, a console window should appear alongside the game client, as shown below:
166+
Install the patched client:
163167

164-
.. image::
165-
../../images/dev-client-winrt/bf_appx_patched.png
168+
.. code-block:: powershell
166169
167-
.. warning::
170+
Add-AppxPackage $env:USERPROFILE\BF\BraveFrontierPatched.appx
168171
169-
If no console appears, check the following:
170-
171-
- Ensure the patched ``libcurl.dll`` was correctly installed.
172+
Enable loopback for local server communication:
172173

173-
- Verify you did not use the ``deploy`` preset, as it is not supported in this build.
174+
#. Download the Enable Loopback Utility: https://telerik-fiddler.s3.amazonaws.com/fiddler/addons/enableloopbackutility.exe
175+
#. Run the utility and select "Brave Frontier".
176+
#. Check "Enable loopback" and click "Save Changes".
177+
#. If an error occurs, enable Device Portal in Settings > Update & Security > For developers and disable "Restrict to loopback connections only".
174178

175-
- Confirm Developer Mode is enabled on your Windows PC.
179+
.. image:: ../../images/dev-client-winrt/loopback_win.png
180+
:alt: Loopback Utility Configuration
176181

177-
Connecting to the Server
178-
~~~~~~~~~~~~~~~~~~~~~~~~
182+
Launch the game by searching "Brave Frontier" in the Start menu. A console window should appear alongside the client.
179183

180-
Due to a default limitation in UWP apps, they cannot communicate with localhost, preventing the game from connecting to the server. To resolve this:
184+
.. image:: ../../images/dev-client-winrt/bf_appx_patched.png
185+
:alt: Running the Patched Game Client
181186

182-
1. Download the `Enable Loopback Utility <https://telerik-fiddler.s3.amazonaws.com/fiddler/addons/enableloopbackutility.exe>`_.
183-
2. Run the utility and select the Brave Frontier application.
184-
3. Configure it as shown below, then click ``Save Changes`` and restart the game:
187+
.. warning::
188+
If no console appears, verify the following:
189+
190+
- The patched ``libcurl.dll`` was correctly installed.
191+
- Developer Mode is enabled on your Windows PC.
185192

186-
.. note::
193+
Connecting to the Server
194+
--------------------------
187195

188-
If Loopback Utility reports an error while saving changes, ensure Device Portal is enabled, and the ``Restrict to loopback connections only`` option is disabled under Developer settings.
196+
Run the standalone server (e.g., ``standalone_frontend.exe`` from prior server automation) on ``127.0.0.1:9960``. With the loopback utility configured, the game should connect to the local server and display the login screen.
189197

190-
.. image::
191-
../../images/dev-client-winrt/loopback_win.png
198+
Troubleshooting
199+
----------------
192200

193-
If the game server is running, you should now see the Brave Frontier login screen upon launching the game.
201+
- **Build Fails**: Ensure Visual Studio 2022 C++ workload is installed. Rebuild in VS if needed.
202+
- **Unpack Error**: Verify the APPX path and Developer PowerShell for Visual Studio 2022 usage.
203+
- **Signing Error**: Check certificate installation and password.
204+
- **No Console**: Confirm DLL replacement and Developer Mode.

0 commit comments

Comments
 (0)