mirror of
https://github.com/morluto/rea.git
synced 2026-12-03 13:24:20 +00:00
83 lines
2.0 KiB
TypeScript
83 lines
2.0 KiB
TypeScript
import type { JsonValue } from "../../src/domain/jsonValue.js";
|
|
|
|
export const androidPackageComponent = (
|
|
name: string,
|
|
extra: Record<string, JsonValue> = {},
|
|
) => ({
|
|
kind: "activity",
|
|
declared_name: name,
|
|
name,
|
|
exported: null,
|
|
exported_default: null,
|
|
permission: null,
|
|
permission_source: "none",
|
|
intent_filter_count: 0,
|
|
actions: [] as string[],
|
|
categories: [],
|
|
foreground_service_type: null,
|
|
authorities: null,
|
|
target_activity: null,
|
|
declaration_coverage: "complete",
|
|
declaration_index: 0,
|
|
location: null,
|
|
enabled: null,
|
|
enabled_declaration: null,
|
|
process: null,
|
|
grant_uri_permissions: null,
|
|
grant_uri_permissions_declaration: null,
|
|
intent_filters: [],
|
|
meta_data: [],
|
|
...extra,
|
|
});
|
|
export const androidPackageReport = (
|
|
items = [
|
|
androidPackageComponent("example.One", {
|
|
declared_name: ".One",
|
|
exported: true,
|
|
actions: ["VIEW"],
|
|
declaration_index: 10,
|
|
declaration_coverage: "complete",
|
|
}),
|
|
androidPackageComponent("example.Boot", {
|
|
kind: "receiver",
|
|
exported_default: true,
|
|
actions: ["BOOT"],
|
|
declaration_index: 20,
|
|
}),
|
|
androidPackageComponent("example.One", {
|
|
declared_name: ".One",
|
|
exported: false,
|
|
actions: ["VIEW"],
|
|
declaration_index: 30,
|
|
declaration_coverage: "partial",
|
|
}),
|
|
],
|
|
{ engineDigest = "e".repeat(64), classCount = 3, complete = false } = {},
|
|
) => ({
|
|
engine: {
|
|
name: "jadx",
|
|
version: null,
|
|
artifact_sha256: engineDigest,
|
|
source_revision: null,
|
|
worker_count: 1,
|
|
heap_limit_mib: null,
|
|
},
|
|
package_name: "example",
|
|
version_name: null,
|
|
version_code: null,
|
|
min_sdk: null,
|
|
target_sdk: "35",
|
|
permissions: [],
|
|
manifest: {
|
|
status: "complete",
|
|
text: "<manifest/>",
|
|
reported_total_bytes: 11,
|
|
},
|
|
components: complete
|
|
? { status: "complete", limitations: [], items }
|
|
: { status: "partial", items, limitations: ["Producer component limit"] },
|
|
class_count: classCount,
|
|
resource_count: 0,
|
|
signature_verification: "not_performed",
|
|
});
|