mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-05-12 19:34:47 +01:00
[Bug] Fix local save encoding crash and Psychic anim (#5775)
* fix error: utf8 to base64 * fix error: space missed
This commit is contained in:
parent
e3028c6219
commit
7547b37e85
@ -118,15 +118,17 @@ export function getDataTypeKey(dataType: GameDataType, slotId = 0): string {
|
||||
}
|
||||
|
||||
export function encrypt(data: string, bypassLogin: boolean): string {
|
||||
return (bypassLogin ? (data: string) => btoa(data) : (data: string) => AES.encrypt(data, saveKey))(
|
||||
data,
|
||||
) as unknown as string; // TODO: is this correct?
|
||||
return (bypassLogin
|
||||
? (data: string) => btoa(encodeURIComponent(data))
|
||||
: (data: string) => AES.encrypt(data, saveKey))(data) as unknown as string; // TODO: is this correct?
|
||||
}
|
||||
|
||||
export function decrypt(data: string, bypassLogin: boolean): string {
|
||||
return (bypassLogin ? (data: string) => atob(data) : (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8))(
|
||||
data,
|
||||
);
|
||||
return (
|
||||
bypassLogin
|
||||
? (data: string) => decodeURIComponent(atob(data))
|
||||
: (data: string) => AES.decrypt(data, saveKey).toString(enc.Utf8)
|
||||
)(data);
|
||||
}
|
||||
|
||||
export interface SystemSaveData {
|
||||
|
Loading…
x
Reference in New Issue
Block a user