add sifas docs

This commit is contained in:
Arina Aria 2023-07-24 15:58:05 +07:00
parent b8e1fb20e9
commit 173b6d0db9
2 changed files with 543 additions and 0 deletions

0
build.sh Normal file → Executable file
View file

View file

@ -1 +1,544 @@
# SIFAS
(the following was copied from the fandom wiki)
Love Live! School Idol Festival ALL STARS (ラブライブ!スクールアイドルフェスティバル ALL STARS Rabu raibu! Sukūru Aidoru Fesutibaru ALL STARS) was a rhythm action game developed for mobile platforms, based on the Love Live! and related franchises. It is published by Bushiroad and developed by KLab Inc., and was released on September 26, 2019. It was first announced at Tokyo Game Show 2017 on September 21, 2017. Prior to the announcement, it was first introduced and teased on March 30, 2017 as the PERFECT Dream Project in conjunction with SIF's 4th year anniversary.
Love Live! School Idol Festival ALL STARS was designed with "the greatest, best idol game" as its concept. Characters from μs, Aqours and Nijigasaki High School Idol Club appear within this game.
On April 30, 2023, it was announced that the game's service would be shut down on June 30, 2023.
# Some random forewords
SIFAS, whether you liked it or not, was unjustly killed in favor of a bad "sequel". SIFAS die and bring with it things like fully animated navigator, stories, costume, and of course the main selling point of the game - 3DMV. With SIFAS gone, the only way to officially watch 3DMV is through the Link Live app (doesn't have other groups), or through some metaverse VR stuff that you have to pay for (per concert).
Luckily for us, the community managed to preserve most if not all of the beloved aspects of the game. Thanks to various community members, there are works done and being done so that with a bit of tinkering, you can install and play SIFAS.
# Disclaimers
The information presented by the author(s) of this documentation were either background knowledge, knowledge provided by community members, or knowledge learned from works published by community members.
The author(s) try to make sure that the information presented is correct. However, there might be incorrect info, or outdated info.
The author(s) try to acknowledge and credit the community members who share knowledge, develop tools, host resources, or helped in any other way, but there might be some missing credit. If that were the case, please know that it is not intended by the author(s), and please contact the author(s) for proper credit.
The knowledge, tools, resources used by this documentation are acquired and presented with a good faith basis. While the author(s) try to ask creators for permission to use or feature their works, some works was used or featured without explicit permission. If you have problem with your works being mentioned / features, or your name being credited, please contact the author(s) to sort things out.
# Intents
This documentation go somewhat in depth to the technical side, so for experienced audience, it can serve as a quick introduction to the working of the game and server. If you are not interested in the details, or want to get something running before learning more, please check out the [Easy install](#easy-install) section for a streamlined experience. Do note that the provided packages might not work for you (check [Requirement](#requirement)), however, the details explanation should give you want you need to get things working. Regardless, feel free to reach out to the community, both to help resolve your situation and to help make the documentation better.
This documentation will be about hosting your own SIFAS server, however, there exist a Korean private server that you can play the GL version on. You can find out more about it by asking in the LL Hax server. This documentation will also discuss only the GL (Global) and JP (Japanese) version, although there exist private server for CN (Chinese) version as well.
This documentation assume that you have some background knowledge related to the topic discussed, however, if this is your first time doing something like this, or you just want to learn more, you can also checkout the [Random knowledge](#random-knowledge) section. Various things that are common knowledge, things that are related and interesting (but not totally relevant to the discussion) are discussed.
# Convention
As there are multiple platforms for both client and server, we use the following terms to refer to them:
- Client: The game/app itself. This is what you will use to play the game.
- Server: The program that serve the necessary data for client(s) to function. This was Klab/MYNET/Bushiroad responsibility, but we will have to run our own server now that they have stoped supporting the game. The server often run in another machine, but there are setup that run the client and server on the same machine for android.
- Android/iOS/android/ios: The platform that the client run on. You should know what your platform is.
- Window/Linux/MacOS/Android: The platform that the server will run on.
# Requirements
## Client
Android clients: 64-bit android phone or emulator without root. You can have root for the installation process, but you have to hide/remove it to play the game.
iOS clients: WIP
## Server
Android: Being able to run the client and [Termux](#installing-termux-for-android).
- `arm64` abi is required to run the [prebuilt server](#easy-install).
- `git` and `go` is required to build or use the upgrade script.
PC: Pretty much anything made in the last 10 years or so will work
# Installing the client
## Clients version
We will be using the 3.12 clients (patched):
- If you recall, these are released after the game is dead.
- The only functionality is to show a "SIFAS EoS, thanks for playing SIFAS" message, or so it seems.
- The truth is that, none of the original functionality was deleted, but the crack-proof is removed.
- Which mean that if we patch the starting screen away, we have access to a superior version of the app.
- We will only deal with the patched version here, the only modification you might need to do is to change the server address inside the client.
## Basic clients
These are the clients that come with the [elichika server](https://github.com/YumeMichi/elichika), you can get them from [elichika](https://github.com/YumeMichi/elichika) or directly [here](https://mega.nz/folder/gwJizZjS#v_fSOadf9yrb_eaOze2r7Q).
These clients connect to http://192.168.1.123. This is a local address (LAN), so if you run ``elichika`` the machine that has that address (and the port is opened for LAN access), you won't have to modify the clients at all. It will be explained more on the [easy install section](#easy-install).
## Patching client to a different server address
There are some problems that prevent the basic clients from working or working well:
- You might not have a Wi-Fi network that you can connect to.
- You might not have a separate device (usually a PC / laptop) to run the server on.
- Your Wi-Fi router IP address might not look like 192.168.xxx.xxx, and it's impossible or very complicated to change that.
- You can't obtain the IP 192.168.1.123 because someone or something on your network already have that (it's a nice address).
- You have the IP but you need port 80 (default http) for something else, so you can't run ``elichika`` on that port.
- You are outside touching grass a lot, so you are not connected to Wi-Fi that often.
- The list go on.
In which case, you will need to patch the server address in your client, or a client with different address. There are a few clients provided in the [easy install section](#easy-install), see if you can use one of them, if not then you will have to patch the server address yourself.
### Patching Android client to different server address
This part is written after referencing [honoka-chan](https://github.com/YumeMichi/honoka-chan/blob/master/doc/3.md). It's recommended that you read that for a deeper understanding, however that won't be necessary to follow this documentation.
We work with the basic clients `.apk` here.
#### First step: Unpacking the apk
There are multiple ways to do this, but we will use [apktool](https://apktool.org/).
We can either use the wrapper or .jar directly. Of course, [java](https://www.java.com) will be necessary.
Open up a terminal (command prompt) in the same folder as the `.apk` and run the following:
```
apktool d ALL_STARS_3.12.0_gl_patched.apk
```
for global client, or
```
apktool d ALL_STARS_3.12.0_ja_patched.apk
```
for JP client. Note that if you don't use or don't have the `apktool` wrapper, you can run the `.jar` directly (put in the same directory or you will have to specify to the actual path):
```
java -jar apktool_2.8.1.jar d apkname.apk
```
In any case, after unpacking, you should have a folder that has the same name as the `.apk` except for the extension
#### Second step: Change the address string
We will use the [MetaData String Editor](https://github.com/JeremieCHN/MetaDataStringEditor)
It is written in C#, and the `.exe` you can download need windows to run. If you can build your own from source, or change the metadata in other way, then you can use that too.
This tool is used to edit the metadata file of Unity engine games. In this case, we use it to change the address the client will connect to, but you can also change other strings.
<!-- TODO: Maybe insert some photo. -->
To change the address string, open the tool, then press the top left button and open up the `global-metadata.dat` file. You can find it in:
```
ALL_STARS_3.12.0_gl_patched\assets\bin\Data\Managed\Metadata
```
or
```
ALL_STARS_3.12.0_jp_patched\assets\bin\Data\Managed\Metadata
```
depending on the versions.
You will see many strings. Search for http://192.168.1.123 using the textbox at the top. Double click on the string, click on the popup thing, and you will see another window pop up. You can edit that data to any address you wish to connect to.
If want to use the [elichika](https://github.com/YumeMichi/elichika) server, keep it `http`, you can use `https` if the server do support that.
After editing the address, click the bottom right button to change the address. After that, click the middle button on the top left of the program. Save the metadata as some other file, as you can't overwrite to the current file. After that you can close the tool, remove the original `global-metadata.dat` and rename the new file to `global-metadata.dat`.
#### Third step: Repack the apk
We can do this with `apktool`:
```
apktool b ALL_STARS_3.12.0_gl_patched -o unsigned.apk
```
or
```
apktool b ALL_STARS_3.12.0_ja_patched-o unsigned.apk
```
After `apktool` is done, you can find the output `unsigned.apk` in the same directory. This `.apk` is not usable yet, we need to sign it before it can be installed in emulators or phones.
#### Fourth step: Sign the apk
To sign the `.apk`, we will need a few things.
The first is `apksigner`. You can either download a `.jar` online, or you can get it with the [Android SDK](https://developer.android.com/studio).
The second thing we need is a keystore. You can download this [keystore](https://codeberg.org/arina999999997/nozomi/raw/branch/master/sifkey.keystore) that has password `123456` for your convinience. If you want to generate your own key store, you will need `keytool`, which come with `java` (find it in java bin folder):
```
keytool -genkeypair -v -keystore sifkey.keystore -alias sifkey -keyalg RSA -keysize 2048 -validity 36500
```
You can choose your own password and the keystore name. After we have the keystore, you can sign the `.apk`:
```
apksigner sign --ks sifkey.keystore --ks-key-alias sifkey --out signed.apk unsigned.apk
```
You can change the `.apk` name if necessary.
After this, you can install the `.apk`. If you already have a version of SIFAS, you might get an error saying that the signature doesn't match. You can just uninstall the old SIFAS and install the new one in that case. Google play protect might say the file is suspicious, but you can still install it. Note that it's still possible to have a JP version and GL version (and potentially a CN version too) at the same time on the same device.
### Patching Android client to new address with frida
It's possible to use [frida](https://github.com/vfsfitvnm/frida-il2cpp-bridge) to change the address and avoid having to patch the `.apk`, as demonstated by [sarayalth](https://github.com/Sarayalth/llsifas-frida). If you don't want to use the above patching process, you might want to try that.
### Patching ios client to new address
The details on patching `.ipa` is outside of the author(s) knowledge and is not discussed here, but it is doable.
The ios clients distributed by `elichika` were patched by ``tungnotpunk`` in the LL Hax discord. If you want to learn how patch them yourself, you can find out more there.
# Install the elichika server
[elichika](https://github.com/YumeMichi/elichika) is a SIFAS server written by ``YumeMichi`` (``.yumemichi`` on discord). It is written in Go(lang), and it is still being worked on at the time of writing this documentation. As such, it's recommended that you install [git](https://git-scm.com/) to make it easy to keep your version up-to-date.
This documentation will walk through the process of installing and building `elichika` using `git` and some other tools. You can also try the [prebuilt server](#easy-install) but they might not be up to date, and might not work for your purpose.
## Platforms
Generally, if we can run Go on a platform, then we can run the server on it. Regardless of the platform, the setup will be something like this:
- Local PC: server run on a PC (windows, linux, mac), client connect to it through WLAN (Wi-Fi) or some tethering method.
- External PC: server run on an external machine, client connect to it through a public IP or a server address. This is the setup for online multiplayers, however that is not supported by the server (for now).
- Android/Termux: server run on the same android phone, tablet, or emulator as the client. More precisely, it will be running inside the [termux](#installing-termux-for-android) app (or other shell apps).
## Zeroth step: Install git for each platform
If you want to use `git` to get the server, and you didn't have it installed, you can download and install through the [official website](https://git-scm.com/downloads).
For Linux and Termux, you can also install `git` through the terminal (it's most likely already installed if you actively use Linux, but this is necessary for a fresh Termux install):
```
apt install git
```
If you don't want to use it, you can skip this step.
## First step: Download the server
### Using git
Nagivate to where you want to put the server and open up a terminal:
- For Windows, nagivate with the GUI to the folder you want to put the server, then enter `cmd`` into the address bar, that will open up a terminal inside that folder.
- For Linux GUI, you can also navigate to the directory you want, and right click, there should be an option to open the terminal.
- For all platforms, you can also just open the command prompt / terminal and go to the correct place. Expect to use things like `cd` and `mkdir` to navigate and create folder.
After that, use `git clone` to download the server:
```
git clone https://github.com/YumeMichi/elichika
```
You will get an `elichika` folder / directory. Go to it with your current terminal:
```
cd elichika
```
Everyt time you want to run the server, you will have to open a terminal in that directory.
If you use git, you can keep your server source code up to date by running the following:
```
git pull
```
Note that if you made changes to the server, then `git pull` might fail. You can either learn more about `.gitignore` (or other methods) to keep your changes, or you can just run:
```
git reset --hard
git pull
```
to update it, but you will have to make the change again.
### Download directly
You can also download the source code directly to avoid using `git`. If you do this, everytime you want to update the server, you will have to redownload everything.
Simply go to [elichika](https://github.com/YumeMichi/elichika) with your web browser, click on the Code button, click on Download ZIP, save the file, and extract it. You will need to open terminal in the extracted folder with `main.go` file.
## Third step: Build the server
It's recommended to build your own server if you can, so you can stay up-to-date and make the changes necessary.
### Installing Go
Because the server is written in Go, you have to install it to build the server.
For PC platforms, you can get it [here](https://go.dev/doc/install).
For Termux, run:
```
pkg install golang
```
### Building the server
On all platform, simply run:
```
go build
```
inside the `elichika` server. You will get an `elichika` binary (`elichika.exe` on windows). Note that you will have to rebuild everytime you update or make a change.
# Running the server
Before you can play the game, you have to run the server. To do that, go to the `elichika` folder, and run the binary through terminal / command prompt:
```
./elichika
```
remove the `./` on windows. On windows, you can also run it by opening the .exe file directly.
If you haven't configured the server correctly, you might have to change some config. Mostly you will change `config.json` or `main.go`.
[Easy setups](#easy-install) all provide correct configurations, but you might still want to do some modifications.
To change the files in windows or linux GUI, you can open any text editor to change config.
In Termux, you should use some command-line based text editor like `nano`, or `vim`. Looks up a tutorial if you don't know how to use them. You can also just use `sed` if you are comfortable with it.
## Providing a CDN server
A CDN (content distribution network) server is where the game(app) will download the files necessary (i.e. songs, stories). We can set it inside `config.json`. Note that if the file is not present, just run `elichika` and close it, the file will be generated.
By default, it's pointed to http://192.168.1.123/static (the same address as the default `elichika` server). This essentially tell the game to download game files from http://192.168.1.123/static (from the game network environment).
We can change the CDN server by changing that string in the `config.json` file.
### Online CDN
Thanks to ``sarah`` (``sarayalth``) from the LL Hax discord, there is a CDN that we can use to avoid hosting our own files.
Change the cnd server to https://llsifas.catfolk.party/static, and the game will download file from that server (through the internet). This is the recommended way to do this, however the server might become unavailable later on. The `config.json` file should looks something like this:
```
{"app_name":"elichika","settings":{"cdn_server":"https://llsifas.catfolk.party/static"}}
```
The [easy installs](#easy-install) all use this method.
### Self hosted CDN
`elichika` has the ability to host the CDN files, but we will have to have the CDN data ready. The data is 20GB for either GL or JP server, so 40GB for both.
One way to get them is from [archive.org](https://archive.org/details/ll-sifas-cdn-data). The direct downloading speed is not that great, so be prepared to leave your machine on for a very long time. If you don't want that, download using the `.torrent`, it would be much appreciated if you also host the files once downloaded. Do note that there are risks associated with torrenting, but that topic will not be discussed here.
Another way to get them is from extracting the downloaded game files. You can try this once you download the necessary files (from https://llsifas.catfolk.party/static), for example. To extract the files, use [this youtube tutorial](https://youtu.be/j4oh3qrCrfw), or any other methods you know.
You can also just directly download from https://llsifas.catfolk.party/static if you have the list of necessary files (check the file database).
Regardless of how you get the files, you want to put them in:
```
elichika/static/2d61e7b4e89961c7
```
for GL or
```
elichika/static/b66ec2295e9a00aa
```
for JP. After that, edit the `cnd_server` address to be `http://<server_address>/static` (i.e. http://192.168.1.123/static or http://127.0.0.1:8080/static) and we're done.
## Patching the database
Since we use the 3.12 clients, we have to use a patched database (as the cdn data was for 3.11 clients). The patched database is included in the same download with the basic clients [here](https://mega.nz/folder/gwJizZjS#v_fSOadf9yrb_eaOze2r7Q). Just extract the correct version GL or JP, and put them in `elichika/static/2d61e7b4e89961c7` (GL) or `elichika/static/b66ec2295e9a00aa` (JP).
The [easy installs](#easy-install) have the database patch included for both JP and GL version.
It's possible to patch and key the database again (if you want to modify some file / consts for example), although that is not discussed here. Join the discord and ask around for more informations.
## Changing server port
By default the server run on port 80. You can change by changing the `main.go` file. Remember that you have to rebuild if you do this. Maybe this is better in a config file, but it's hard coded for now.
To change the port, open up `main.go` the line:
```
r.Run(":80")
```
to whatever port you like, i.e.:
```
r.Run(":8080")
```
or
```
r.Run(":1503")
```
You can also use `sed`:
```
sed -i 's/r.Run(":80")/r.Run(":8080")/g' main.go
```
On some system (Linux and/or Termux), port with number less than 1024 need to have root permission (or just higher permission than normal) to open, so changing it to something bigger let you run without root. Your port 80 might also be used for other things, so you might want a new port.
# Playing the game
After you have the server installed and run it, just open the game. You will be prompted to choose language if you are using the GL version, English(EN), Korean (KR), and Traditional Chinese (ZH) are supported, choose the one you want.
You will then be prompted to download the files. If you have spaces on your phone / emulator, you can just download everything, however, other type of download also work just fine. Downloading everything let you play the game without the internet later on.
After you are done downloading, you can just play the game like normal.
For your information, here is the summany state of the server. Note these might be outdated, mising, or incorekt.
## Stuff that works (at least partially)
### Personalization
The following persionalizations work:
- Changing profile: You can select any card / title / name / nickname.
- Changing partner: You can select partners and their costumes, as well as the backgrounds.
### Partner interaction
You can interact with everyone, view their cards, view their costumes and preview them.
There is no bond board unlock as they are all maxed.
### 3DMV
You can watch all the MVs, with all the settings:
- The "custom formation" tab works and you have all the outfit to choose from.
- However changing costume in the "original formation" tab doesn't work, but you can just use the "custom formation" node.
### Story
You can read ALL the stories, ALL of them:
- All main stories
- All bond stories
- All side (card) stories
- All event stories
- All Nijigasaki anime tie-in stories
### Live show
You can build team and play live shows:
- You can play all the permanent songs and story songs.
- You can play all the daily song, but they are on a rotation similar to the official game, however there is no limit to how many time you can play. Maybe it will be possible to make it so all daily song are always available.
- You have all the cards almost maxed, along with maxed bond board and bond level 500 on every character, so you can try to clear the harder songs that you didn't manage to do before the game die.
- Autoplay will also get Wonderful judgement everytime. If you didn't know, this is a server setting, so you can change the server so that it behave like the official game if you want.
- The song play record is not implemented for now, and you don't get any item drops, but the main feature is there.
- After you complete a song, you always get taken to a story menu, so it might be a bit annoying.
- Some stuff like changing formation name can crash the game, but you can just restart.
- Skip ticket doesn't work.
- Overall the core stuff is there.
### School idols
You have all the school idols at max level, max limit breaks, and max practice tree:
- There's no idol rising experience for now.
### Training
You can do training:
- Training doesn't cost any AP.
- Training doesn't give you any items.
- Training doesn't depend on the regiments, you always get the same insight awarded, so you can use that to quickly build your maxed team.
- Training doesn't give any other skill for now, so you can't build a team that has maxed out skill chance for example.
### Accessories
You have all the accessories available in the original game, including stuff that was not obtainable:
- You have enough of each non-unique accessories.
- All accessories are maxed out.
- There is no way to get more for now.
- The game will crash if you try to disassemble or synthesize, or lock or remove from all formation etc. These will be address in due time.
## Stuff that doesn't work (at least at the time of writing)
Aside from the things that work partially, some stuff doesn't work at all and crash the game, you should avoid clicking on them.
### Gacha
Sadly you can't gacha for now.
### Membership card
Membership doesn't work on the global version (tapping it results in a crash).
Supposedly it works in the JP version.
### News
The news menu works but it shows you JP news, and if you click on the news it crashes.
### Goals
There's no goal (mission), you can click on it but it will freeze your game, so you will need to restart the game.
### Channel member
Crash the game if clicked on.
### Shop and exchange
Crash the game if clicked on.
### Multiplayer
No form of multiplayer exist or can exist with the current implementation. That might change later on.
### Event, SBL, and DLP
There is currently no way to play these modes. In the future, someone might figure that out.
# Future of the server
Development is still being done on the server by YumeMichi (and maybe other members). If you want to help, joining the LL Hax discord would be a good first step.
Ideally, we would at least have a server that offer the same experience of the SIFAS journey: Getting cards, costumes, clearing goals, raising idols, raising bond level and so on.
# Easy install
This section provide some premade server and clients so you don't have to make the modifications yourself.
## Clients
- [elichika](https://github.com/YumeMichi/elichika) provided [android and ios clients](https://mega.nz/folder/gwJizZjS#v_fSOadf9yrb_eaOze2r7Q). Connect to server at http://192.168.1.123:80
- localhost android clients. Connect to server at http://127.0.0.1:8080
- LAN android clients. Connect to server at http://192.168.1.123:8080
- For the `.apk` clients, you can get them [here](https://codeberg.org/arina999999997/nozomi/releases). The naming format is `ALL_STARS_3.12.0_version_ip_ip_ip_ip_port`. Version being GL or JP.
## Servers
- [elichika](https://github.com/YumeMichi/elichika) server source code and resource.
- [elichika](https://github.com/YumeMichi/elichika) server resource: download directly from [github](https://github.com/YumeMichi/elichika/archive/refs/heads/master.zip) and unzip.
- [catfolk CDN patch](https://codeberg.org/arina999999997/nozomi/raw/branch/master/catfolk_cdn.json).
- static/database: [same download as elichika provided clients](https://mega.nz/folder/gwJizZjS#v_fSOadf9yrb_eaOze2r7Q), or [direct zip](https://codeberg.org/arina999999997/nozomi_static_db/archive/master.zip)
- [elichika](https://github.com/YumeMichi/elichika) prebuilt [server binary](https://codeberg.org/arina999999997/nozomi/releases) for android arm64 (termux). The file names is in the format: `elichika_<OS>_<ARCH>_<PORT>`. Support for other platform was dropped as there seems to be no interest in them, but you can still build your own.
- To use a server version, download the server resource and extract it, download the CDN patch, download the correct binary. Put the binary and CDN patch inside the extracted server resource and run the binary.
## Common setups
### Server and client run on Android, with Termux
The server run inside Termux, on the same phone or emulator that you want to play SIFAS on. After downloading all of the game files, you can play anywhere anytime even without internet.
- Download the client that point to http://127.0.0.1:8080 and install it in your phone.
+ [GL version](https://codeberg.org/attachments/8d11c7d9-a57d-498e-ba3e-4fe529e741a6)
+ [JP version](https://codeberg.org/attachments/0483f301-b0cd-4cc5-b1a6-74da15419a90)
- Open up termux and enter the follow commands:
```
curl https://codeberg.org/arina999999997/nozomi/raw/branch/master/termux_install_script.sh -o sifas_install.sh && bash sifas_install.sh
```
- After that run the `elichika` server:
```
cd elichika
./elichika
```
- Finally run the game and enjoy.
The install script also provide an update script, running it will update `elichika` to the newest version and rebuild the server. The update script will install `git` and `go`, which might fail on certain devices. To run it:
```
cd elichika
./update.sh
```
#### Common problem
If the installing process doesn't work, you might have one of the following problems:
- If you can't install the `.apk` then you're out of luck. You can try another device or an emulator.
- If anything happen before you run the binary, your Termux has problem. Likely that it's too old. You should try installing Termux through this [guide](#installing-termux-for-android).
- If you run the server binary and it doesn't work, it's likely that your system has a different architecture. It might also start and give you a warning (this still works). Running the update script will rebuild it for you.
- Note that in some system, even if you can build the go binary, you will still have a problem when running it (some link library error). If this happens, it's easier to just use another device that work.
If the update script doesn't work:
- It probably failed in installing `go` or `git`. This is quite random, you should ask around for help in this case.
### Server on PC, play on phone, through Wi-Fi
The server run on your PC (Windows / Linux / MacOS). You play on your phone. The 2 devices has to be in the same network.
- Download the client that point to http://192.168.1.123:80 (or http://192.168.1.123:8080 if you can't use port 80) and install that.
- Download the source code (`git` prefered) and build your own `server` on the PC with `go`.
- Change your PC's local IP to 192.168.1.123. You might also have to deal with firewall stuff. Look up how to change IP on `<your specific system>` if you have trouble.
- Run the binary on PC and run the game on your phone.
- Note that if you are using port 80, you might need to run the server with root permission on Linux and MacOS, otherwise the program just close after it start.
### Server on PC, client on android, through adb
In the case that you want to run server on PC but play on android or emulator, and you don't want the Wi-Fi method, you can rely on [adb](https://developer.android.com/tools/adb).
- Download the client that point to http://127.0.0.1:8080 and install it in your device.
- Download a server that run at http://127.0.0.1:8080 on your PC.
- For phones, tablets, enable [developer options](https://developer.android.com/studio/debug/dev-options), and turn on `adb`.
- For emulators, just enable ADB in setting (depend on emulator).
- Connect your device to your PC, accept the USB debugging and run:
```
adb reverse tcp:8080 tcp:8080
```
- This map http://127.0.0.1:8080 in your android to http://127.0.0.1:8080 in your PC, allow the app to connect to the server.
- If you don't want to have your device plugged in to your computer, debug the device through `tcpip` mode. If you are going to do this, it's good to have a static IP for your device, then you can make a script that connect to your device and run the server.
# Random knowledge
Some random knowledge that you might already know, or stuff that is inconvenience to discuss elsewhere.
## Installing necessary programs in Linux/Mac/Termux
If you need a program, say `git`, you can just type it to the terminal. The terminal will say that you don't have that program, but it will let you know which command to install the thing. If it doesn't then the tool you are trying to use is very niche, but you can still find some installing guide by searching.
## Installing .apk
For android, you can just use device / emulator to download the `.apk` and install it. You might have to go through some step or give some permission, but it should be doable.
Pretty much all emulators have a way to install `.apk`. You can use that feature for them. Most of them also let you install `.apk` by dragging them into the emulator.
Finally, you can install `.apk` through `adb`.
## Installing .ipa
For ios, it's way harder to install custom package. Please look up guide or ask the communities for help.
## Installing termux (for android)
[Termux](https://termux.dev/en/) give you access to various things, you can do things usually done on computers like programming. In our case, it let us run the server and play the game everywhere (without internet if you has downloaded the game files).
You can build termux yourself, but for simplicity, you can install Termux through the [F-Droid release](https://f-droid.org/en/packages/com.termux/). You can either use the F-Droid app, or download the `.apk` directly from the page and install that.
Note that the Termux from Google Play store is very OUTDATED, and it will likely NOT WORK.