• Preface

        This tool is a Jar package file applicable to Windows, Linux, and Mac operating systems. requiring the installation of the Java environment.

        If using on Mac or Linux systems, you need to grant executable permissions to the files in the modules directory.

        The following instructions are described for the Windows environment, but similar methods apply to other operating systems.


  • Game Package Protection

        Ⅰ. APK Protection Command Line Parameters

        java -jar FairGuard.jar -autoconfig [options] -inputfile %inputapk% [-outputfile %outputapk%]

      Parameter

      Description

      -autoconfig

      Required, automatically sets protection settings.

      [options]

      Optional, for signing or aligning the protected APK.

      -inputfile

      Required, followed by the full path to the APK file to be protected.

      -outputfile

      Optional, the path for the output file. If not set, the default is the same directory as %inputapk% with the filename ending in _fairguard_protected.apk.

        Options Description:

      Parameter

      Description

      -sign

      Sign the protected APK. By default, this also aligns the APK.

        APK Protection and Signing Command Line Example:

        java -jar FairGuardx.x.x.jar -autoconfig -sign -inputfile game.apk


        Ⅱ. AAB Protection Command Line Parameters

        java -jar FairGuard.jar -autoconfig -sign -inputfile %inputaab% [-outputfile %outputaab%]

      Parameter

      Description

      -autoconfig

      Required, automatically sets protection settings.

      [options]

      Optional, for signing the protected AAB.

      -inputfile

      Required, followed by the full path to the AAB file to be protected.

      -outputfile

      Optional, the path for the output file. If not set, the default is the same directory as %inputaab% with the filename ending in _fairguard_protected.aab.

        Options Description:

      Parameter

      Description

      -sign

      Sign the protected AAB. 

      For AAB signing, ensure the directory containing Jarsigner is in your system's path.

        AAB Protection and Signing Command Line Example:

        java -jar FairGuardx.x.x.jar -autoconfig -sign -inputfile game.aab


        Ⅲ. config.ini Configuration

       The `config.ini` file is located in the same directory as the FairGuard.jar file. Here are the settings for its main fields:

        ■ gamekey

        Users must enter the game key in this configuration file, as shown .

    [gamekey]

    key=638f**************************d636d531

        If you do not have a game key, please apply for one on the official website or contact customer service. (For signing APKs or AABs only, you can enter any content for the key without applying for an official game key.)

        ■ Protection Directory Setting

    [packworkir]

    dir=d:packworkir

        Set the protection directory for storing temporary files during the protection process. If not set, the temporary files will be stored in the directory where FairGuard.jar is located.

        ■ Signature Information Configuration

        If you need to perform automatic signing, in addition to adding the `-sign` parameter in the command line, you also need to set the signature-related information in the `config.ini` file, as shown.

    [signinfo]

    keystore-path=c:xxxxxxgamesign. jks

    alias=xxxx

    password=xxxxx

    alias-pwd=xxxxx

        - `keystore-path`: The path to the signature file, represented by an absolute path (the path must not contain Chinese characters).

        - `alias`: The alias for the signature.

        - `password`: The password for the signature information.

        - `alias-pwd`: The password for the signature alias.

        If any of the above four pieces of information are incorrect, the signing process will fail.

        ■ Setting the Game Engine's so File

        For engines not inherently supported like Unity, UE, and Cocos, add the necessary option for engine protection.

    [engineso]

    name=game-engine. so


  • APK Signing

        Command Line Parameters

        java -jar FairGuard.jar -optype_sign_apk -inputfile %inputfile.apk% [-outputfile %output.apk%]

      Parameter

      Description

      -optype_sign_apk

      Required, for APK signing.

      -inputfile

      Required, the path to the APK to sign.

      -outputfile

      Optional, the path for the signed APK. If not set, the default is the same directory as %inputfile.apk% with the filename ending in _signed.

        Signature information is set up in the `config.ini` file, as illustrated:

    [signinfo]

    keystore-path=c:xxxxxxgamesign. jks

    alias=xxxx

    password=xxxxx

    alias-pwd=xxxxx

        - `keystore-path`: The full path to the keystore file (no Chinese characters allowed).

        - `alias`: The alias for signing.

        - `password`: The password for the keystore entry.

        - `alias-pwd`: The password for the signing alias.

        Any mistake in these four details will cause the signing to fail.

        If the `signver` field is not configured, signatures for v1, v2, and v3 will be made.

        For v1 signing only, use the configuration shown :

    [signinfo]

    keystore-path=c:xxxxxxgamesign.jks

    alias=xxxx

    password=xxxxx

    alias-pwd=xxxxx

    signver=v1

        If you're only signing and not verifying the `gamekey`, you can set it to anything.

        APK Signing Command Line Example:

        java-jarFairGuardx.x.x.jar-optype_sign_apk-inputfilegame.apk


  • AAB Signing

        Command Line Parameters

        java -jar FairGuard.jar -optype_sign_jar-inputfile %inputfile.aab% [-outputfile %output.aab%]

      Parameter

      Description

      -optype_sign_jar

      Required, for AAB signing.

      -inputfile

      Required, the path to the AAB to sign.

      -outputfile

      Optional, the path for the signed AAB. If not set, the default is the same directory as %inputfile.aab% with the filename ending in _signed.

        Signature information is set up in the `config.ini` file, as illustrated :

    [signinfo]

    keystore-path=c:xxxxxxgamesign.jks

    alias=xxxx

    password=xxxxx

    alias-pwd=xxxxx

        - `keystore-path`: The full path to the keystore file(no Chinese characters allowed)

        - `alias`: The alias for signing.

        - `password`: The password for the keystore entry.

        - `alias-pwd`: The password for the signing alias.

        Any mistake in these four details will cause the signing to fail.

        If you're only signing and not verifying the `gamekey`, you can set it to anything.

        AAB Signing Command Line Example:

        java -jar FairGuardx.x.x.jar -optype_sign_jar -inputfile game.aab


  • Usage Notes

        ■ Keep signatures consistent when using anti-cracking features. Submit signed packages to customer service if you join Google's Signature Program.

        ■ On Mac or Linux, grant executable permissions to files in the modules directory.

        ■ If you have any other questions, please contact us with Telegram or Skype.

    FairGuardFairGuard


Protect your mobile game now ?

Protect your mobile game now ?

Email to support@fair-guard.com, describe the problem. We will contact you.

Contact FairGuard