Browse Source
Co-authored-by: YaroslavBerkuta <yaroslavberkuta@gmail.com> Co-authored-by: Vitalik <vitalik.yatsenko@jetup.team> Co-authored-by: Oksana Stepanenko <oksana.stepanenko@jetup.team> Reviewed-on: #18pull/21/head
Vitalik Yatsenko
9 months ago
28 changed files with 242 additions and 70 deletions
@ -0,0 +1,7 @@
@@ -0,0 +1,7 @@
|
||||
<?xml version='1.0' encoding='utf-8'?> |
||||
<paths xmlns:android="http://schemas.android.com/apk/res/android"> |
||||
<files-path name="files" path="/" /> |
||||
<external-files-path name="external_files" path="" /> |
||||
<external-path name="external" path="." /> |
||||
<cache-path name="cache" path="/" /> |
||||
</paths> |
@ -1,14 +1,15 @@
@@ -1,14 +1,15 @@
|
||||
export enum FileType { |
||||
DOC = "doc", |
||||
GIF = "gif", |
||||
JPEG = "jpeg", |
||||
JPG = "jpg", |
||||
MP3 = "mp3", |
||||
MP4 = "mp4", |
||||
PDF = "pdf", |
||||
PNG = "png", |
||||
SVG = "svg", |
||||
TXT = "txt", |
||||
XLS = "xls", |
||||
ZIP = "zip" |
||||
} |
||||
DOC = 'doc', |
||||
GIF = 'gif', |
||||
JPEG = 'jpeg', |
||||
JPG = 'jpg', |
||||
MP3 = 'mp3', |
||||
MP4 = 'mp4', |
||||
PDF = 'pdf', |
||||
PNG = 'png', |
||||
SVG = 'svg', |
||||
TXT = 'txt', |
||||
XLS = 'xls', |
||||
ZIP = 'zip', |
||||
DOCX = 'docx', |
||||
} |
||||
|
@ -0,0 +1,28 @@
@@ -0,0 +1,28 @@
|
||||
import { Platform } from 'react-native' |
||||
import { TranspositionCipher } from './tranposition-cipher.helper' |
||||
import DeviceInfo from 'react-native-device-info' |
||||
|
||||
export class UserFingerprintGenerator { |
||||
private static exist: string |
||||
|
||||
static generateUserFingerprint(): string { |
||||
if (this.exist) return this.exist |
||||
|
||||
const deviceId = DeviceInfo.getDeviceId() |
||||
|
||||
const fingerprint = `deviceId:::${deviceId}|platform:::${ |
||||
Platform.OS |
||||
}|brand:::${DeviceInfo.getBrand()}` |
||||
|
||||
console.log('fingerprint', fingerprint) |
||||
|
||||
const hashedFingerprint = this.hashFunction(fingerprint.trim()) |
||||
|
||||
this.exist = hashedFingerprint |
||||
return hashedFingerprint |
||||
} |
||||
|
||||
private static hashFunction(input: string): string { |
||||
return TranspositionCipher.encrypt(input) |
||||
} |
||||
} |
@ -0,0 +1,11 @@
@@ -0,0 +1,11 @@
|
||||
import { encode, decode } from 'js-base64' |
||||
|
||||
export class TranspositionCipher { |
||||
static encrypt(message: string): string { |
||||
return encode(message) |
||||
} |
||||
|
||||
static decrypt(encryptedMessage: string): string { |
||||
return decode(encryptedMessage) |
||||
} |
||||
} |
Loading…
Reference in new issue