rea-agents 4.1.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +184 -86
- package/bridge/android/ReaJadxBridge.java +247 -0
- package/bridge/native/NativeUIChildren.swift +27 -0
- package/bridge/native/ReaNativeUI.swift +30 -16
- package/dist/android/AndroidTargetSnapshot.js +5 -3
- package/dist/android/JadxAnalysis.js +8 -6
- package/dist/android/JadxConfiguration.js +19 -3
- package/dist/android/JadxMcpTransport.js +43 -16
- package/dist/android/JadxProtocol.js +8 -0
- package/dist/android/JadxProvider.js +117 -28
- package/dist/android/JadxRelease.js +8 -0
- package/dist/android/JadxSession.js +32 -18
- package/dist/application/AppBundleExecutable.js +141 -0
- package/dist/application/ArtifactInventory/classify.js +1 -1
- package/dist/application/ArtifactInventory/scanCanonical.js +1 -1
- package/dist/application/ArtifactInventory/scanReader.js +1 -1
- package/dist/application/ArtifactInventory.js +1 -1
- package/dist/application/BinaryTargetResolver.js +9 -64
- package/dist/application/CapabilityInventory.js +61 -3
- package/dist/application/ClientConfigurationDocument.js +72 -12
- package/dist/application/ClientRegistrationStatus.js +7 -8
- package/dist/application/DirectAnalysis.js +12 -14
- package/dist/application/DirectAnalysisStatus.js +4 -5
- package/dist/application/DoctorDiagnostics.js +3 -3
- package/dist/application/EnhancedTools.js +4 -4
- package/dist/application/EvidenceBundleCommands.js +1 -1
- package/dist/application/FilesystemSnapshot.js +20 -5
- package/dist/application/InvestigationProviders.js +6 -0
- package/dist/application/LinuxHopper.js +8 -2
- package/dist/application/OptionalObservationProviders.js +3 -0
- package/dist/application/ProcessCaptureCapability.js +1 -1
- package/dist/application/ProcessCaptureLifecycle.js +2 -2
- package/dist/application/ProcessCli.js +5 -1
- package/dist/application/ProcessHarness.js +20 -9
- package/dist/application/ReconstructionCoverageService.js +2 -6
- package/dist/application/ReconstructionObligationCandidates.js +5 -2
- package/dist/application/ReferenceSourceImport.js +2 -0
- package/dist/application/ReferenceSourceImportEntries.js +20 -3
- package/dist/application/ReferenceSourceImportTypes.js +5 -0
- package/dist/application/Setup.js +10 -2
- package/dist/application/SetupClientConfiguration.js +19 -16
- package/dist/application/SetupHost.js +18 -3
- package/dist/application/SetupPlan.js +1 -1
- package/dist/application/Uninstall.js +23 -17
- package/dist/application/UpdateMaintenance.js +3 -3
- package/dist/application/ValidateSelectedWebScript.js +27 -0
- package/dist/application/WebModuleTraceService.js +209 -0
- package/dist/application/WebRuntimeService.js +73 -0
- package/dist/application/WebScriptExportService.js +115 -0
- package/dist/application/WebSourceLocationService.js +160 -0
- package/dist/application/{AndroidAnalysisService.js → android/AndroidAnalysisService.js} +6 -6
- package/dist/application/{AndroidApplicationService.js → android/AndroidApplicationService.js} +3 -3
- package/dist/application/{AppleApplicationService.js → apple/AppleApplicationService.js} +5 -5
- package/dist/application/{AnalysisClientCleanup.js → binary/AnalysisClientCleanup.js} +2 -2
- package/dist/application/{AnalysisProviderEvaluation.js → binary/AnalysisProviderEvaluation.js} +4 -4
- package/dist/application/{AnalysisProviderRegistry.js → binary/AnalysisProviderRegistry.js} +5 -5
- package/dist/application/{AnalysisSnapshotCache.js → binary/AnalysisSnapshotCache.js} +7 -9
- package/dist/application/{AnalysisSnapshotFiles.js → binary/AnalysisSnapshotFiles.js} +4 -4
- package/dist/application/{BinarySession.js → binary/BinarySession.js} +12 -10
- package/dist/application/{BinarySessionComposition.js → binary/BinarySessionComposition.js} +2 -1
- package/dist/application/{BinarySessionExecution.js → binary/BinarySessionExecution.js} +9 -7
- package/dist/application/{BinarySessionOpen.js → binary/BinarySessionOpen.js} +6 -6
- package/dist/application/{BinarySessionRecords.js → binary/BinarySessionRecords.js} +28 -40
- package/dist/application/{CompositeProvider.js → binary/CompositeProvider.js} +2 -2
- package/dist/application/{LazyAnalysisProvider.js → binary/LazyAnalysisProvider.js} +6 -6
- package/dist/application/{SessionProviderRouter.js → binary/SessionProviderRouter.js} +7 -7
- package/dist/application/{FirmwareAnalysisService.js → firmware/FirmwareAnalysisService.js} +5 -5
- package/dist/application/{EvidenceLedger.js → investigation/EvidenceLedger.js} +44 -7
- package/dist/application/investigation/InvestigationRecords.js +69 -0
- package/dist/application/{UnknownEvidence.js → investigation/UnknownEvidence.js} +1 -1
- package/dist/application/{ElectronActiveEvidence.js → javascript/ElectronActiveEvidence.js} +3 -3
- package/dist/application/javascript/ElectronActiveObservationPort.js +1 -0
- package/dist/application/{ElectronActiveObservationService.js → javascript/ElectronActiveObservationService.js} +3 -3
- package/dist/application/{ElectronBoundaryAnalysis.js → javascript/ElectronBoundaryAnalysis.js} +1 -1
- package/dist/application/{ElectronBoundaryGraphContext.js → javascript/ElectronBoundaryGraphContext.js} +1 -1
- package/dist/application/{ElectronEvidence.js → javascript/ElectronEvidence.js} +2 -2
- package/dist/application/javascript/ElectronObservationPort.js +1 -0
- package/dist/application/{ElectronObservationService.js → javascript/ElectronObservationService.js} +3 -3
- package/dist/application/{JavaScriptApplicationEvidence.js → javascript/JavaScriptApplicationEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationEvidenceGraph.js → javascript/JavaScriptApplicationEvidenceGraph.js} +5 -5
- package/dist/application/{JavaScriptApplicationService.js → javascript/JavaScriptApplicationService.js} +10 -10
- package/dist/application/{JavaScriptApplicationWorkflowEvidence.js → javascript/JavaScriptApplicationWorkflowEvidence.js} +3 -3
- package/dist/application/{JavaScriptApplicationWorkflowService.js → javascript/JavaScriptApplicationWorkflowService.js} +12 -12
- package/dist/application/{JavaScriptArtifactAnalysis.js → javascript/JavaScriptArtifactAnalysis.js} +8 -24
- package/dist/application/javascript/JavaScriptArtifactAnalysisTypes.js +1 -0
- package/dist/application/{JavaScriptArtifactGraphAccumulator.js → javascript/JavaScriptArtifactGraphAccumulator.js} +16 -2
- package/dist/application/{JavaScriptArtifactGraphBuilder.js → javascript/JavaScriptArtifactGraphBuilder.js} +2 -2
- package/dist/application/{JavaScriptArtifactGraphContext.js → javascript/JavaScriptArtifactGraphContext.js} +1 -1
- package/dist/application/{JavaScriptArtifactGraphDocuments.js → javascript/JavaScriptArtifactGraphDocuments.js} +1 -1
- package/dist/application/{JavaScriptArtifactGraphFindings.js → javascript/JavaScriptArtifactGraphFindings.js} +20 -7
- package/dist/application/{JavaScriptArtifactGraphStructure.js → javascript/JavaScriptArtifactGraphStructure.js} +1 -1
- package/dist/application/{JavaScriptArtifactPathResolution.js → javascript/JavaScriptArtifactPathResolution.js} +6 -12
- package/dist/application/{JavaScriptArtifactReconstruction.js → javascript/JavaScriptArtifactReconstruction.js} +4 -8
- package/dist/application/{JavaScriptJsonModules.js → javascript/JavaScriptJsonModules.js} +1 -1
- package/dist/application/{JavaScriptModuleRelationships.js → javascript/JavaScriptModuleRelationships.js} +2 -2
- package/dist/application/javascript/JavaScriptRecoveryPort.js +1 -0
- package/dist/application/javascript/JavaScriptRecoveryService.js +52 -0
- package/dist/application/{JavaScriptReturnShapeProjection.js → javascript/JavaScriptReturnShapeProjection.js} +3 -3
- package/dist/application/{JavaScriptRuntimeObservationEvidence.js → javascript/JavaScriptRuntimeObservationEvidence.js} +2 -2
- package/dist/application/javascript/JavaScriptRuntimeObservationPort.js +1 -0
- package/dist/application/{JavaScriptRuntimeObservationService.js → javascript/JavaScriptRuntimeObservationService.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationEvidence.js → javascript/JavaScriptRuntimeReconciliationEvidence.js} +3 -3
- package/dist/application/{JavaScriptRuntimeReconciliationService.js → javascript/JavaScriptRuntimeReconciliationService.js} +6 -6
- package/dist/application/{JavaScriptSemanticGraphAsyncProjection.js → javascript/JavaScriptSemanticGraphAsyncProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphBuilder.js → javascript/JavaScriptSemanticGraphBuilder.js} +5 -3
- package/dist/application/{JavaScriptSemanticGraphChildProcessProjection.js → javascript/JavaScriptSemanticGraphChildProcessProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphConstruction.js → javascript/JavaScriptSemanticGraphConstruction.js} +3 -2
- package/dist/application/{JavaScriptSemanticGraphDataProjection.js → javascript/JavaScriptSemanticGraphDataProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphFingerprintProjection.js → javascript/JavaScriptSemanticGraphFingerprintProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphFlowProjection.js → javascript/JavaScriptSemanticGraphFlowProjection.js} +2 -2
- package/dist/application/{JavaScriptSemanticGraphObjectProjection.js → javascript/JavaScriptSemanticGraphObjectProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticGraphProjection.js → javascript/JavaScriptSemanticGraphProjection.js} +2 -2
- package/dist/application/{JavaScriptSemanticGraphResourceProjection.js → javascript/JavaScriptSemanticGraphResourceProjection.js} +1 -1
- package/dist/application/{JavaScriptSemanticTraceService.js → javascript/JavaScriptSemanticTraceService.js} +6 -6
- package/dist/application/{ManagedApplicationGraphService.js → managed/ManagedApplicationGraphService.js} +7 -7
- package/dist/application/{ManagedMemberComparisonService.js → managed/ManagedMemberComparisonService.js} +10 -10
- package/dist/application/{ManagedNativeVerificationService.js → managed/ManagedNativeVerificationService.js} +7 -7
- package/dist/application/{ManagedReconstructionService.js → managed/ManagedReconstructionService.js} +7 -7
- package/dist/application/{NativeApiInspection.js → native/NativeApiInspection.js} +1 -1
- package/dist/application/{NativeCallRoutes.js → native/NativeCallRoutes.js} +3 -3
- package/dist/application/{NativeDispatchMetadataInspection.js → native/NativeDispatchMetadataInspection.js} +4 -4
- package/dist/application/{NativeUiActionTrace.js → native/NativeUiActionTrace.js} +7 -7
- package/dist/application/{NativeValueTrace.js → native/NativeValueTrace.js} +6 -6
- package/dist/{application/ArtifactInventory/hash.js → artifacts/ArtifactHash.js} +4 -2
- package/dist/artifacts/ArtifactPaths.js +3 -3
- package/dist/artifacts/ArtifactProvider.js +7 -37
- package/dist/artifacts/ArtifactProviderMetadata.js +36 -0
- package/dist/artifacts/AsarArtifactReader.js +195 -23
- package/dist/artifacts/AsarEntryStream.js +76 -0
- package/dist/artifacts/DirectoryArtifactReader.js +41 -7
- package/dist/artifacts/NativeDmgArtifactReader.js +161 -9
- package/dist/{application → artifacts/apple}/AppleAssetCatalogAnalysis.js +4 -4
- package/dist/{application → artifacts/apple}/InterfaceBuilderAnalysis.js +125 -51
- package/dist/artifacts/{KeyedArchiveReader.js → apple/KeyedArchiveReader.js} +21 -27
- package/dist/artifacts/apple/NibViewHierarchy.js +150 -0
- package/dist/{application → artifacts/javascript}/JavaScriptArtifactFiles.js +27 -6
- package/dist/artifacts/javascript/JavaScriptArtifactReader.js +6 -0
- package/dist/artifacts/readStableArtifact.js +52 -0
- package/dist/browser/BrowserScenarioSecrets.js +50 -8
- package/dist/browser/CdpAuthorizedMainFrame.js +4 -4
- package/dist/browser/CdpAuthorizedTarget.js +22 -0
- package/dist/browser/CdpBrowserProvider.js +4 -15
- package/dist/browser/CdpCaptureDocuments.js +33 -21
- package/dist/browser/CdpCaptureEventBodyShapes.js +3 -3
- package/dist/browser/CdpCaptureEventHandlers.js +26 -26
- package/dist/browser/CdpCaptureEventHelpers.js +6 -6
- package/dist/browser/CdpCaptureStorage.js +10 -8
- package/dist/browser/CdpCaptureStorageFingerprints.js +24 -22
- package/dist/browser/CdpCaptureValues.js +2 -2
- package/dist/browser/CdpCommandRejection.js +17 -0
- package/dist/browser/CdpConnection.js +51 -11
- package/dist/browser/CdpElectronInspection.js +10 -10
- package/dist/browser/CdpElectronProvider.js +3 -6
- package/dist/browser/CdpElectronScriptEvents.js +6 -6
- package/dist/browser/CdpElectronScripts.js +2 -2
- package/dist/browser/CdpElectronWorkers.js +4 -4
- package/dist/browser/CdpObservationSession.js +18 -23
- package/dist/browser/CdpPageCapture.js +4 -4
- package/dist/browser/CdpPageCaptureScripts.js +2 -2
- package/dist/browser/CdpPageCaptureWorkers.js +9 -9
- package/dist/browser/CdpSafeMetadata.js +48 -10
- package/dist/browser/CdpScreenshot.js +5 -5
- package/dist/browser/CdpTargetEvents.js +8 -0
- package/dist/browser/CdpTargetSession.js +2 -2
- package/dist/browser/CdpWebMcpDiscovery.js +22 -16
- package/dist/browser/PlaywrightBrowserScenarioProvider.js +7 -6
- package/dist/browser/PlaywrightElectronActiveProvider.js +3 -6
- package/dist/browser/PlaywrightScenarioEvents.js +59 -51
- package/dist/browser/PlaywrightScenarioSession.js +8 -1
- package/dist/browser/WebSourceMapFetcher.js +37 -53
- package/dist/browser/assets/LocalWebScriptArtifacts.js +87 -0
- package/dist/browser/assets/PageScriptCapture.js +32 -0
- package/dist/browser/assets/PublishWebScripts.js +74 -0
- package/dist/browser/assets/ScenarioScriptCapture.js +76 -0
- package/dist/browser/assets/ScriptCaptureAdapters.js +57 -0
- package/dist/browser/assets/WebArtifactReads.js +56 -0
- package/dist/browser/assets/WebSourceLocationArtifacts.js +40 -0
- package/dist/browser/execution/CdpEventListeners.js +79 -0
- package/dist/browser/execution/CdpExecutionCapture.js +135 -0
- package/dist/browser/execution/CdpExecutionCollection.js +57 -0
- package/dist/browser/execution/CdpExecutionWindow.js +100 -0
- package/dist/browser/execution/CdpListenerSelector.js +22 -0
- package/dist/browser/execution/CdpPreciseCoverage.js +48 -0
- package/dist/browser/execution/CdpRuntimeInitiator.js +18 -0
- package/dist/browser/execution/CdpRuntimeProtocol.js +106 -0
- package/dist/browser/execution/CdpRuntimeRequests.js +81 -0
- package/dist/browser/execution/CdpRuntimeSession.js +163 -0
- package/dist/browser/execution/CdpRuntimeSources.js +223 -0
- package/dist/browser/execution/CdpWebRuntimeProvider.js +51 -0
- package/dist/browser/modules/NativeModuleResolver.js +210 -0
- package/dist/browser/modules/WebModuleArtifacts.js +40 -0
- package/dist/browser/network/PlaywrightNetworkContent.js +71 -0
- package/dist/browser/network/PlaywrightScenarioNetwork.js +180 -0
- package/dist/browser/providerIdentities.js +24 -0
- package/dist/catalogIdentity.js +23 -15
- package/dist/cli/androidCommands.js +13 -3
- package/dist/cli/applicationCommands.js +39 -8
- package/dist/cli/artifactCommands.js +1 -1
- package/dist/cli/browserAdvancedCommands.js +27 -9
- package/dist/cli/coreAnalysisCommands.js +5 -493
- package/dist/cli/coreBinaryCommands.js +211 -0
- package/dist/cli/coreNativeCommands.js +293 -0
- package/dist/cli/electronCommands.js +13 -18
- package/dist/cli/firmwareCommands.js +3 -3
- package/dist/cli/javascriptApplicationAnalysis.js +1 -1
- package/dist/cli/javascriptRecoveryCommands.js +45 -0
- package/dist/cli/managedCommands.js +4 -4
- package/dist/cli/managedProjectGraphCommand.js +1 -1
- package/dist/cli/referenceSourceImportStatus.js +6 -1
- package/dist/cli/utilityCommands.js +47 -23
- package/dist/cli/webModuleCommands.js +56 -0
- package/dist/cli/webRuntimeCommands.js +60 -0
- package/dist/cli/webScriptCommands.js +31 -0
- package/dist/cli/webSourceLocationCommands.js +42 -0
- package/dist/cli.js +10 -0
- package/dist/cliBrowserContext.js +4 -2
- package/dist/cliBrowserScenarioCommands.js +4 -3
- package/dist/cliCommandNames.js +8 -0
- package/dist/cliJavaScriptRuntimeCommands.js +6 -4
- package/dist/cliJsonInput.js +9 -2
- package/dist/cliOutput.js +37 -11
- package/dist/composition/android.js +3 -0
- package/dist/composition/auxiliaryAnalysisProviders.js +30 -0
- package/dist/composition/binary.js +25 -0
- package/dist/composition/browserObservation.js +3 -0
- package/dist/composition/browserScenario.js +3 -0
- package/dist/composition/directAnalysis.js +17 -0
- package/dist/composition/electronObservation.js +3 -0
- package/dist/composition/electronScenario.js +3 -0
- package/dist/composition/firmware.js +3 -0
- package/dist/composition/javascriptRecovery.js +3 -0
- package/dist/composition/javascriptRuntimeObservation.js +3 -0
- package/dist/composition/optionalObservationProviders.js +49 -0
- package/dist/composition/webModules.js +5 -0
- package/dist/composition/webRuntime.js +4 -0
- package/dist/composition/webSourceLocations.js +5 -0
- package/dist/config/parseConfig.js +22 -3
- package/dist/contracts/{androidToolContracts.js → android/androidToolContracts.js} +5 -5
- package/dist/contracts/applicationToolContracts.js +43 -8
- package/dist/contracts/artifactToolContracts.js +2 -2
- package/dist/contracts/browserScenarioToolContracts.js +1 -1
- package/dist/contracts/enhancedInputs.js +1 -1
- package/dist/contracts/{firmwareToolContracts.js → firmware/firmwareToolContracts.js} +5 -5
- package/dist/contracts/{applicationWorkflowInputContracts.js → javascript/applicationWorkflowInputContracts.js} +6 -6
- package/dist/contracts/{electronToolContracts.js → javascript/electronToolContracts.js} +6 -6
- package/dist/contracts/{javascriptApplicationWorkflowExamples.js → javascript/javascriptApplicationWorkflowExamples.js} +3 -3
- package/dist/contracts/javascript/javascriptRecoveryToolContracts.js +23 -0
- package/dist/contracts/{javascriptRuntimeObservationToolContracts.js → javascript/javascriptRuntimeObservationToolContracts.js} +3 -3
- package/dist/contracts/{javascriptRuntimeReconciliationExample.js → javascript/javascriptRuntimeReconciliationExample.js} +5 -5
- package/dist/contracts/{managedToolContracts.js → managed/managedToolContracts.js} +3 -3
- package/dist/contracts/{managedWorkflowExamples.js → managed/managedWorkflowExamples.js} +1 -1
- package/dist/contracts/{managedWorkflowToolContracts.js → managed/managedWorkflowToolContracts.js} +6 -6
- package/dist/contracts/mobileApplicationGraphExamples.js +105 -0
- package/dist/contracts/{nativeToolContracts.js → native/nativeToolContracts.js} +14 -7
- package/dist/contracts/officialToolContracts.js +3 -3
- package/dist/contracts/sessionToolContracts.js +1 -1
- package/dist/contracts/toolContracts.js +13 -7
- package/dist/contracts/toolEffects.js +32 -0
- package/dist/contracts/toolOutputSchemaGroups.js +18 -18
- package/dist/contracts/webRuntimeToolContracts.js +43 -0
- package/dist/contracts/webScriptToolContracts.js +68 -0
- package/dist/domain/analysisErrorCore.js +4 -2
- package/dist/domain/analysisErrorProjection.js +1 -0
- package/dist/domain/{androidApplication.js → android/androidApplication.js} +7 -6
- package/dist/domain/apple/appleApplication.js +277 -0
- package/dist/domain/{appleAssetCatalog.js → apple/appleAssetCatalog.js} +2 -2
- package/dist/domain/apple/appleBundleAnatomy.js +236 -0
- package/dist/domain/{interfaceBuilderGraph.js → apple/interfaceBuilderGraph.js} +47 -314
- package/dist/domain/apple/interfaceBuilderKeyedArchive.js +411 -0
- package/dist/domain/{keyedArchive.js → apple/keyedArchive.js} +10 -9
- package/dist/domain/apple/plistValue.js +35 -0
- package/dist/domain/artifactInventoryEvidence.js +12 -2
- package/dist/domain/artifactInventorySnapshot.js +1 -0
- package/dist/domain/artifactOperationError.js +5 -1
- package/dist/domain/artifactPathSyntax.js +26 -0
- package/dist/domain/browserNetworkEvidence.js +82 -0
- package/dist/domain/browserObservationError.js +2 -0
- package/dist/domain/browserObservationSchemas.js +2 -1
- package/dist/domain/browserScenarioCapture.js +22 -0
- package/dist/domain/browserScenarioCaptureValues.js +25 -0
- package/dist/domain/browserScenarioDiff.js +6 -3
- package/dist/domain/browserScenarioDiffEvidence.js +35 -1
- package/dist/domain/browserScenarioValues.js +12 -1
- package/dist/domain/browserSession.js +2 -7
- package/dist/domain/bundleComparison.js +2 -1
- package/dist/domain/callPath.js +52 -44
- package/dist/domain/comparisonStatus.js +39 -0
- package/dist/domain/evidenceBundle.js +98 -35
- package/dist/domain/{firmwareAnalysis.js → firmware/firmwareAnalysis.js} +2 -2
- package/dist/domain/functionComparisonNormalization.js +11 -13
- package/dist/domain/hopperValues.js +2 -2
- package/dist/domain/inputIssueProjection.js +17 -2
- package/dist/domain/{electronObservation.js → javascript/electronObservation.js} +5 -11
- package/dist/domain/{electronStaticAnalysisBrowser.js → javascript/electronStaticAnalysisBrowser.js} +4 -3
- package/dist/domain/{electronStaticAnalysisIpc.js → javascript/electronStaticAnalysisIpc.js} +2 -2
- package/dist/domain/{electronStaticAnalysisNative.js → javascript/electronStaticAnalysisNative.js} +12 -13
- package/dist/domain/javascript/electronStaticAnalysisTypes.js +1 -0
- package/dist/domain/{electronStaticAnalysisValues.js → javascript/electronStaticAnalysisValues.js} +3 -3
- package/dist/domain/{javascriptApplicationAnalysis.js → javascript/javascriptApplicationAnalysis.js} +2 -2
- package/dist/domain/{javascriptApplicationChangeGraph.js → javascript/javascriptApplicationChangeGraph.js} +1 -1
- package/dist/domain/{javascriptApplicationEvidenceSchemas.js → javascript/javascriptApplicationEvidenceSchemas.js} +6 -4
- package/dist/domain/{javascriptApplicationGraph.js → javascript/javascriptApplicationGraph.js} +2 -2
- package/dist/domain/{javascriptApplicationGraphSchemas.js → javascript/javascriptApplicationGraphSchemas.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparison.js → javascript/javascriptApplicationVersionComparison.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionComparisonSchemas.js → javascript/javascriptApplicationVersionComparisonSchemas.js} +3 -3
- package/dist/domain/{javascriptApplicationVersionItems.js → javascript/javascriptApplicationVersionItems.js} +2 -2
- package/dist/domain/{javascriptApplicationVersionKeys.js → javascript/javascriptApplicationVersionKeys.js} +16 -9
- package/dist/domain/javascript/javascriptArtifactFiles.js +1 -0
- package/dist/domain/{javascriptAstFingerprint.js → javascript/javascriptAstFingerprint.js} +38 -22
- package/dist/domain/javascript/javascriptAstValues.js +23 -0
- package/dist/domain/{javascriptExportShapeComparison.js → javascript/javascriptExportShapeComparison.js} +1 -1
- package/dist/domain/{javascriptExportShapeComparisonSchemas.js → javascript/javascriptExportShapeComparisonSchemas.js} +2 -2
- package/dist/domain/{javascriptExportShapeSelection.js → javascript/javascriptExportShapeSelection.js} +1 -1
- package/dist/domain/{javascriptExportShapeVariants.js → javascript/javascriptExportShapeVariants.js} +1 -1
- package/dist/domain/{javascriptFeatureSeed.js → javascript/javascriptFeatureSeed.js} +4 -3
- package/dist/domain/{javascriptFeatureTrace.js → javascript/javascriptFeatureTrace.js} +2 -2
- package/dist/domain/{javascriptFeatureTraceSchemas.js → javascript/javascriptFeatureTraceSchemas.js} +32 -18
- package/dist/domain/{javascriptFeatureTraversal.js → javascript/javascriptFeatureTraversal.js} +6 -2
- package/dist/domain/{javascriptNativeHandoff.js → javascript/javascriptNativeHandoff.js} +1 -1
- package/dist/domain/javascript/javascriptRecovery.js +88 -0
- package/dist/domain/{javascriptRuntimeLoadState.js → javascript/javascriptRuntimeLoadState.js} +1 -1
- package/dist/domain/{javascriptRuntimeObservation.js → javascript/javascriptRuntimeObservation.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationActive.js → javascript/javascriptRuntimeReconciliationActive.js} +3 -3
- package/dist/domain/{javascriptRuntimeReconciliationGraph.js → javascript/javascriptRuntimeReconciliationGraph.js} +1 -1
- package/dist/domain/{javascriptRuntimeReconciliationMatching.js → javascript/javascriptRuntimeReconciliationMatching.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationParsing.js → javascript/javascriptRuntimeReconciliationParsing.js} +5 -5
- package/dist/domain/{javascriptRuntimeReconciliationResult.js → javascript/javascriptRuntimeReconciliationResult.js} +2 -2
- package/dist/domain/{javascriptRuntimeReconciliationSchemas.js → javascript/javascriptRuntimeReconciliationSchemas.js} +4 -4
- package/dist/domain/{javascriptRuntimeStaticCandidates.js → javascript/javascriptRuntimeStaticCandidates.js} +1 -1
- package/dist/domain/{javascriptSemanticAnalysis.js → javascript/javascriptSemanticAnalysis.js} +40 -14
- package/dist/domain/{javascriptSemanticAsyncEffects.js → javascript/javascriptSemanticAsyncEffects.js} +2 -1
- package/dist/domain/{javascriptSemanticCallResolution.js → javascript/javascriptSemanticCallResolution.js} +10 -5
- package/dist/domain/{javascriptSemanticCalls.js → javascript/javascriptSemanticCalls.js} +7 -4
- package/dist/domain/{javascriptSemanticChildProcesses.js → javascript/javascriptSemanticChildProcesses.js} +4 -2
- package/dist/domain/{javascriptSemanticDataEffectHelpers.js → javascript/javascriptSemanticDataEffectHelpers.js} +7 -6
- package/dist/domain/{javascriptSemanticDataEffects.js → javascript/javascriptSemanticDataEffects.js} +8 -6
- package/dist/domain/{javascriptSemanticFingerprints.js → javascript/javascriptSemanticFingerprints.js} +40 -16
- package/dist/domain/{javascriptSemanticGraph.js → javascript/javascriptSemanticGraph.js} +2 -2
- package/dist/domain/{javascriptSemanticGraphSchemas.js → javascript/javascriptSemanticGraphSchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticMemberMutations.js +116 -0
- package/dist/domain/javascript/javascriptSemanticMutationValues.js +53 -0
- package/dist/domain/{javascriptSemanticObjects.js → javascript/javascriptSemanticObjects.js} +5 -5
- package/dist/domain/{javascriptSemanticPrimitives.js → javascript/javascriptSemanticPrimitives.js} +1 -1
- package/dist/domain/{javascriptSemanticProjection.js → javascript/javascriptSemanticProjection.js} +31 -44
- package/dist/domain/{javascriptSemanticPromises.js → javascript/javascriptSemanticPromises.js} +77 -22
- package/dist/domain/{javascriptSemanticProvenance.js → javascript/javascriptSemanticProvenance.js} +4 -1
- package/dist/domain/{javascriptSemanticQuery.js → javascript/javascriptSemanticQuery.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryAssessment.js → javascript/javascriptSemanticQueryAssessment.js} +1 -1
- package/dist/domain/{javascriptSemanticQueryIdentity.js → javascript/javascriptSemanticQueryIdentity.js} +1 -1
- package/dist/domain/{javascriptSemanticQuerySchemas.js → javascript/javascriptSemanticQuerySchemas.js} +3 -3
- package/dist/domain/javascript/javascriptSemanticRequireOrigin.js +25 -0
- package/dist/domain/{javascriptSemanticResources.js → javascript/javascriptSemanticResources.js} +2 -1
- package/dist/domain/{javascriptSemanticReturns.js → javascript/javascriptSemanticReturns.js} +1 -1
- package/dist/domain/{javascriptSemanticTraceSchemas.js → javascript/javascriptSemanticTraceSchemas.js} +2 -2
- package/dist/domain/javascript/javascriptSemanticTraversal.js +55 -0
- package/dist/domain/javascript/javascriptSemanticValueTypes.js +1 -0
- package/dist/domain/{javascriptSemanticValues.js → javascript/javascriptSemanticValues.js} +72 -48
- package/dist/domain/{javascriptStaticAnalysis.js → javascript/javascriptStaticAnalysis.js} +7 -4
- package/dist/domain/{javascriptStaticAnalysisBundler.js → javascript/javascriptStaticAnalysisBundler.js} +14 -11
- package/dist/domain/{javascriptStaticAnalysisCalls.js → javascript/javascriptStaticAnalysisCalls.js} +2 -2
- package/dist/domain/{javascriptStaticAnalysisHelpers.js → javascript/javascriptStaticAnalysisHelpers.js} +231 -40
- package/dist/domain/{sourceToBundleComparison.js → javascript/sourceToBundleComparison.js} +2 -2
- package/dist/domain/{sourceToBundleComparisonSchemas.js → javascript/sourceToBundleComparisonSchemas.js} +4 -4
- package/dist/domain/{sourceToBundleSignals.js → javascript/sourceToBundleSignals.js} +2 -2
- package/dist/domain/{managedApplicationGraph.js → managed/managedApplicationGraph.js} +4 -4
- package/dist/domain/{managedApplicationGraphNodes.js → managed/managedApplicationGraphNodes.js} +1 -1
- package/dist/domain/{managedArtifact.js → managed/managedArtifact.js} +1 -1
- package/dist/domain/{managedMemberComparison.js → managed/managedMemberComparison.js} +4 -4
- package/dist/domain/{managedMemberComparisonCoverage.js → managed/managedMemberComparisonCoverage.js} +2 -1
- package/dist/domain/{managedMemberComparisonItems.js → managed/managedMemberComparisonItems.js} +97 -40
- package/dist/domain/{managedMemberComparisonMatch.js → managed/managedMemberComparisonMatch.js} +22 -11
- package/dist/domain/{managedNativeVerification.js → managed/managedNativeVerification.js} +1 -1
- package/dist/domain/{managedNativeVerificationMatch.js → managed/managedNativeVerificationMatch.js} +3 -3
- package/dist/domain/{managedNativeVerificationSchemas.js → managed/managedNativeVerificationSchemas.js} +6 -5
- package/dist/domain/{managedReconstruction.js → managed/managedReconstruction.js} +3 -3
- package/dist/domain/{nativeFunctionAnnotations.js → native/nativeFunctionAnnotations.js} +1 -1
- package/dist/domain/{nativeInspection.js → native/nativeInspection.js} +1 -1
- package/dist/domain/{nativeInvestigationGraph.js → native/nativeInvestigationGraph.js} +13 -4
- package/dist/domain/{nativeLoadImage.js → native/nativeLoadImage.js} +1 -1
- package/dist/domain/{nativeUiObservation.js → native/nativeUiObservation.js} +20 -6
- package/dist/domain/{objcSwiftMetadata.js → native/objcSwiftMetadata.js} +17 -0
- package/dist/domain/processCapture.js +4 -2
- package/dist/domain/processScenario.js +17 -17
- package/dist/domain/propertyListKeys.js +69 -0
- package/dist/domain/providerCleanupError.js +5 -2
- package/dist/domain/reconstructionCoverageEvaluation.js +46 -24
- package/dist/domain/reconstructionCoverageInput.js +7 -0
- package/dist/domain/runtimeVersion.js +2 -0
- package/dist/domain/sourceMapEnvelope.js +38 -0
- package/dist/domain/unicodeCodePointOrder.js +11 -6
- package/dist/domain/webBundleAnalyzerAst.js +2 -34
- package/dist/domain/webBundleAnalyzerInspection.js +12 -9
- package/dist/domain/webEventListeners.js +28 -0
- package/dist/domain/webExecution.js +74 -0
- package/dist/domain/webMcpDiscovery.js +1 -7
- package/dist/domain/webModuleImports.js +104 -0
- package/dist/domain/webModuleTrace.js +106 -0
- package/dist/domain/webRuntime.js +69 -0
- package/dist/domain/webScreenshot.js +1 -7
- package/dist/domain/webScriptArtifacts.js +39 -0
- package/dist/domain/webScriptExport.js +86 -0
- package/dist/domain/webScriptExportError.js +13 -0
- package/dist/domain/webScriptExportPlan.js +108 -0
- package/dist/domain/webSourceLocation.js +106 -0
- package/dist/domain/webSourcePosition.js +21 -0
- package/dist/dotnet/ManagedArtifactInspector.js +1 -1
- package/dist/dotnet/ManagedMemberInspector.js +1 -1
- package/dist/dotnet/ManagedMemberInspectorCore.js +34 -0
- package/dist/dotnet/ManagedMemberRows.js +5 -3
- package/dist/dotnet/ManagedNativeBoundaryHelpers.js +22 -16
- package/dist/dotnet/ManagedNativeBoundaryInspector.js +56 -50
- package/dist/dotnet/ManagedStaticProvider.js +3 -33
- package/dist/dotnet/ManagedStaticProviderMetadata.js +36 -0
- package/dist/evaluation/CodexAgentEval.js +2 -1
- package/dist/firmware/FirmwareProvider.js +18 -12
- package/dist/firmware/FirmwarePublication.js +1 -1
- package/dist/firmware/FirmwareRelease.js +1 -1
- package/dist/firmware/FirmwareReports.js +12 -0
- package/dist/firmware/FirmwareVersion.js +80 -0
- package/dist/generatedMcpToolCatalog.js +1 -1
- package/dist/generatedPackageMetadata.js +2 -2
- package/dist/ghidra/GhidraFunctionValues.js +5 -5
- package/dist/ghidra/GhidraInstallation.js +38 -34
- package/dist/ghidra/GhidraInstallationPolicy.js +140 -0
- package/dist/ghidra/GhidraInventoryValues.js +1 -1
- package/dist/ghidra/GhidraLauncher.js +12 -4
- package/dist/ghidra/GhidraLoadImageAttest.js +36 -0
- package/dist/ghidra/GhidraLoadImageValues.js +1 -1
- package/dist/ghidra/GhidraProvider.js +15 -233
- package/dist/ghidra/GhidraProviderCapabilities.js +7 -14
- package/dist/ghidra/GhidraProviderClient.js +209 -0
- package/dist/ghidra/GhidraResponseBuffer.js +7 -1
- package/dist/ghidra/extensions/nativeaot/NativeAotReport.js +17 -1
- package/dist/hopper/HopperProvider.js +2 -48
- package/dist/hopper/HopperProviderCapabilities.js +73 -0
- package/dist/hopper/HopperResponseStream.js +7 -1
- package/dist/hopper/LinuxPrivateDisplayProbe.js +4 -4
- package/dist/ida/IdaProviderCapabilities.js +3 -11
- package/dist/ida/IdaSessionClient.js +12 -0
- package/dist/{browser → inspector}/JavaScriptRuntimeScope.js +16 -5
- package/dist/{browser → inspector}/V8InspectorCaptureProjection.js +46 -8
- package/dist/{browser → inspector}/V8InspectorEndpoint.js +1 -1
- package/dist/{browser → inspector}/V8InspectorProvider.js +10 -13
- package/dist/inspector/providerIdentity.js +6 -0
- package/dist/javascript/recovery/RecoveryFiles.js +122 -0
- package/dist/javascript/recovery/WakaruCommand.js +116 -0
- package/dist/javascript/recovery/WakaruExecution.js +100 -0
- package/dist/javascript/recovery/WakaruProvider.js +96 -0
- package/dist/javascript/recovery/WakaruPublication.js +102 -0
- package/dist/javascript/recovery/WakaruRelease.js +29 -0
- package/dist/javascript/recovery/WakaruReport.js +134 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProcess.js +37 -0
- package/dist/javascript/sourceMaps/SourceMapCodecProtocol.js +20 -0
- package/dist/javascript/sourceMaps/SourceMapCommand.js +176 -0
- package/dist/javascript/sourceMaps/SourceMapDecoder.js +61 -0
- package/dist/javascript/sourceMaps/SourceMapFormat.js +185 -0
- package/dist/javascript/sourceMaps/TraceSourceMap.js +138 -0
- package/dist/main/shutdown.js +8 -2
- package/dist/main/transport.js +24 -7
- package/dist/main.js +4 -18
- package/dist/native/AppleDispatchCoverage.js +58 -0
- package/dist/native/AppleDispatchMetadata.js +71 -509
- package/dist/native/AppleMachoFixups.js +292 -0
- package/dist/native/AppleMachoSelection.js +188 -0
- package/dist/native/AppleObjcCategories.js +59 -0
- package/dist/native/AppleObjcDispatchFacets.js +257 -0
- package/dist/native/AppleObjcProperties.js +68 -0
- package/dist/native/AppleObjcProtocols.js +2 -1
- package/dist/native/AppleSwiftDispatchFacets.js +150 -0
- package/dist/native/NativeMacOSProvider.js +132 -72
- package/dist/native/NativeMacOSProviderMetadata.js +42 -0
- package/dist/native/NativeMachoInspection.js +45 -14
- package/dist/native/NativeUiHelperRuntime.js +7 -3
- package/dist/native/NativeUiObservation.js +8 -4
- package/dist/native/NativeUiOutputBudget.js +8 -0
- package/dist/native/parsers/codesign.js +40 -5
- package/dist/native/parsers/demangle.js +6 -2
- package/dist/native/parsers/dyldInfo.js +13 -4
- package/dist/native/parsers/echoedPath.js +14 -0
- package/dist/native/parsers/lipo.js +14 -0
- package/dist/native/parsers/otool.js +1 -1
- package/dist/native/parsers/plist.js +174 -19
- package/dist/process/ExecFileOutput.js +2 -0
- package/dist/process/ProviderProcess.js +38 -17
- package/dist/reference/ReferenceSourceReaderEntries.js +6 -1
- package/dist/server/createServer.js +48 -6
- package/dist/server/mcpClientMetadata.js +6 -3
- package/dist/server/registerAndroidTools.js +1 -1
- package/dist/server/registerApplicationTools/compareExportShapes.js +2 -2
- package/dist/server/registerApplicationTools/compareSourceToBundle.js +2 -2
- package/dist/server/registerApplicationTools/compareVersions.js +2 -2
- package/dist/server/registerApplicationTools/projectMobileApplicationGraph.js +43 -0
- package/dist/server/registerApplicationTools/traceFeature.js +1 -1
- package/dist/server/registerApplicationTools/traceSemantics.js +1 -1
- package/dist/server/registerApplicationTools.js +2 -0
- package/dist/server/registerBrowserScenarioTool.js +6 -2
- package/dist/server/registerBrowserTools.js +13 -2
- package/dist/server/registerCloseLifecycleTool.js +1 -1
- package/dist/server/registerElectronTools.js +21 -7
- package/dist/server/registerJavaScriptRecoveryTool.js +17 -0
- package/dist/server/registerJavaScriptRuntimeObservationTools.js +9 -4
- package/dist/server/registerManagedTools.js +3 -3
- package/dist/server/registerManagedWorkflowTools/compareManagedMembers.js +2 -2
- package/dist/server/registerManagedWorkflowTools/contract.js +1 -1
- package/dist/server/registerManagedWorkflowTools/importManagedReconstruction.js +1 -1
- package/dist/server/registerManagedWorkflowTools/projectManagedApplicationGraph.js +1 -1
- package/dist/server/registerManagedWorkflowTools/verifyManagedNativeBoundaries.js +2 -2
- package/dist/server/registerNativeTools.js +1 -1
- package/dist/server/registerPrompts.js +5 -1
- package/dist/server/registerSessionTools.js +1 -1
- package/dist/server/registerWebModuleTool.js +17 -0
- package/dist/server/registerWebRuntimeTools.js +31 -0
- package/dist/server/registerWebScriptTool.js +18 -0
- package/dist/server/registerWebSourceLocationTool.js +17 -0
- package/dist/server/sessionAvailabilityPolicy.js +24 -12
- package/dist/windows/WindowsOwnedProcess.js +3 -1
- package/install.sh +12 -2
- package/native/windows/README.md +5 -0
- package/native/windows/build/manifest.json +2 -2
- package/native/windows/build/rea-windows-x64.node +0 -0
- package/package.json +40 -19
- package/scripts/hopper-demo-x11.py +67 -8
- package/scripts/rea.mjs +9 -1
- package/skills/reverse-engineer-anything/SKILL.md +3 -3
- package/skills/reverse-engineer-anything/references/android-applications.md +2 -2
- package/skills/reverse-engineer-anything/references/javascript-applications.md +1 -1
- package/skills/reverse-engineer-anything/references/native-and-artifacts.md +32 -23
- package/dist/application/runtime.js +0 -53
- package/dist/domain/appleApplication.js +0 -181
- package/dist/domain/javascriptAstValues.js +0 -13
- package/dist/domain/javascriptSemanticTraversal.js +0 -30
- package/dist/native/NativeHostCapabilities.js +0 -23
- /package/dist/application/{AndroidAnalysisPort.js → DirectAnalysisDependencies.js} +0 -0
- /package/dist/application/{BinarySessionPort.js → WebModulePorts.js} +0 -0
- /package/dist/application/{ElectronActiveObservationPort.js → WebRuntimePort.js} +0 -0
- /package/dist/application/{ElectronObservationPort.js → WebScriptArtifactPort.js} +0 -0
- /package/dist/application/{FirmwareAnalysisPort.js → WebSourceLocationPorts.js} +0 -0
- /package/dist/application/{JavaScriptArtifactAnalysisTypes.js → android/AndroidAnalysisPort.js} +0 -0
- /package/dist/application/{AbortablePromise.js → binary/AbortablePromise.js} +0 -0
- /package/dist/application/{JavaScriptRuntimeObservationPort.js → binary/BinarySessionPort.js} +0 -0
- /package/dist/application/{BinarySessionStatus.js → binary/BinarySessionStatus.js} +0 -0
- /package/dist/{domain/electronStaticAnalysisTypes.js → application/firmware/FirmwareAnalysisPort.js} +0 -0
- /package/dist/{domain/javascriptSemanticValueTypes.js → application/investigation/InvestigationRecordPort.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraph.js → javascript/ElectronBoundaryGraph.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphIpc.js → javascript/ElectronBoundaryGraphIpc.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphNative.js → javascript/ElectronBoundaryGraphNative.js} +0 -0
- /package/dist/application/{ElectronBoundaryGraphWindows.js → javascript/ElectronBoundaryGraphWindows.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphBundlers.js → javascript/JavaScriptArtifactGraphBundlers.js} +0 -0
- /package/dist/application/{JavaScriptArtifactGraphEvidence.js → javascript/JavaScriptArtifactGraphEvidence.js} +0 -0
- /package/dist/application/{JavaScriptArtifactReconstructionInput.js → javascript/JavaScriptArtifactReconstructionInput.js} +0 -0
- /package/dist/application/{JavaScriptSemanticGraphEvidence.js → javascript/JavaScriptSemanticGraphEvidence.js} +0 -0
- /package/dist/application/{JavaScriptSemanticGraphValueProjection.js → javascript/JavaScriptSemanticGraphValueProjection.js} +0 -0
- /package/dist/artifacts/{NibArchive.js → apple/NibArchive.js} +0 -0
- /package/dist/domain/{androidAnalysis.js → android/androidAnalysis.js} +0 -0
- /package/dist/domain/{electronActiveObservation.js → javascript/electronActiveObservation.js} +0 -0
- /package/dist/domain/{electronStaticAnalysis.js → javascript/electronStaticAnalysis.js} +0 -0
- /package/dist/domain/{javascriptExportShapeComparisonIdentity.js → javascript/javascriptExportShapeComparisonIdentity.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliation.js → javascript/javascriptRuntimeReconciliation.js} +0 -0
- /package/dist/domain/{javascriptRuntimeReconciliationRuntime.js → javascript/javascriptRuntimeReconciliationRuntime.js} +0 -0
- /package/dist/domain/{javascriptSemanticCoverage.js → javascript/javascriptSemanticCoverage.js} +0 -0
- /package/dist/domain/{javascriptSemanticDerivedAnalysis.js → javascript/javascriptSemanticDerivedAnalysis.js} +0 -0
- /package/dist/domain/{javascriptSemanticGraphSerialization.js → javascript/javascriptSemanticGraphSerialization.js} +0 -0
- /package/dist/domain/{javascriptSemanticIr.js → javascript/javascriptSemanticIr.js} +0 -0
- /package/dist/domain/{javascriptSemanticQueryRelations.js → javascript/javascriptSemanticQueryRelations.js} +0 -0
- /package/dist/domain/{javascriptSemanticState.js → javascript/javascriptSemanticState.js} +0 -0
- /package/dist/domain/{javascriptSourceParser.js → javascript/javascriptSourceParser.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisFindings.js → javascript/javascriptStaticAnalysisFindings.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisState.js → javascript/javascriptStaticAnalysisState.js} +0 -0
- /package/dist/domain/{javascriptStaticAnalysisTypes.js → javascript/javascriptStaticAnalysisTypes.js} +0 -0
- /package/dist/domain/{managedApplicationGraphCoverage.js → managed/managedApplicationGraphCoverage.js} +0 -0
- /package/dist/domain/{managedApplicationGraphNodeCoverage.js → managed/managedApplicationGraphNodeCoverage.js} +0 -0
- /package/dist/domain/{nativeApiBoundary.js → native/nativeApiBoundary.js} +0 -0
- /package/dist/domain/{nativeDataType.js → native/nativeDataType.js} +0 -0
- /package/dist/domain/{nativeInstruction.js → native/nativeInstruction.js} +0 -0
- /package/dist/domain/{nativeMetadataRecovery.js → native/nativeMetadataRecovery.js} +0 -0
- /package/dist/domain/{nativeValueFlow.js → native/nativeValueFlow.js} +0 -0
- /package/dist/domain/{nativeValueTrace.js → native/nativeValueTrace.js} +0 -0
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { chmod, copyFile } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
2
5
|
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
|
3
|
-
import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisOutputError, AnalysisTimeoutError, } from "../domain/analysisErrorCore.js";
|
|
6
|
+
import { AnalysisCancelledError, AnalysisCapabilityUnavailableError, AnalysisOutputError, AnalysisInputError, AnalysisTimeoutError, } from "../domain/analysisErrorCore.js";
|
|
4
7
|
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
|
|
5
8
|
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
|
|
6
9
|
import { err, ok } from "../domain/result.js";
|
|
7
10
|
import { PrivateRuntimeRoot } from "../process/PrivateRuntimeRoot.js";
|
|
8
|
-
import { snapshotAndroidEngine, snapshotAndroidTarget, } from "./AndroidTargetSnapshot.js";
|
|
11
|
+
import { snapshotAndroidEngine, hashAndroidFile, snapshotAndroidTarget, } from "./AndroidTargetSnapshot.js";
|
|
9
12
|
import { resolveJadxConfiguration } from "./JadxConfiguration.js";
|
|
10
13
|
import { JadxSession } from "./JadxSession.js";
|
|
11
14
|
const OPERATION_TIMEOUT_MS = 120_000;
|
|
15
|
+
const BRIDGE_SOURCE = fileURLToPath(new URL("../../bridge/android/ReaJadxBridge.java", import.meta.url));
|
|
12
16
|
const waitForTurn = (predecessor, request, signal) => new Promise((resolve, reject) => {
|
|
13
17
|
const abort = () => reject(new AnalysisCancelledError(request.operation));
|
|
14
18
|
signal?.addEventListener("abort", abort, { once: true });
|
|
@@ -75,44 +79,81 @@ const cleanup = async (session, root, previous) => {
|
|
|
75
79
|
}
|
|
76
80
|
return previous;
|
|
77
81
|
};
|
|
78
|
-
/** One
|
|
82
|
+
/** One serialized, immutable APK session per REA instance, retired on idle or shutdown. */
|
|
79
83
|
export class JadxProvider {
|
|
80
84
|
environment;
|
|
81
85
|
launcher;
|
|
82
86
|
#tail = Promise.resolve();
|
|
83
87
|
#cleanupFailure;
|
|
88
|
+
#retained;
|
|
89
|
+
#idle;
|
|
90
|
+
#shutdown = new AbortController();
|
|
91
|
+
#closePromise;
|
|
84
92
|
constructor(environment = process.env, launcher) {
|
|
85
93
|
this.environment = environment;
|
|
86
94
|
this.launcher = launcher;
|
|
87
95
|
}
|
|
88
96
|
/** Serialize expensive work and bind both raw and normalized results to the APK. */
|
|
89
97
|
async execute(target, request, options) {
|
|
98
|
+
if (this.#shutdown.signal.aborted)
|
|
99
|
+
return err(new AnalysisCancelledError(request.operation));
|
|
100
|
+
const signal = options?.signal === undefined
|
|
101
|
+
? this.#shutdown.signal
|
|
102
|
+
: AbortSignal.any([options.signal, this.#shutdown.signal]);
|
|
90
103
|
const predecessor = this.#tail;
|
|
91
104
|
let release = () => { };
|
|
92
105
|
this.#tail = new Promise((resolve) => {
|
|
93
106
|
release = resolve;
|
|
94
107
|
});
|
|
95
108
|
try {
|
|
96
|
-
await waitForTurn(predecessor, request,
|
|
109
|
+
await waitForTurn(predecessor, request, signal);
|
|
97
110
|
}
|
|
98
111
|
catch {
|
|
99
112
|
void predecessor.then(release);
|
|
100
113
|
return err(new AnalysisCancelledError(request.operation));
|
|
101
114
|
}
|
|
102
115
|
try {
|
|
103
|
-
if (
|
|
116
|
+
if (signal.aborted)
|
|
104
117
|
return err(new AnalysisCancelledError(request.operation));
|
|
105
118
|
if (this.#cleanupFailure !== undefined)
|
|
106
119
|
return err(this.#cleanupFailure);
|
|
107
|
-
|
|
120
|
+
clearTimeout(this.#idle);
|
|
121
|
+
const outcome = await this.#execute(target, request, { signal });
|
|
108
122
|
if (!outcome.ok && outcome.error.cleanupIncomplete)
|
|
109
123
|
this.#cleanupFailure = outcome.error;
|
|
124
|
+
if (outcome.ok)
|
|
125
|
+
this.#scheduleIdle();
|
|
110
126
|
return outcome;
|
|
111
127
|
}
|
|
112
128
|
finally {
|
|
113
129
|
release();
|
|
114
130
|
}
|
|
115
131
|
}
|
|
132
|
+
/** Cancel queued/active operations and join the owned engine and workspace cleanup. */
|
|
133
|
+
close() {
|
|
134
|
+
this.#shutdown.abort();
|
|
135
|
+
clearTimeout(this.#idle);
|
|
136
|
+
this.#closePromise ??= this.#tail.then(() => this.#retire());
|
|
137
|
+
return this.#closePromise;
|
|
138
|
+
}
|
|
139
|
+
async #retire() {
|
|
140
|
+
if (this.#cleanupFailure !== undefined)
|
|
141
|
+
throw this.#cleanupFailure;
|
|
142
|
+
const retained = this.#retained;
|
|
143
|
+
this.#retained = undefined;
|
|
144
|
+
const result = await cleanup(retained?.session, retained?.root, ok(undefined));
|
|
145
|
+
if (!result.ok) {
|
|
146
|
+
this.#cleanupFailure = result.error;
|
|
147
|
+
throw result.error;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
#scheduleIdle() {
|
|
151
|
+
this.#idle = setTimeout(() => {
|
|
152
|
+
const retirement = this.#tail.then(() => this.#retire());
|
|
153
|
+
this.#tail = retirement.catch(() => undefined);
|
|
154
|
+
}, 60_000);
|
|
155
|
+
this.#idle.unref();
|
|
156
|
+
}
|
|
116
157
|
async #execute(target, request, options) {
|
|
117
158
|
const timeout = AbortSignal.timeout(OPERATION_TIMEOUT_MS);
|
|
118
159
|
const signal = options?.signal === undefined
|
|
@@ -126,35 +167,79 @@ export class JadxProvider {
|
|
|
126
167
|
throw new AnalysisCapabilityUnavailableError("jadx", request.operation, `Target ${target.path} is ${target.format}; provide one standalone APK.`);
|
|
127
168
|
const configuration = await resolveJadxConfiguration(this.environment, request.operation);
|
|
128
169
|
signal.throwIfAborted();
|
|
129
|
-
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
170
|
+
const jarHash = await hashAndroidFile(configuration.jar);
|
|
171
|
+
const bridgeHash = await hashAndroidFile(BRIDGE_SOURCE);
|
|
172
|
+
if ((await hashAndroidFile(target.path)) !== target.sha256)
|
|
173
|
+
throw new AnalysisInputError(request.operation, undefined, [
|
|
174
|
+
{
|
|
175
|
+
path: ["path"],
|
|
176
|
+
reason: "invalid_value",
|
|
177
|
+
message: "APK bytes changed after admission; retry against a stable file.",
|
|
178
|
+
},
|
|
179
|
+
]);
|
|
180
|
+
const key = JSON.stringify({
|
|
181
|
+
path: target.path,
|
|
182
|
+
sha256: target.sha256,
|
|
183
|
+
jar: configuration.jar,
|
|
184
|
+
jarHash,
|
|
185
|
+
bridgeHash,
|
|
186
|
+
java: configuration.java,
|
|
187
|
+
arguments: configuration.jvmArguments,
|
|
188
|
+
options: [
|
|
189
|
+
this.environment.JAVA_TOOL_OPTIONS,
|
|
190
|
+
this.environment._JAVA_OPTIONS,
|
|
191
|
+
this.environment.JDK_JAVA_OPTIONS,
|
|
192
|
+
this.environment.PATH,
|
|
193
|
+
this.environment.JAVA_HOME,
|
|
146
194
|
],
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
195
|
+
});
|
|
196
|
+
if (this.#retained !== undefined && this.#retained.key !== key)
|
|
197
|
+
await this.#retire();
|
|
198
|
+
let retained = this.#retained;
|
|
199
|
+
if (retained === undefined) {
|
|
200
|
+
root = await PrivateRuntimeRoot.create({ prefix: "rea-android-" });
|
|
201
|
+
const engine = await snapshotAndroidEngine(configuration.jar, jarHash, root.path, request.operation);
|
|
202
|
+
const snapshot = await snapshotAndroidTarget(target.path, target.sha256, root.path, request.operation);
|
|
203
|
+
const bridge = join(root.path, "ReaJadxBridge.java");
|
|
204
|
+
await copyFile(BRIDGE_SOURCE, bridge);
|
|
205
|
+
await chmod(bridge, 0o400);
|
|
206
|
+
if ((await hashAndroidFile(bridge)) !== bridgeHash)
|
|
207
|
+
throw new AnalysisCapabilityUnavailableError("jadx", request.operation, "REA Android bridge bytes changed during admission; retry with a stable installation.");
|
|
208
|
+
signal.throwIfAborted();
|
|
209
|
+
session = new JadxSession({
|
|
210
|
+
command: configuration.java,
|
|
211
|
+
arguments: [
|
|
212
|
+
...configuration.jvmArguments,
|
|
213
|
+
"--class-path",
|
|
214
|
+
engine.path,
|
|
215
|
+
bridge,
|
|
216
|
+
],
|
|
217
|
+
cwd: root.path,
|
|
218
|
+
hostEnvironment: this.environment,
|
|
219
|
+
}, this.launcher);
|
|
220
|
+
retained = {
|
|
221
|
+
key,
|
|
222
|
+
root,
|
|
223
|
+
session,
|
|
224
|
+
snapshot,
|
|
225
|
+
jarHash: engine.sha256,
|
|
226
|
+
bridgeHash,
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
root = retained.root;
|
|
230
|
+
session = retained.session;
|
|
231
|
+
const { snapshot } = retained;
|
|
151
232
|
outcome = ok(await session.execute({
|
|
152
233
|
request,
|
|
153
234
|
target,
|
|
154
235
|
snapshot,
|
|
155
|
-
jarHash:
|
|
236
|
+
jarHash: retained.jarHash,
|
|
237
|
+
bridgeHash: retained.bridgeHash,
|
|
156
238
|
signal,
|
|
157
239
|
}));
|
|
240
|
+
signal.throwIfAborted();
|
|
241
|
+
this.#retained = retained;
|
|
242
|
+
return outcome;
|
|
158
243
|
}
|
|
159
244
|
catch (cause) {
|
|
160
245
|
outcome = err(executionError({
|
|
@@ -165,6 +250,10 @@ export class JadxProvider {
|
|
|
165
250
|
session,
|
|
166
251
|
}));
|
|
167
252
|
}
|
|
253
|
+
// An existing session also needs retirement when admission fails before selection.
|
|
254
|
+
root ??= this.#retained?.root;
|
|
255
|
+
session ??= this.#retained?.session;
|
|
256
|
+
this.#retained = undefined;
|
|
168
257
|
return cleanup(session, root, outcome);
|
|
169
258
|
}
|
|
170
259
|
}
|
|
@@ -5,6 +5,13 @@ export const JADX_RELEASE = Object.freeze({
|
|
|
5
5
|
sha256: "6e5eacf500b64292bfb73c49797c1958f6ee44646e43e868039ae7feb573ff75",
|
|
6
6
|
url: "https://github.com/1013503897/jadx-headless-mcp/releases/download/v0.7.1/jadx-headless-mcp-0.7.1-all.jar",
|
|
7
7
|
});
|
|
8
|
+
/** Identity of REA's metadata bridge, distinct from the producing engine. */
|
|
9
|
+
export const JADX_BRIDGE_IDENTITY = Object.freeze({
|
|
10
|
+
name: "rea-jadx-bridge",
|
|
11
|
+
version: "1",
|
|
12
|
+
});
|
|
13
|
+
/** Remediation when `REA_JADX_MCP_JAR` is missing or not an absolute path. */
|
|
14
|
+
export const JADX_JAR_CONFIGURATION_REMEDIATION = `Set REA_JADX_MCP_JAR to the absolute path of a caller-supplied jadx-headless-mcp ${JADX_RELEASE.version} JAR. REA does not download or install it.`;
|
|
8
15
|
/** Producing engine identity used by Evidence and the generated product catalog. */
|
|
9
16
|
export const JADX_PROVIDER_IDENTITY = Object.freeze({
|
|
10
17
|
id: "jadx",
|
|
@@ -15,5 +22,6 @@ export const JADX_PROVIDER_IDENTITY = Object.freeze({
|
|
|
15
22
|
export const JADX_LIMITATIONS = [
|
|
16
23
|
"Static decompiler observations do not establish runtime behavior; the APK is never executed.",
|
|
17
24
|
"Method signatures use provider display types; exact DEX descriptors and instruction offsets are unavailable. Overload indices are local to this engine and artifact.",
|
|
25
|
+
"Class inventories use parsed metadata before code generation, including synthetic members that may be omitted from decompiled source. Source positions remain unknown.",
|
|
18
26
|
"Manifest summary fields are extracted by the upstream engine; decoded XML is retained for verification. APK signatures, split APKs, native libraries and Android runtime capture are not verified by this provider.",
|
|
19
27
|
];
|
|
@@ -5,13 +5,13 @@ import { jsonValueSchema } from "../domain/jsonValue.js";
|
|
|
5
5
|
import { ProviderAdapterError } from "../domain/providerAdapterError.js";
|
|
6
6
|
import { analyzeJadxRequest } from "./JadxAnalysis.js";
|
|
7
7
|
import { JadxMcpTransport } from "./JadxMcpTransport.js";
|
|
8
|
-
import { jadxLoadSchema, parseJadxEnvelope, parseJadxJson, } from "./JadxProtocol.js";
|
|
9
|
-
import { JADX_RELEASE, JADX_PROVIDER_IDENTITY, JADX_LIMITATIONS, } from "./JadxRelease.js";
|
|
8
|
+
import { jadxLoadSchema, jadxRuntimeSchema, parseJadxEnvelope, parseJadxJson, } from "./JadxProtocol.js";
|
|
9
|
+
import { JADX_BRIDGE_IDENTITY, JADX_RELEASE, JADX_PROVIDER_IDENTITY, JADX_LIMITATIONS, } from "./JadxRelease.js";
|
|
10
10
|
/** One owned engine connection; its wire protocol stays inside the Android adapter. */
|
|
11
11
|
export class JadxSession {
|
|
12
12
|
transport;
|
|
13
13
|
#client = new Client({ name: "rea-android-adapter", version: "1" });
|
|
14
|
-
#
|
|
14
|
+
#loaded;
|
|
15
15
|
constructor(options, launcher) {
|
|
16
16
|
this.transport = new JadxMcpTransport(options, launcher);
|
|
17
17
|
}
|
|
@@ -24,30 +24,44 @@ export class JadxSession {
|
|
|
24
24
|
signal.addEventListener("abort", abort, { once: true });
|
|
25
25
|
try {
|
|
26
26
|
signal.throwIfAborted();
|
|
27
|
-
|
|
27
|
+
this.transport.beginOperation();
|
|
28
|
+
const raw = [];
|
|
29
|
+
if (this.#loaded === undefined)
|
|
30
|
+
await this.#client.connect(this.transport, { timeout: 30_000 });
|
|
28
31
|
const server = this.#client.getServerVersion();
|
|
29
|
-
if (server?.name !==
|
|
30
|
-
server.version !==
|
|
31
|
-
throw new AnalysisCapabilityUnavailableError("jadx", request.operation, `Expected
|
|
32
|
-
const tools = this.#tools(request, target, signal);
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
if (server?.name !== JADX_BRIDGE_IDENTITY.name ||
|
|
33
|
+
server.version !== JADX_BRIDGE_IDENTITY.version)
|
|
34
|
+
throw new AnalysisCapabilityUnavailableError("jadx", request.operation, `Expected ${JADX_BRIDGE_IDENTITY.name} ${JADX_BRIDGE_IDENTITY.version}; server reported ${server?.name ?? "unknown"} ${server?.version ?? "unknown"}.`);
|
|
35
|
+
const tools = this.#tools(request, target, signal, raw);
|
|
36
|
+
const runtime = jadxRuntimeSchema.parse(await tools.json("rea_jvm_status", {}));
|
|
37
|
+
if (runtime.engine_reported_version !== JADX_RELEASE.version)
|
|
38
|
+
throw new AnalysisCapabilityUnavailableError("jadx", request.operation, `Expected engine ${JADX_RELEASE.version}; JAR reported ${runtime.engine_reported_version}.`);
|
|
39
|
+
const loaded = this.#loaded ??
|
|
40
|
+
jadxLoadSchema.parse(await tools.json("load_apk", {
|
|
41
|
+
path: snapshot,
|
|
42
|
+
threads: 1,
|
|
43
|
+
resources: "full",
|
|
44
|
+
}));
|
|
38
45
|
if (loaded.apk_path !== snapshot)
|
|
39
46
|
throw new AnalysisOutputError(request.operation, "JADX loaded a different APK path than the admitted snapshot");
|
|
47
|
+
this.#loaded = loaded;
|
|
40
48
|
const engine = {
|
|
41
49
|
name: "jadx-headless-mcp",
|
|
42
|
-
version:
|
|
50
|
+
version: runtime.engine_reported_version,
|
|
43
51
|
artifact_sha256: jarHash,
|
|
44
52
|
source_revision: jarHash === JADX_RELEASE.sha256 ? JADX_RELEASE.revision : null,
|
|
45
53
|
worker_count: 1,
|
|
46
|
-
heap_limit_mib:
|
|
54
|
+
heap_limit_mib: Math.floor(runtime.max_heap_bytes / (1024 * 1024)) || null,
|
|
47
55
|
};
|
|
48
56
|
const result = await analyzeJadxRequest(tools, request, loaded, engine);
|
|
49
57
|
return createAnalysisExecution(result, JADX_PROVIDER_IDENTITY, {
|
|
50
|
-
rawResult: {
|
|
58
|
+
rawResult: {
|
|
59
|
+
server,
|
|
60
|
+
bridge_sha256: context.bridgeHash,
|
|
61
|
+
jar_sha256: jarHash,
|
|
62
|
+
loaded,
|
|
63
|
+
calls: raw,
|
|
64
|
+
},
|
|
51
65
|
subject: target,
|
|
52
66
|
limitations: JADX_LIMITATIONS,
|
|
53
67
|
locations: request.operation === "inspect_android_package"
|
|
@@ -68,12 +82,12 @@ export class JadxSession {
|
|
|
68
82
|
await this.transport.close();
|
|
69
83
|
}
|
|
70
84
|
}
|
|
71
|
-
#tools(request, target, signal) {
|
|
85
|
+
#tools(request, target, signal, raw) {
|
|
72
86
|
const call = async (name, input) => {
|
|
73
87
|
signal.throwIfAborted();
|
|
74
88
|
const response = await this.#client.callTool({ name, arguments: input }, { timeout: 120_000, signal });
|
|
75
89
|
const envelope = parseJadxEnvelope(response, request.operation);
|
|
76
|
-
|
|
90
|
+
raw.push({
|
|
77
91
|
operation: name,
|
|
78
92
|
input,
|
|
79
93
|
response: jsonValueSchema.parse(response),
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
import { lstat, readdir, readFile, realpath, stat } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { promisify } from "node:util";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { BinaryTargetError } from "../domain/configurationErrors.js";
|
|
7
|
+
import { isPathWithinRoot } from "../domain/localPath.js";
|
|
8
|
+
import { parseXmlPropertyList } from "../domain/propertyListKeys.js";
|
|
9
|
+
import { err, ok } from "../domain/result.js";
|
|
10
|
+
const execFileAsync = promisify(execFile);
|
|
11
|
+
const BUNDLE_LAYOUTS = [
|
|
12
|
+
// macOS bundles keep both under Contents.
|
|
13
|
+
{
|
|
14
|
+
plist: ["Contents", "Info.plist"],
|
|
15
|
+
programs: ["Contents", "MacOS"],
|
|
16
|
+
programsLabel: "Contents/MacOS",
|
|
17
|
+
},
|
|
18
|
+
// iOS-style bundles, as extracted from an IPA, keep both at the root.
|
|
19
|
+
{ plist: ["Info.plist"], programs: [], programsLabel: "the bundle root" },
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* Resolve an app bundle directory to its declared program file. macOS and
|
|
23
|
+
* flat iOS-style layouts are read directly. An iOS app installed on a Mac is
|
|
24
|
+
* a wrapper whose `Wrapper` directory holds the iOS bundle; that bundle is
|
|
25
|
+
* found by listing `Wrapper`, never by following the `WrappedBundle` link.
|
|
26
|
+
*/
|
|
27
|
+
export const resolveAppBundleExecutable = async (path) => {
|
|
28
|
+
const layout = await presentLayout(path);
|
|
29
|
+
if (layout !== undefined)
|
|
30
|
+
return resolveLayoutExecutable(path, layout);
|
|
31
|
+
const wrapped = await wrappedBundle(path);
|
|
32
|
+
if (wrapped !== undefined) {
|
|
33
|
+
const wrappedLayout = await presentLayout(wrapped);
|
|
34
|
+
if (wrappedLayout !== undefined)
|
|
35
|
+
return resolveLayoutExecutable(wrapped, wrappedLayout);
|
|
36
|
+
}
|
|
37
|
+
return err(new BinaryTargetError(path, "app has no readable CFBundleExecutable", {
|
|
38
|
+
cause: new Error("No Contents/Info.plist, root Info.plist, or single Wrapper/*.app bundle was found"),
|
|
39
|
+
}));
|
|
40
|
+
};
|
|
41
|
+
const presentLayout = async (bundle) => {
|
|
42
|
+
for (const layout of BUNDLE_LAYOUTS)
|
|
43
|
+
if (await layoutPlistPresent(join(bundle, ...layout.plist)))
|
|
44
|
+
return layout;
|
|
45
|
+
return undefined;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Whether a layout's Info.plist exists. Readable symlinks count, as they did
|
|
49
|
+
* when the plist was read directly; any failure other than absence, such as
|
|
50
|
+
* a permission denial, is left for the caller to report.
|
|
51
|
+
*/
|
|
52
|
+
const layoutPlistPresent = async (path) => {
|
|
53
|
+
try {
|
|
54
|
+
return (await stat(path)).isFile();
|
|
55
|
+
}
|
|
56
|
+
catch (cause) {
|
|
57
|
+
if (isAbsence(cause))
|
|
58
|
+
return false;
|
|
59
|
+
throw cause;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const isAbsence = (cause) => {
|
|
63
|
+
const code = cause instanceof Error ? Reflect.get(cause, "code") : undefined;
|
|
64
|
+
return code === "ENOENT" || code === "ENOTDIR";
|
|
65
|
+
};
|
|
66
|
+
/** The single real `.app` directory inside an iOS-on-Mac `Wrapper`. */
|
|
67
|
+
const wrappedBundle = async (bundle) => {
|
|
68
|
+
const wrapper = join(bundle, "Wrapper");
|
|
69
|
+
try {
|
|
70
|
+
if (!(await lstat(wrapper)).isDirectory())
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
catch (cause) {
|
|
74
|
+
if (isAbsence(cause))
|
|
75
|
+
return undefined;
|
|
76
|
+
throw cause;
|
|
77
|
+
}
|
|
78
|
+
const apps = (await readdir(wrapper, { withFileTypes: true })).filter((entry) => entry.isDirectory() && entry.name.toLowerCase().endsWith(".app"));
|
|
79
|
+
const [app] = apps;
|
|
80
|
+
return apps.length === 1 && app !== undefined
|
|
81
|
+
? join(wrapper, app.name)
|
|
82
|
+
: undefined;
|
|
83
|
+
};
|
|
84
|
+
const resolveLayoutExecutable = async (bundle, layout) => {
|
|
85
|
+
const plistPath = join(bundle, ...layout.plist);
|
|
86
|
+
let name;
|
|
87
|
+
try {
|
|
88
|
+
const plist = await readFile(plistPath);
|
|
89
|
+
name =
|
|
90
|
+
plist.subarray(0, 6).toString("ascii") === "bplist"
|
|
91
|
+
? await readBinaryPlistExecutable(plistPath)
|
|
92
|
+
: parseXmlPlistExecutable(plist.toString("utf8"));
|
|
93
|
+
}
|
|
94
|
+
catch (cause) {
|
|
95
|
+
return err(new BinaryTargetError(bundle, "app has no readable CFBundleExecutable", {
|
|
96
|
+
cause,
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
if (!isSafeExecutableName(name))
|
|
100
|
+
return err(new BinaryTargetError(bundle, "app has an unsafe CFBundleExecutable"));
|
|
101
|
+
const programs = join(bundle, ...layout.programs);
|
|
102
|
+
const executable = join(programs, name);
|
|
103
|
+
try {
|
|
104
|
+
const [canonicalPrograms, canonicalExecutable] = await Promise.all([
|
|
105
|
+
realpath(programs),
|
|
106
|
+
realpath(executable),
|
|
107
|
+
]);
|
|
108
|
+
if (!isPathWithinRoot(canonicalPrograms, canonicalExecutable))
|
|
109
|
+
return err(new BinaryTargetError(bundle, `app program file leaves ${layout.programsLabel}`));
|
|
110
|
+
return ok({ executable: canonicalExecutable, infoPlist: plistPath });
|
|
111
|
+
}
|
|
112
|
+
catch (cause) {
|
|
113
|
+
return err(new BinaryTargetError(bundle, "app program file is missing", { cause }));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
/** Decode the top-level executable name with an XML parser, not a pattern. */
|
|
117
|
+
const parseXmlPlistExecutable = (plist) => {
|
|
118
|
+
// An unrelated `__proto__` entry must not make the bundle unreadable.
|
|
119
|
+
const { value } = parseXmlPropertyList(plist);
|
|
120
|
+
const executable = executableEntrySchema.safeParse(value);
|
|
121
|
+
if (!executable.success)
|
|
122
|
+
throw new Error("CFBundleExecutable is missing");
|
|
123
|
+
return executable.data.CFBundleExecutable;
|
|
124
|
+
};
|
|
125
|
+
const executableEntrySchema = z.looseObject({ CFBundleExecutable: z.string() });
|
|
126
|
+
const readBinaryPlistExecutable = async (plistPath) =>
|
|
127
|
+
// `-n` strips only the newline plutil appends; it requires macOS 12+.
|
|
128
|
+
(await execFileAsync("/usr/bin/plutil", [
|
|
129
|
+
"-extract",
|
|
130
|
+
"CFBundleExecutable",
|
|
131
|
+
"raw",
|
|
132
|
+
"-n",
|
|
133
|
+
"-o",
|
|
134
|
+
"-",
|
|
135
|
+
plistPath,
|
|
136
|
+
])).stdout;
|
|
137
|
+
const isSafeExecutableName = (name) => name.length > 0 &&
|
|
138
|
+
name !== "." &&
|
|
139
|
+
name !== ".." &&
|
|
140
|
+
!name.includes("\0") &&
|
|
141
|
+
!/[/\\]/u.test(name);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { open } from "node:fs/promises";
|
|
2
2
|
import { classifyArtifactContent } from "../ArtifactGraphConstruction.js";
|
|
3
|
-
import { ARTIFACT_CLASSIFICATION_PREFIX_BYTES } from "
|
|
3
|
+
import { ARTIFACT_CLASSIFICATION_PREFIX_BYTES } from "../../artifacts/ArtifactHash.js";
|
|
4
4
|
import { hasZipSignature, zipPackageFormatForPath, } from "../../domain/zipPackageFormat.js";
|
|
5
5
|
const classifyContainerExtension = (path) => {
|
|
6
6
|
const lower = path.toLowerCase();
|
|
@@ -5,7 +5,7 @@ import { artifactInventoryResultSchema, } from "../../domain/artifactGraph.js";
|
|
|
5
5
|
import { createArtifactEdges, createRootNode, indexOccurrencesByPath, materializeDirectoryNodes, rekeyOccurrences, rootOccurrenceFor, } from "../ArtifactGraphConstruction.js";
|
|
6
6
|
import { canonicalDigest } from "../../domain/comparisonSemantics.js";
|
|
7
7
|
import { classifyRoot } from "./classify.js";
|
|
8
|
-
import { hashReadable } from "
|
|
8
|
+
import { hashReadable } from "../../artifacts/ArtifactHash.js";
|
|
9
9
|
import { createReader, inventoryLimitations } from "./reader.js";
|
|
10
10
|
import { scanReader, } from "./scanReader.js";
|
|
11
11
|
import { STRICT_INTEGRITY_POLICY, } from "./types.js";
|
|
@@ -4,7 +4,7 @@ import { ArtifactReaderFailure, } from "../../artifacts/ArtifactReader.js";
|
|
|
4
4
|
import { AsarArtifactReader } from "../../artifacts/AsarArtifactReader.js";
|
|
5
5
|
import { classifyArtifactContent, createArtifactNode, createOccurrence, nearestParent, } from "../ArtifactGraphConstruction.js";
|
|
6
6
|
import { STRICT_INTEGRITY_POLICY, } from "./types.js";
|
|
7
|
-
import { hashReadable } from "
|
|
7
|
+
import { hashReadable } from "../../artifacts/ArtifactHash.js";
|
|
8
8
|
const UNAVAILABLE_UNPACKED_LIMITATION = "ASAR unpacked companion bytes were unavailable; no content hash or child artifact was produced.";
|
|
9
9
|
const emptyScan = () => ({ nodes: new Map(), occurrences: [], pendingContradictions: [] });
|
|
10
10
|
export const scanReader = async (reader, signal, integrity = STRICT_INTEGRITY_POLICY) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { realpath } from "node:fs/promises";
|
|
2
2
|
import { artifactInventoryResultSchema, } from "../domain/artifactGraph.js";
|
|
3
|
-
import { abortIfNeeded } from "
|
|
3
|
+
import { abortIfNeeded } from "../artifacts/ArtifactHash.js";
|
|
4
4
|
import { scanCanonicalArtifactInventory } from "./ArtifactInventory/scanCanonical.js";
|
|
5
5
|
export { scanCanonicalArtifactInventory } from "./ArtifactInventory/scanCanonical.js";
|
|
6
6
|
/** Inventory one local artifact and return every graph collection inline. */
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { constants } from "node:fs";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
import { access, open,
|
|
4
|
-
import {
|
|
5
|
-
import { extname, isAbsolute, join, resolve } from "node:path";
|
|
6
|
-
import { promisify } from "node:util";
|
|
7
|
-
import { isPathWithinRoot } from "../domain/localPath.js";
|
|
3
|
+
import { access, open, realpath, stat, } from "node:fs/promises";
|
|
4
|
+
import { extname, isAbsolute, resolve } from "node:path";
|
|
8
5
|
import { BinaryTargetError } from "../domain/configurationErrors.js";
|
|
9
6
|
import { err, ok } from "../domain/result.js";
|
|
7
|
+
import { resolveAppBundleExecutable, } from "./AppBundleExecutable.js";
|
|
10
8
|
import { validateDosComLength, } from "../domain/dosCom.js";
|
|
11
9
|
import { mzWindowsHeaderOffset } from "../domain/dosMz.js";
|
|
12
10
|
import { hasZipSignature, zipPackageFormatForPath, } from "../domain/zipPackageFormat.js";
|
|
13
11
|
import { parseExecutableHeader, parsePeRecord, } from "../domain/binaryTarget.js";
|
|
14
|
-
const execFileAsync = promisify(execFile);
|
|
15
12
|
/**
|
|
16
13
|
* Resolve and classify a readable local target before a provider is selected.
|
|
17
14
|
* FAT Mach-O inputs select only a host-compatible architecture so setup remains
|
|
@@ -25,7 +22,8 @@ export const parseBinaryTarget = async (input, cwd = process.cwd(), hostArchitec
|
|
|
25
22
|
const resolved = await resolveAppBundle(canonical);
|
|
26
23
|
if (!resolved.ok)
|
|
27
24
|
return err(resolved.error);
|
|
28
|
-
const path = resolved.value;
|
|
25
|
+
const { executable: path, infoPlist } = resolved.value;
|
|
26
|
+
const bundle = infoPlist === undefined ? {} : { bundleInfoPlist: infoPlist };
|
|
29
27
|
const handle = await open(path, "r");
|
|
30
28
|
try {
|
|
31
29
|
if (!(await handle.stat()).isFile())
|
|
@@ -72,6 +70,7 @@ export const parseBinaryTarget = async (input, cwd = process.cwd(), hostArchitec
|
|
|
72
70
|
return ok({
|
|
73
71
|
path,
|
|
74
72
|
sourcePath: process.platform === "win32" ? candidate : canonical,
|
|
73
|
+
...bundle,
|
|
75
74
|
sha256: await sha256Handle(handle),
|
|
76
75
|
kind: "executable",
|
|
77
76
|
...detected.value,
|
|
@@ -159,67 +158,13 @@ const sha256Handle = async (handle) => {
|
|
|
159
158
|
const resolveAppBundle = async (path) => {
|
|
160
159
|
const metadata = await stat(path);
|
|
161
160
|
if (!metadata.isDirectory())
|
|
162
|
-
return ok(path);
|
|
161
|
+
return ok({ executable: path });
|
|
163
162
|
if (extname(path).toLowerCase() !== ".app")
|
|
164
|
-
return err(new BinaryTargetError(path, "this opening route requires a file or
|
|
163
|
+
return err(new BinaryTargetError(path, "this opening route requires a file or app bundle", {
|
|
165
164
|
constraint: "directory_requires_file",
|
|
166
165
|
}));
|
|
167
|
-
|
|
168
|
-
let name;
|
|
169
|
-
try {
|
|
170
|
-
const plist = await readFile(plistPath);
|
|
171
|
-
name =
|
|
172
|
-
plist.subarray(0, 6).toString("ascii") === "bplist"
|
|
173
|
-
? await readBinaryPlistExecutable(plistPath)
|
|
174
|
-
: parseXmlPlistExecutable(plist.toString("utf8"));
|
|
175
|
-
}
|
|
176
|
-
catch (cause) {
|
|
177
|
-
return err(new BinaryTargetError(path, "app has no readable CFBundleExecutable", {
|
|
178
|
-
cause,
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
if (!isSafeExecutableName(name))
|
|
182
|
-
return err(new BinaryTargetError(path, "app has an unsafe CFBundleExecutable"));
|
|
183
|
-
const programs = join(path, "Contents", "MacOS");
|
|
184
|
-
const executable = join(programs, name);
|
|
185
|
-
try {
|
|
186
|
-
const [canonicalPrograms, canonicalExecutable] = await Promise.all([
|
|
187
|
-
realpath(programs),
|
|
188
|
-
realpath(executable),
|
|
189
|
-
]);
|
|
190
|
-
if (!isPathWithinRoot(canonicalPrograms, canonicalExecutable))
|
|
191
|
-
return err(new BinaryTargetError(path, "app program file leaves Contents/MacOS"));
|
|
192
|
-
return ok(canonicalExecutable);
|
|
193
|
-
}
|
|
194
|
-
catch (cause) {
|
|
195
|
-
return err(new BinaryTargetError(path, "app program file is missing", { cause }));
|
|
196
|
-
}
|
|
197
|
-
};
|
|
198
|
-
const parseXmlPlistExecutable = (plist) => {
|
|
199
|
-
const match = /<key>\s*CFBundleExecutable\s*<\/key>\s*<string>([^<]+)<\/string>/u.exec(plist);
|
|
200
|
-
if (match?.[1] === undefined)
|
|
201
|
-
throw new Error("CFBundleExecutable is missing");
|
|
202
|
-
return decodeXml(match[1].trim());
|
|
166
|
+
return resolveAppBundleExecutable(path);
|
|
203
167
|
};
|
|
204
|
-
const readBinaryPlistExecutable = async (plistPath) => (await execFileAsync("/usr/bin/plutil", [
|
|
205
|
-
"-extract",
|
|
206
|
-
"CFBundleExecutable",
|
|
207
|
-
"raw",
|
|
208
|
-
"-o",
|
|
209
|
-
"-",
|
|
210
|
-
plistPath,
|
|
211
|
-
])).stdout.trim();
|
|
212
|
-
const isSafeExecutableName = (name) => name.length > 0 &&
|
|
213
|
-
name !== "." &&
|
|
214
|
-
name !== ".." &&
|
|
215
|
-
!name.includes("\0") &&
|
|
216
|
-
!/[/\\]/u.test(name);
|
|
217
|
-
const decodeXml = (value) => value
|
|
218
|
-
.replaceAll("&", "&")
|
|
219
|
-
.replaceAll("<", "<")
|
|
220
|
-
.replaceAll(">", ">")
|
|
221
|
-
.replaceAll(""", '"')
|
|
222
|
-
.replaceAll("'", "'");
|
|
223
168
|
const readExecutableMetadata = async (handle, hostArchitecture) => {
|
|
224
169
|
const prefix = Buffer.alloc(4096);
|
|
225
170
|
const prefixRead = await handle.read(prefix, 0, prefix.length, 0);
|