File tree Expand file tree Collapse file tree 3 files changed +3
-21
lines changed Expand file tree Collapse file tree 3 files changed +3
-21
lines changed Original file line number Diff line number Diff line change 4444 "publishConfig" : {
4545 "registry" : " https://registry.npmjs.org/"
4646 },
47- "dependencies" : {
48- "base-64" : " ^1.0.0"
49- },
5047 "devDependencies" : {
5148 "@react-native-community/eslint-config" : " ^3.0.2" ,
5249 "@release-it/conventional-changelog" : " ^5.0.0" ,
5350 "@tsconfig/node-lts" : " ^20.1.1" ,
5451 "@types/react" : " 17.0.21" ,
5552 "@types/react-native" : " 0.70.0" ,
56- "@types/base-64" : " ^1.0.2" ,
5753 "del-cli" : " ^5.0.0" ,
5854 "eslint" : " ^8.4.1" ,
5955 "eslint-config-prettier" : " ^8.5.0" ,
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import {
1313 type TalsecConfig ,
1414} from './definitions' ;
1515import { getThreatCount , itemsHaveType } from './utils' ;
16- import { decode } from 'base-64 ' ;
16+ import { Buffer } from 'buffer ' ;
1717
1818const { FreeraspReactNative } = NativeModules ;
1919
@@ -55,15 +55,11 @@ const prepareMapping = async (): Promise<void> => {
5555
5656// parses base64-encoded malware data to SuspiciousAppInfo[]
5757const parseMalwareData = ( data : string [ ] ) : SuspiciousAppInfo [ ] => {
58- const result : SuspiciousAppInfo [ ] = [ ] ;
59- data . forEach ( ( entry ) => {
60- result . push ( toSuspiciousAppInfo ( entry ) ) ;
61- } ) ;
62- return result ;
58+ return data . map ( ( entry ) => toSuspiciousAppInfo ( entry ) ) ;
6359} ;
6460
6561const toSuspiciousAppInfo = ( base64Value : string ) : SuspiciousAppInfo => {
66- const data = JSON . parse ( decode ( base64Value ) ) ;
62+ const data = JSON . parse ( Buffer . from ( base64Value , 'base64' ) . toString ( 'utf8' ) ) ;
6763 const packageInfo = data . packageInfo as PackageInfo ;
6864 return { packageInfo, reason : data . reason } as SuspiciousAppInfo ;
6965} ;
Original file line number Diff line number Diff line change 26062606 dependencies :
26072607 " @babel/types" " ^7.20.7"
26082608
2609- " @types/base-64@^1.0.2 " :
2610- version "1.0.2"
2611- resolved "https://registry.yarnpkg.com/@types/base-64/-/base-64-1.0.2.tgz#f7bc80d242306f20c57f076d79d1efe2d31032ca"
2612- integrity sha512-uPgKMmM9fmn7I+Zi6YBqctOye4SlJsHKcisjHIMWpb2YKZRc36GpKyNuQ03JcT+oNXg1m7Uv4wU94EVltn8/cw==
2613-
26142609" @types/graceful-fs@^4.1.3 " :
26152610 version "4.1.9"
26162611 resolved "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz"
@@ -3518,11 +3513,6 @@ balanced-match@^1.0.0:
35183513 resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz"
35193514 integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==
35203515
3521- base-64@^1.0.0 :
3522- version "1.0.0"
3523- resolved "https://registry.yarnpkg.com/base-64/-/base-64-1.0.0.tgz#09d0f2084e32a3fd08c2475b973788eee6ae8f4a"
3524- integrity sha512-kwDPIFCGx0NZHog36dj+tHiwP4QMzsZ3AgMViUBKI0+V5n4U0ufTCUMhnQ04diaRI8EX/QcPfql7zlhZ7j4zgg==
3525-
35263516base64-js@^1.1.2, base64-js@^1.2.3, base64-js@^1.3.1, base64-js@^1.5.1 :
35273517 version "1.5.1"
35283518 resolved "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz"
You can’t perform that action at this time.
0 commit comments