Skip to content

Commit

Permalink
Supported Unity2021.3.8f1 for Mac M1
Browse files Browse the repository at this point in the history
  • Loading branch information
tylearymf committed Aug 18, 2022
1 parent 3d4dc94 commit ed81b7d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions Patcher/Hub/UnityHubV3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,19 @@ internal class UnityHubV3
});
}";

const string fetchUserInfo = @"
fetchUserInfo(accessToken) {
return {
foreign_key: 'anonymous',
name: 'anonymous',
email: 'anonymous@gmail.com',
primary_org: 'anonymous',
identifier: 'anonymous',
created_at: 0,
}
}
";

public static bool Patch(string exportFolder)
{
var authServicePath = Path.Combine(exportFolder, "build/main/services/authService/AuthService.js");
Expand All @@ -76,6 +89,11 @@ public static bool Patch(string exportFolder)
UnityHubPatcher.ReplaceMethod(ref licenseServiceContent, @"isLicenseValid\(\)\s*", isLicenseValid);
File.WriteAllText(licenseServicePath, licenseServiceContent);

var cloudCorePath = Path.Combine(exportFolder, "build/main/services/cloudCore/cloudCore.js");
var cloudCoreContent = File.ReadAllText(cloudCorePath);
UnityHubPatcher.ReplaceMethod(ref cloudCoreContent, @"fetchUserInfo\(accessToken\)\s*", fetchUserInfo);
File.WriteAllText(cloudCorePath, cloudCoreContent);

return true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Patcher/Unity/UnityPatchInfos.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public static List<byte[]> ToBytes(params byte[][] bytesArray)
new()
{
// 2021.3.6(m1) 2021.3.7(m1)
Version = "2021.3",
Version = "2021.3.6 ; 2021.3.7",
Architecture = ArchitectureType.MacOS_ARM64,
LightPattern = ToBytes(ToArray("F4 02 00 34 81 D0 00 F0 21 20 25 91"), ToArray("20 06 00 36 E1 E3 01 91 E0 03 13 AA 2F 0B")),
DarkPattern = ToBytes(ToArray("17 00 00 14 81 D0 00 F0 21 20 25 91"), ToArray("20 06 00 37 E1 E3 01 91 E0 03 13 AA 2F 0B")),
Expand Down
2 changes: 1 addition & 1 deletion UniHacker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<BuiltInComInteropSupport>true</BuiltInComInteropSupport>
<Authors>tylearymf</Authors>
<Company>tylearymf</Company>
<Version>2.9</Version>
<Version>3.0</Version>
<PackageId>com.tylearymf.unihacker</PackageId>
<PackageProjectUrl>https:/www.github.com/tylearymf/unihacker</PackageProjectUrl>
<ApplicationIcon>Assets\avalonia-logo.ico</ApplicationIcon>
Expand Down

0 comments on commit ed81b7d

Please sign in to comment.