Anti-Cheat Toolkit
2023.2.6
Multi-purpose anti-cheat solution for Unity Engine
|
Inherits IPostprocessBuildWithReport.
Public Member Functions | |
delegate void | OnHashesGenerated (BuildReport report, IReadOnlyList< BuildHashes > hashedBuilds) |
Static Public Member Functions | |
static BuildHashes | CalculateExternalBuildHashes (string buildPath, bool printToConsole) |
static async Task< BuildHashes > | CalculateExternalBuildHashesAsync (string buildPath, bool printToConsole) |
static Task< IReadOnlyList< BuildHashes > > | CalculateBuildReportHashesAsync (BuildReport report, bool printToConsole) |
Static Public Attributes | |
const int | CallbackOrder = int.MaxValue |
Events | |
static OnHashesGenerated | HashesGenerated |
Does calculates code hash after build if you use option "Generate code hash". Listen to HashesGenerated or look for hash for each build in the Editor Console.
Resulting hash in most cases should match value you get from the CodeHashGenerator
delegate void OnHashesGenerated | ( | BuildReport | report, |
IReadOnlyList< BuildHashes > | hashedBuilds | ||
) |
HashesGenerated event delegate.
report | Standard post-build report from Unity. |
hashedBuilds | Build hashing results array. |
You may generate multiple actual builds within single build operation, like multiple APKs when you use "Split APKs by target architecture" option, so you may have more than one valid hashed builds for one actual build procedure.
|
inlinestatic |
Calls selection dialog and calculates hashes for the selected build.
buildPath | Path to the .apk / .aab or .exe file. Pass null to show file selection dialog. |
printToConsole | Path to the .apk / .aab or .exe file. Pass null to show file selection dialog. |
|
inlinestatic |
Calls selection dialog and calculates hashes for the selected build.
buildPath | Path to the .apk / .aab or .exe file. Pass null to show file selection dialog. |
printToConsole | Path to the .apk / .aab or .exe file. Pass null to show file selection dialog. |
|
inlinestatic |
Calculates hashes for the given build report. Can be useful if you wish to hash build you just made with BuildPipeline.
Will not trigger the HashesGenerated event.
report | BuildReport you wish to calculates hashes for |
printToConsole | Specifies if calculated hashes should be printed to Unity Console |
|
static |
Equals int.MaxValue to make sure this postprocessor will run as late as possible so you could run own postprocessors before and subscribe to HashesGenerated event.
Used at CodeHashGeneratorListener example.
|
static |
You may listen to this event if you wish to post-process resulting code hash, e.g. upload it to the server for the later runtime check with CodeHashGenerator.
Make sure to enable "Generate code hash on build completion" option in the ACTk settings to make this event work.