Skip to content

Commit

Permalink
* Update support 3.3
Browse files Browse the repository at this point in the history
* Update link github
* Update API Download Akebi
* Remove command tab (only focused web version)
  • Loading branch information
Akbar Yahya committed Dec 9, 2022
1 parent 3548b00 commit 28283d8
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Json/Mod/Akebi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ namespace YuukiPS_Launcher.Json.Mod
public class Cn
{
public string? url { get; set; }
public string? md6 { get; set; }
public string? md5 { get; set; }
}

public class Os
{
public string? url { get; set; }
public string? md6 { get; set; }
public string? md5 { get; set; }
}

public class Akebi
Expand Down
13 changes: 0 additions & 13 deletions Main.Designer.cs

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

158 changes: 146 additions & 12 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ public bool CheckVersionGame()
md5_ori = get_version.original.md5_check.os.userassembly;
}
}
else if (get_metode == "RSA")
{
GameMetode = 3;
md5_ori = "No need to check";
}

Get_LA_MD5.Text = "MD5: " + md5_ori;

Expand Down Expand Up @@ -364,6 +369,7 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1,
string MD5_UA_API_Patched;
string MD5_Metadata_API_Original;
string MD5_Metadata_API_Patched;
string MD5_API_Patched;

var DL_Patch = get_version.patched.resources + "Patch/";
var DL_Original = get_version.original.resources;
Expand All @@ -389,6 +395,8 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1,
Original_file_MA = DL_Original + "GenshinImpact_Data/Managed/Metadata/global-metadata.dat";
Original_file_UA = DL_Original + "GenshinImpact_Data/Native/UserAssembly.dll";

MD5_API_Patched = get_version.patched.md5_vaild.os.ToUpper();

}
else if (use_channel == "CN")
{
Expand All @@ -403,6 +411,8 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1,

Original_file_MA = DL_Original + "YuanShen_Data/Managed/Metadata/global-metadata.dat";
Original_file_UA = DL_Original + "YuanShen_Data/Native/UserAssembly.dll";

MD5_API_Patched = get_version.patched.md5_vaild.cn.ToUpper();
}
else
{
Expand All @@ -411,27 +421,35 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1,

// >> Make sure MD5 API is not empty <<

// skip check patch
if (metode != 3)
{
if (String.IsNullOrEmpty(MD5_UA_API_Patched))
{
return "Game version is not supported (3)";
}
if (String.IsNullOrEmpty(MD5_Metadata_API_Patched))
{
return "Game version is not supported (1)";
}
}

if (String.IsNullOrEmpty(MD5_UA_API_Original))
{
return "Game version is not supported (4)";
}
if (String.IsNullOrEmpty(MD5_UA_API_Patched))
{
return "Game version is not supported (3)";
}
if (String.IsNullOrEmpty(MD5_Metadata_API_Original))
{
return "Game version is not supported (2)";
}
if (String.IsNullOrEmpty(MD5_Metadata_API_Patched))
{
return "Game version is not supported (1)";
}


// >> All <<

// Check Folder UA
var cst_folder_UA = Set_UA_Folder.Text;
var cst_folder_Game = Set_LA_GameFolder.Text;

if (String.IsNullOrEmpty(cst_folder_UA))
{
return "No UserAssembly folder found (1)";
Expand Down Expand Up @@ -1176,12 +1194,128 @@ public string PatchGame(bool patchit = true, bool online = true, int metode = 1,
*/

return "I'm tired Checking Metadata";
} else if(metode == 3) {

var fileRSA = cst_folder_Game + "/version.dll";
var fileRSA_BK = cst_folder_Game + "/version.bk";

var fileRSA_Public = cst_folder_Game + "/PublicKey.txt";

// TODO: ADD KEY SERVER
File.WriteAllText(fileRSA_Public, "<RSAKeyValue><Modulus>xbbx2m1feHyrQ7jP+8mtDF/pyYLrJWKWAdEv3wZrOtjOZzeLGPzsmkcgncgoRhX4dT+1itSMR9j9m0/OwsH2UoF6U32LxCOQWQD1AMgIZjAkJeJvFTrtn8fMQ1701CkbaLTVIjRMlTw8kNXvNA/A9UatoiDmi4TFG6mrxTKZpIcTInvPEpkK2A7Qsp1E4skFK8jmysy7uRhMaYHtPTsBvxP0zn3lhKB3W+HTqpneewXWHjCDfL7Nbby91jbz5EKPZXWLuhXIvR1Cu4tiruorwXJxmXaP1HQZonytECNU/UOzP6GNLdq0eFDE4b04Wjp396551G99YiFP2nqHVJ5OMQ==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>");

Console.WriteLine("Find file: "+ fileRSA);

var dl_rsa = false;
var RSAMD5 = "";

if (patchit)
{
if (File.Exists(fileRSA))
{
// check if source true
RSAMD5 = Tool.CalculateMD5(fileRSA);
if (RSAMD5 == MD5_API_Patched)
{
// if not found backup rsa key, copy dll to bk
if (!File.Exists(fileRSA_BK))
{
Console.WriteLine("No found backup file rsa key so copy");
File.Copy(fileRSA, fileRSA_BK, true);
}

Console.WriteLine("Skip download RSAKEY");
}
else
{
Console.WriteLine("file not same " + RSAMD5 + " download rsa key " + MD5_API_Patched);
dl_rsa = true;
}

}
else
{
if (File.Exists(fileRSA_BK))
{
if (RSAMD5 == MD5_API_Patched)
{
Console.WriteLine("found backup file rsa key so copy");
try
{
File.Copy(fileRSA_BK, fileRSA, true);
}
catch (Exception ex) {
Console.WriteLine(ex.Message);
return "error1";
}
}
else
{
Console.WriteLine("key rsa not same so just download it");
dl_rsa = true;
}
}
else
{
Console.WriteLine("No found file so just download it");
dl_rsa = true;
}
}
}
else
{
// remove file
try
{
if (File.Exists(fileRSA))
{
Console.WriteLine("Remove file rsa key");
File.Delete(fileRSA);
}
}
catch (Exception ex) {
Console.WriteLine(ex.Message);
return "error";
}
}

if (dl_rsa)
{
var DL2 = new Download(DL_Patch+ "RSAPatch.dll", fileRSA);
if (DL2.ShowDialog() != DialogResult.OK)
{
return "No Found Patch file....";
}
else
{
RSAMD5 = Tool.CalculateMD5(fileRSA);
}
}

Console.WriteLine("RSA MD5: " + RSAMD5);
//return "TODO: "+ DL_Patch;
}
else
{
else {
return "No other method found";
}

if(metode != 3)
{
var fileRSA = cst_folder_Game + "/version.dll";
if (File.Exists(fileRSA))
{
try
{
Console.WriteLine("remove file rsa key (2)");
File.Delete(fileRSA);
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}

return "";
}

Expand Down Expand Up @@ -1625,7 +1759,7 @@ private void btStart_Click(object sender, EventArgs e)
}
else
{
Console.WriteLine("No new Akebi found");
Console.WriteLine("No new Akebi found: "+ cekAkebi);
}
}

Expand Down Expand Up @@ -1859,7 +1993,7 @@ private void linkDiscord_LinkClicked(object sender, LinkLabelLinkClickedEventArg

private void linkGithub_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
Process.Start(new ProcessStartInfo("https://github.com/akbaryahya/YuukiPS-Launcher") { UseShellExecute = true });
Process.Start(new ProcessStartInfo("https://github.com/YuukiPS/Launcher-PC") { UseShellExecute = true });
}

private void linkWeb_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## YuukiPS Launcher
A simple Launcher that run several anime games.

![GitHub release (latest by date)](https://img.shields.io/github/downloads/akbaryahya/YuukiPS-Launcher/latest/total) ![GitHub all releases](https://img.shields.io/github/downloads/akbaryahya/YuukiPS-Launcher/total) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fakbaryahya%2FYuukiPS-Launcher&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=true)](https://hits.seeyoufarm.com)
![GitHub release (latest by date)](https://img.shields.io/github/downloads/YuukiPS/Launcher-PC/latest/total) ![GitHub all releases](https://img.shields.io/github/downloads/akbaryahya/YuukiPS-Launcher/total) [![Hits](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Fakbaryahya%2FYuukiPS-Launcher&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=true)](https://hits.seeyoufarm.com)

### Features

Expand All @@ -19,7 +19,7 @@ A simple Launcher that run several anime games.

### Installation

For Nightly Releases [Download here](https://github.com/akbaryahya/YuukiPS-Launcher/releases)
For Nightly Releases [Download here](https://github.com/YuukiPS/Launcher-PC/releases)

Required
* [.NET 6.0 Runtime (Desktop)](https://dotnet.microsoft.com/en-us/download/dotnet/6.0/runtime)
Expand Down
8 changes: 5 additions & 3 deletions Yuuki/API.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public class API
public static string API_DL_OW = "https://drive.yuuki.me/";
public static string API_DL_WB = "https://ps.yuuki.me/api/";

public static string API_GITHUB_YuukiPS = "https://api.github.com/repos/akbaryahya/YuukiPS-Launcher/";
public static string API_GITHUB_YuukiPS = "https://api.github.com/repos/YuukiPS/Launcher-PC/";
public static string API_GITHUB_RSA = "https://api.github.com/repos/34736384/RSAPatch/";

public static Cient GS_DL(string dl = "os")
{
var client = new RestClient(API_DL_WB);
Expand Down Expand Up @@ -236,11 +238,11 @@ public static Patch GetMD5Game(string md5)
{
if(ch == 2)
{
return GetData.package.cn.md6 + "|" + GetData.package.cn.url;
return GetData.package.cn.md5 + "|" + GetData.package.cn.url;
}
else
{
return GetData.package.os.md6 + "|" + GetData.package.os.url;
return GetData.package.os.md5 + "|" + GetData.package.os.url;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Yuuki/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace YuukiPS_Launcher.Yuuki
{
public class Server
{
private static string API_GITHUB_DockerGS = "https://api.github.com/repos/akbaryahya/DockerGS/";
private static string API_GITHUB_DockerGS = "https://api.github.com/repos/YuukiPS/DockerGS/";
private static string API_GITHUB_Grasscutter = "https://api.github.com/repos/Grasscutters/Grasscutter/";
private static string API_DL_Grasscutter_Resources = "https://gitlab.com/yukiz/GrasscutterResources/";

Expand Down
4 changes: 2 additions & 2 deletions YuukiPS Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ApplicationManifest>Properties\app.manifest</ApplicationManifest>

<AssemblyVersion>2022.11.18.0243</AssemblyVersion>
<FileVersion>2022.11.18.0243</FileVersion>
<AssemblyVersion>2022.12.9.1529</AssemblyVersion>
<FileVersion>2022.12.9.1529</FileVersion>

<EnableWindowsTargeting>true</EnableWindowsTargeting>
<AssemblyName>YuukiPS</AssemblyName>
Expand Down

0 comments on commit 28283d8

Please sign in to comment.