mirror of
https://github.com/morluto/rea.git
synced 2026-11-15 19:23:24 +00:00
refactor(android): build mobile-provider cancellations with a required reason (#10590)
* refactor(errors): require a reason for every analysis cancellation Add cancelledBy, the one constructor for AnalysisCancelledError. Its reason argument is required: an aborted signal, an earlier cancellation, a reason carried from an inner failure, or an OwnerCancellation when REA closed the work's owner itself. Closed adb, apktool, firmware, sqlite, gdb, web-bundle analyzer and binary-session record owners now report OwnerCancellation.ownerClosed instead of an absent reason. Firmware's predecessor wait returns its cancellation as a Result, removing an unreachable reason-less fallback. An architecture guard rejects new direct constructions, with a counted per-file baseline that can only shrink. * refactor(errors): share one aborted-signal predicate with cancelledBy * refactor(process): return a departing caller's reason from a shared startup wait * refactor(android): build mobile-provider cancellations with a required reason Migrate every remaining AnalysisCancelledError construction under src/adb, src/android, src/apktool, src/apkSignature, src/flutter, src/il2cpp, src/dotnet and src/frida to cancelledBy and lower the guard baseline from 671 to 608. A closed adb provider reports OwnerCancellation.ownerClosed for later probes, and JADX and apktool shutdown abort with that typed reason. * refactor(providers): build decompiler-provider cancellations with a required reason (#10587) Migrate every AnalysisCancelledError construction under src/ghidra, src/ida, src/cutter, src/jeb and src/kuna to cancelledBy and lower the guard baseline from 671 to 572. Closed Kuna target commands report OwnerCancellation.ownerClosed instead of an absent reason, and Kuna and JEB close abort their lifetimes with that typed reason. * fix(errors): read the reason of any signal-shaped cancellation source * test(ci): cover the counted-baseline comparison behind the architecture guard
This commit is contained in:
1 parent
959af004df
commit
ef15353c69
23 files changed
+175
-254
No files matched your search
@@ -12,9 +12,9 @@ import { ArtifactReaderFailure } from "../artifacts/ArtifactReader.js";
|
||||
import { AnalysisCleanupLease } from "../artifacts/AnalysisCleanupLease.js";
|
||||
import { AnalysisError } from "../domain/analysisErrorBase.js";
|
||||
import {
|
||||
AnalysisCancelledError,
|
||||
AnalysisInputError,
|
||||
AnalysisResourceConstraintError,
|
||||
cancelledBy,
|
||||
} from "../domain/analysisErrorCore.js";
|
||||
import { EvidenceFileError } from "../domain/evidenceErrors.js";
|
||||
import { ProviderCleanupError } from "../domain/providerCleanupError.js";
|
||||
@@ -41,9 +41,7 @@ export class Il2cppGhidraSeedWriter implements Il2cppSeedWriterPort {
|
||||
options?: ExecutionOptions,
|
||||
): Promise<Result<void, AnalysisError>> {
|
||||
if (options?.signal?.aborted)
|
||||
return err(
|
||||
new AnalysisCancelledError(OPERATION, { cause: options.signal.reason }),
|
||||
);
|
||||
return err(cancelledBy(OPERATION, options.signal));
|
||||
if (!isAbsolute(output.path))
|
||||
return err(
|
||||
invalid(
|
||||
|
||||
@@ -35,12 +35,12 @@ import { createIl2cppMetadataAdmission } from "./Il2cppMetadataAdmission.js";
|
||||
import { hexAddress as hex } from "./Il2cppBinaryImage.js";
|
||||
import { jsonValueByteLength } from "../domain/jsonValueByteLength.js";
|
||||
import {
|
||||
AnalysisCancelledError,
|
||||
AnalysisCapabilityUnavailableError,
|
||||
AnalysisInputError,
|
||||
AnalysisOutputError,
|
||||
AnalysisResourceConstraintError,
|
||||
AnalysisUnsupportedTargetError,
|
||||
cancelledBy,
|
||||
} from "../domain/analysisErrorCore.js";
|
||||
import {
|
||||
il2cppMetadataSchema,
|
||||
@@ -396,9 +396,7 @@ export class Il2cppMetadataProvider implements Il2cppMetadataPort {
|
||||
options?: ExecutionOptions,
|
||||
): Promise<Result<Il2cppMetadata, AnalysisError>> {
|
||||
if (options?.signal?.aborted)
|
||||
return err(
|
||||
new AnalysisCancelledError(OPERATION, { cause: options.signal.reason }),
|
||||
);
|
||||
return err(cancelledBy(OPERATION, options.signal));
|
||||
if (this.#admissionStopped)
|
||||
return err(
|
||||
new AnalysisCapabilityUnavailableError(
|
||||
|
||||
Reference in new issue
Block a user