-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: master
Are you sure you want to change the base?
Conversation
Add Identity.generateIdentity
src/lib/utils/Identity.ts
Outdated
* 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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Co-authored-by: Krzysztof Saczuk <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things left todo
- remove node-forge and recreate it
- src/lib/utils/BlackBox.ts -> replace
escape
toURLSearchParams
- Merge
Identity
andFingerprint
- src/lib/utils/Identity.ts -> add validate loaded file using
zod
- Add missing https://github.com/zakuciael/gf-login/blob/45252098578e4654eb94242979ebff089a99ea02/src/lib/sendStartTimeEvent.ts
There was a problem hiding this 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.
/** | ||
* @internal | ||
*/ | ||
export function randomIntFromRange(min: number, max: number): number { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
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]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good
Got information about changed blackbox but this need to be checked |
Update API to work with updated Gameforge API
Added:
example
folder with login_to_game exampleUpdated: