diff --git a/desktop/app/src/utils/CertificateProvider.tsx b/desktop/app/src/utils/CertificateProvider.tsx index 863d759eb..a57ee1f05 100644 --- a/desktop/app/src/utils/CertificateProvider.tsx +++ b/desktop/app/src/utils/CertificateProvider.tsx @@ -54,7 +54,7 @@ const deviceClientCertFile = 'device.crt'; const caSubject = '/C=US/ST=CA/L=Menlo Park/O=Sonar/CN=SonarCA'; const serverSubject = '/C=US/ST=CA/L=Menlo Park/O=Sonar/CN=localhost'; const minCertExpiryWindowSeconds = 24 * 60 * 60; -const allowedAppNameRegex = /^[\w._-]+$/; +const allowedAppNameRegex = /^[\w.-]+$/; const logTag = 'CertificateProvider'; /* * RFC2253 specifies the unamiguous x509 subject format. @@ -395,11 +395,11 @@ export default class CertificateProvider { .filter((d) => d.foundCsr !== null) .map((d) => (d.foundCsr ? encodeURI(d.foundCsr) : 'null')); console.error(`Looking for CSR (url encoded): - + ${encodeURI(this.santitizeString(csr))} - + Found these: - + ${foundCsrs.join('\n\n')}`); throw new Error(`No matching device found for app: ${appName}`); } diff --git a/desktop/app/src/utils/androidContainerUtilityInternal.tsx b/desktop/app/src/utils/androidContainerUtilityInternal.tsx index 740476976..45c0b367b 100644 --- a/desktop/app/src/utils/androidContainerUtilityInternal.tsx +++ b/desktop/app/src/utils/androidContainerUtilityInternal.tsx @@ -15,7 +15,7 @@ import {UnsupportedError} from './metrics'; import adbkit, {Client} from 'adbkit'; -const allowedAppNameRegex = /^[\w._-]+$/; +const allowedAppNameRegex = /^[\w.-]+$/; const appNotApplicationRegex = /not an application/; const appNotDebuggableRegex = /debuggable/; const operationNotPermittedRegex = /not permitted/; diff --git a/desktop/babel-transformer/src/fb-stubs.ts b/desktop/babel-transformer/src/fb-stubs.ts index d3b87b518..6db1f0dee 100644 --- a/desktop/babel-transformer/src/fb-stubs.ts +++ b/desktop/babel-transformer/src/fb-stubs.ts @@ -15,7 +15,7 @@ const isFBFile = (filePath: string) => filePath.includes(`${path.sep}fb${path.sep}`); const requireFromFolder = (folder: string, path: string) => - new RegExp(folder + '/[\\w.-_]+(.js)?$', 'g').test(path); + new RegExp(folder + '/[\\w.-]+(.js)?$', 'g').test(path); module.exports = () => ({ name: 'replace-fb-stubs', diff --git a/desktop/plugins/crash_reporter/index.tsx b/desktop/plugins/crash_reporter/index.tsx index 39e757056..227f08418 100644 --- a/desktop/plugins/crash_reporter/index.tsx +++ b/desktop/plugins/crash_reporter/index.tsx @@ -321,7 +321,7 @@ export function parseCrashLog( const regForName = /.*\n/; const nameRegArr = regForName.exec(content); let name = nameRegArr ? nameRegArr[0] : fallbackReason; - const regForCallStack = /\tat[\w\s\n.$&+,:;=?@#|'<>.^*()%!-]*$/; + const regForCallStack = /\tat[\w\s\n\.$&+,:;=?@#|'<>.^*()%!-]*$/; const callStackArray = regForCallStack.exec(content); const callStack = callStackArray ? callStackArray[0] : ''; let remainingString = @@ -360,18 +360,12 @@ function truncate(baseString: string, numOfChars: number): string { } export function parsePath(content: string): Maybe { - const regex = /Path: *[\w\-\/\.\t\ \_\%]*\n/; + const regex = /(?<=.*Path: *)[^\n]*/; const arr = regex.exec(content); if (!arr || arr.length <= 0) { return null; } - const pathString = arr[0]; - const pathRegex = /[\w\-\/\.\t\ \_\%]*\n/; - const tmp = pathRegex.exec(pathString); - if (!tmp || tmp.length == 0) { - return null; - } - const path = tmp[0]; + const path = arr[0]; return path.trim(); } diff --git a/desktop/plugins/sections/src/StackTrace.tsx b/desktop/plugins/sections/src/StackTrace.tsx index 88aa47a6b..3e9983b89 100644 --- a/desktop/plugins/sections/src/StackTrace.tsx +++ b/desktop/plugins/sections/src/StackTrace.tsx @@ -12,7 +12,7 @@ import {colors, StackTrace} from 'flipper'; const FacebookLibraries = ['Facebook']; -const REGEX = /\d+\s+(?(\s|\w|\.)+\w)\s+(?
0x\w+?)\s+(?.+) \+ (?\d+)/; +const REGEX = /\d+\s+(?[\s\w\.]+\w)\s+(?
0x\w+?)\s+(?.+) \+ (?\d+)/; function isSystemLibrary(libraryName: string | null | undefined): boolean { return libraryName ? !FacebookLibraries.includes(libraryName) : false;