Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 🚀 Update API (add Blackbox, Identity, Fingerprint, etc) #5

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

GorlikItsMe
Copy link

Update API to work with updated Gameforge API

Added:

  • Identity - load fingerprint
  • Fingerprint - store and shuffle device fingerprint
  • Blackbox - calculate black-box value used to talk with gf API
  • GfAccount - New class to make all things much simpler
  • example folder with login_to_game example

Updated:

  • CertificateStore (now can use .pem)

.gitignore Show resolved Hide resolved
.prettierrc.js Outdated Show resolved Hide resolved
.prettierrc.js Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
* Generate new Identity
* Values are random generated, and can be incorrect (can be detectable and you could be banned)
*/
public static generateIdentity(filePath: string): void {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe let's not expose a method that is potentially dangerous

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function is public so that the user can generate a new identity.
Comment about incorrect values is because I random generate all random string, hashes etc.
Auth works but uses should manually change for example GPU name etc

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be honest I think instead of generating the identity with random values, we should expose methods that allow users to decode it from a request made by the client.

src/lib/utils/Fingerprint.ts Show resolved Hide resolved
src/lib/utils/fixFingerprintDataTypes.ts Outdated Show resolved Hide resolved
src/lib/utils/fixFingerprintDataTypes.ts Show resolved Hide resolved
src/lib/utils/Identity.ts Outdated Show resolved Hide resolved
Copy link
Author

@GorlikItsMe GorlikItsMe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Things left todo

@zakuciael zakuciael self-assigned this Oct 11, 2022
Copy link
Owner

@zakuciael zakuciael left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tho I still need to look in-depth into the blackbox and fingerprint implementations, I've wanted to give you an early review with smaller changes I've found so that you can start working on them in the meantime.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
example/login_to_game.ts Outdated Show resolved Hide resolved
example/login_to_game.ts Outdated Show resolved Hide resolved
example/login_to_game.ts Outdated Show resolved Hide resolved
example/login_to_game.ts Outdated Show resolved Hide resolved
src/lib/GameforgeAPI.ts Outdated Show resolved Hide resolved
/**
* @internal
*/
export function randomIntFromRange(min: number, max: number): number {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a new file called utils/random.ts and move this method to it. After all, ints have nothing to do with strings.

@@ -2,23 +2,21 @@ import { IFingerprint } from "../../types";
import { fingerprintNoQuotes } from "../../types/Fingerprint";

export function fixFingerprintDataTypes(fingerprint: IFingerprint): IFingerprint {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move those fixes to zod's preprocesses similar to how you made the zodDateString method.

* Random generate new Fingerprint
* Values are random generated and can be incorrect (can be detectable and you could be banned)
*/
export function generateRandomFingerprint(): Fingerprint {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still not sure if we really want to have this method here.

GorlikItsMe and others added 7 commits October 15, 2022 20:41
Co-authored-by: Krzysztof Saczuk <[email protected]>
Co-authored-by: Krzysztof Saczuk <[email protected]>
Co-authored-by: Krzysztof Saczuk <[email protected]>
Co-authored-by: Krzysztof Saczuk <[email protected]>
Co-authored-by: Krzysztof Saczuk <[email protected]>
Co-authored-by: Krzysztof Saczuk <[email protected]>
Co-authored-by: Krzysztof Saczuk <[email protected]>
Copy link
Author

@GorlikItsMe GorlikItsMe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@GorlikItsMe
Copy link
Author

Got information about changed blackbox but this need to be checked
So please don't use this code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants