./PLAN.md:33:- Runtime cache/media/impression/heartbeat/manifest-refresh logic now lives in one shared core used by both runtime shells.
./android/machine-ads-sync/README.md:1:# Ballbox machine ads sync
./android/machine-ads-sync/README.md:19:- manifest URL: `https://ballbox.app/api/machines/2601070188/ads-manifest`
./android/machine-ads-sync/README.md:20:- target root: `/sdcard/TcnFoldercopy`
./android/machine-ads-sync/README.md:23:- fetch manifest JSON
./android/machine-ads-sync/settings.gradle.kts:17:rootProject.name = "machine-ads-sync"
./scripts/machine-ads-sync.mjs:7:  console.error("usage: node scripts/machine-ads-sync.mjs <manifest-url> <target-root>");
./scripts/machine-ads-sync.mjs:25:  const manifestUrl = process.argv[2];
./scripts/machine-ads-sync.mjs:28:  if (!manifestUrl || !targetRoot) {
./scripts/machine-ads-sync.mjs:33:  const manifestResponse = await fetch(manifestUrl, { headers: { "user-agent": "ballbox-machine-ads-sync/0.1" } });
./scripts/machine-ads-sync.mjs:34:  if (!manifestResponse.ok) {
./scripts/machine-ads-sync.mjs:35:    throw new Error(`manifest request failed: ${manifestResponse.status}`);
./scripts/machine-ads-sync.mjs:38:  const manifestPayload = await manifestResponse.json();
./scripts/machine-ads-sync.mjs:39:  if (!manifestPayload?.ok || !manifestPayload?.manifest?.files) {
./scripts/machine-ads-sync.mjs:40:    throw new Error("unexpected manifest payload");
./scripts/machine-ads-sync.mjs:43:  const manifest = manifestPayload.manifest;
./scripts/machine-ads-sync.mjs:46:  for (const file of manifest.files) {
./scripts/machine-ads-sync.mjs:59:    const assetResponse = await fetch(file.url, { headers: { "user-agent": "ballbox-machine-ads-sync/0.1" } });
./scripts/machine-ads-sync.mjs:80:        machineId: manifest.machineId,
./scripts/machine-ads-sync.mjs:81:        version: manifest.version,
./scripts/machine-ads-sync.mjs:82:        restartPolicy: manifest.restartPolicy,
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MainActivity.kt:15:        binding.manifestUrlInput.setText(DEFAULT_MANIFEST_URL)
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MainActivity.kt:20:            val manifestUrl = binding.manifestUrlInput.text?.toString()?.trim().orEmpty()
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MainActivity.kt:23:            if (manifestUrl.isEmpty() || targetRoot.isEmpty()) {
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MainActivity.kt:35:                        manifestUrl = manifestUrl,
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MainActivity.kt:61:        private const val DEFAULT_MANIFEST_URL = "https://ballbox.app/api/machines/2601070188/ads-manifest"
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MainActivity.kt:62:        private const val DEFAULT_TARGET_ROOT = "/sdcard/TcnFoldercopy"
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:11:    fun sync(manifestUrl: String, targetRoot: String, logger: (String) -> Unit): SyncResult {
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:12:        logger("GET $manifestUrl")
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:13:        val manifestPayload = fetchJson(manifestUrl)
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:14:        if (!manifestPayload.optBoolean("ok")) {
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:15:            throw IllegalStateException(manifestPayload.optString("message", "manifest request failed"))
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:18:        val manifest = manifestPayload.getJSONObject("manifest")
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:19:        val restartPolicy = manifest.optString("restartPolicy", "app")
./android/machine-ads-sync/app/src/main/java/app/ballbox/machineadssync/MachineAdsSyncEngine.kt:20:        val files = manifest.getJSONArray("files")
./android/machine-ads-sync/app/src/main/res/layout/activity_main.xml:16:            android:text="Ballbox machine ads sync"
./android/machine-ads-sync/app/src/main/res/layout/activity_main.xml:27:            android:id="@+id/manifestUrlInput"
./android/machine-ads-sync/app/src/main/AndroidManifest.xml:2:<manifest xmlns:android="http://schemas.android.com/apk/res/android">
./android/machine-ads-sync/app/src/main/AndroidManifest.xml:22:</manifest>
./tests/e2e/tvs-admin.spec.ts:39:  await tvDeviceCreateForm.getByPlaceholder("https://...").fill("https://example.com/manifests/initial.json");
./tests/e2e/tvs-admin.spec.ts:50:  await tvDeviceCard.locator("input").nth(2).fill("https://example.com/manifests/updated.json");
./data/machine-ads/2601070188.json:3:  "targetRootHint": "/sdcard/TcnFolder",
./data/machine-ads/2601070188.json:4:  "managedDirs": ["ImageScreen", "VideoAndImageAd"],
./data/machine-ads/2601070188.json:8:      "target": "VideoAndImageAd/See You Again (Cover)--音悦Tai.mp4",
./data/machine-ads/2601070188.json:9:      "publicPath": "/machine-assets/2601070188/VideoAndImageAd/See You Again (Cover)--音悦Tai.mp4",
./data/machine-ads/2601070188.json:13:      "target": "ImageScreen/14597490_1080x1920_30fps.mp4",
./data/machine-ads/2601070188.json:14:      "publicPath": "/machine-assets/2601070188/ImageScreen/14597490_1080x1920_30fps.mp4",
./tests/unit/tvs/runtime.test.ts:25:  it("keeps current creative active across manifest refresh when still present", () => {
./public/sw.js:6:  "/manifest.webmanifest",
./prisma/schema.prisma:189:  manifestUrl   String?
./prisma/migrations/20260506094000_init/migration.sql:140:    "manifestUrl" TEXT,
./components/tvs-admin-client.tsx:46:  manifestUrl: "",
./components/tvs-admin-client.tsx:437:                  <Link className="text-primary transition hover:text-primary/80" href={`/api/tvs/manifest/${screen.id}`}>
./components/tvs-admin-client.tsx:451:              <p className={`mt-1 text-sm ${secondaryTextClass}`}>Dispositivos físicos, manifest override y salud de conexión.

./components/tvs-admin-client.tsx:468:                value={tvDeviceForm.manifestUrl}
./components/tvs-admin-client.tsx:469:                onChange={(event) => setTvDeviceForm((current) => ({ ...current, manifestUrl: event.target.value }))}
./components/tvs-admin-client.tsx:484:                        manifestUrl: tvDeviceForm.manifestUrl || undefined,
./components/tvs-admin-client.tsx:529:                      value={tvDevice.manifestUrl ?? ""}
./components/tvs-admin-client.tsx:534:                            item.id === tvDevice.id ? { ...item, manifestUrl: event.target.value } : item
./components/tvs-admin-client.tsx:553:                                manifestUrl: tvDevice.manifestUrl ?? "",
./components/screen-player.tsx:59:    if (snapshot.manifest.creatives.length <= 1) {
./components/screen-player.tsx:73:  }, [runtime, snapshot.activeIndex, snapshot.manifest]);
./components/screen-player.tsx:102:  }, [runtime, snapshot.activeIndex, snapshot.manifest]);
./components/screen-player.tsx:155:
Creative {snapshot.activeIndex + 1} de {snapshot.manifest.creatives.length}

./components/screen-player.tsx:159:
Version: {snapshot.manifest.version}

./components/screen-player.tsx:160:
Generated: {new Date(snapshot.manifest.generatedAt).toLocaleString("es-AR")}

./components/screen-player.tsx:178:            {snapshot.manifest.creatives.map((creative, index) => {
./public/player-runtime.js:12:    initialManifest: bootstrap.manifest,
./public/player-runtime.js:31:    manifestRefresh: document.getElementById("diag-manifest-refresh"),
./public/player-runtime.js:60:    elements.version.textContent = `Version: ${state.manifest.version}`;
./public/player-runtime.js:61:    elements.generated.textContent = `Generated: ${formatDate(state.manifest.generatedAt)}`;
./public/player-runtime.js:68:    elements.manifestRefresh.textContent = `Manifest refresh: ${state.lastManifestRefreshStatus}${state.lastManifestRefreshAt ? ` (${formatDate(state.lastManifestRefreshAt)})` : ""}`;
./public/player-runtime.js:89:      manifestVersion: state.manifest.version,
./public/player-runtime.js:90:      manifestGeneratedAt: state.manifest.generatedAt,
./public/player-runtime.js:135:    state.manifest.creatives.forEach((creative, index) => {
./public/player-runtime.js:167:      elements.count.textContent = `Preparing cached media for creative ${state.activeIndex + 1} de ${state.manifest.creatives.length}`;
./public/player-runtime.js:184:    elements.count.textContent = `Creative ${state.activeIndex + 1} de ${state.manifest.creatives.length}`;
./public/player-runtime.js:200:    if (!activeCreative || state.manifest.creatives.length <= 1) {
./public/player-runtime.js:251:    if (state.manifest.creatives.length <= 1) {
./tests/contracts/tvs/backend-runtime.test.ts:123:  it("returns empty-programming manifest when no active creatives remain", async () => {
./tests/contracts/tvs/backend-runtime.test.ts:140:      manifest: {
./tests/contracts/tvs/routes.test.ts:85:  it("validates manifest success shape", async () => {
./tests/contracts/tvs/routes.test.ts:102:    const { GET } = await import("@/app/api/tvs/manifest/[screenId]/route");
./tests/contracts/tvs/routes.test.ts:103:    const response = await GET(new Request("http://localhost/api/tvs/manifest/screen_001"), {
./tests/contracts/tvs/routes.test.ts:112:  it("returns strict 404 error for missing screen manifest", async () => {
./tests/contracts/tvs/routes.test.ts:119:    const { GET } = await import("@/app/api/tvs/manifest/[screenId]/route");
./tests/contracts/tvs/routes.test.ts:120:    const response = await GET(new Request("http://localhost/api/tvs/manifest/missing"), {
./tests/contracts/tvs/routes.test.ts:136:    const { GET } = await import("@/app/api/tvs/manifest/[screenId]/route");
./tests/contracts/tvs/routes.test.ts:137:    const response = await GET(new Request("http://localhost/api/tvs/manifest/screen_001"), {
./tests/contracts/tvs/backend-modules.test.ts:71:      manifestUrl: " https://example.com/manifest.m3u8 ",
./tests/contracts/tvs/backend-modules.test.ts:78:        manifestUrl: "https://example.com/manifest.m3u8",
./tests/contracts/tvs/backend-modules.test.ts:153:        manifestUrl: "https://example.com/manifest.m3u8",
./tests/contracts/tvs/backend-modules.test.ts:324:          manifestUrl: "https://example.com/manifest.m3u8",
./tests/contracts/tvs/screen-player.test.tsx:91:        if (url === "/api/tvs/manifest/screen_001") {
./tests/contracts/tvs/screen-player.test.tsx:146:  it("keeps cached playback active when manifest refresh fails", async () => {
./tests/contracts/tvs/screen-player.test.tsx:162:      if (url === "/api/tvs/manifest/screen_001") {
./tests/contracts/tvs/screen-player.test.tsx:163:        throw new Error("manifest offline");
./tests/contracts/tvs/screen-player.test.tsx:201:      if (url === "/api/tvs/manifest/screen_001") {
./lib/tvs-backend-types.ts:35:  manifestUrl: string | null;
./lib/tvs-backend-runtime.ts:178:      manifest: createEmptyTvManifest(screenId),
./lib/platform.ts:32:    summary: "Pantallas, campaigns, creatives, manifests e impresiones.",
./lib/tvs-backend-tv-devices.ts:27:  manifestUrl?: string;
./lib/tvs-backend-tv-devices.ts:33:      manifestUrl: normalizeOptionalText(input.manifestUrl),
./lib/tvs-backend-tv-devices.ts:48:    manifestUrl?: string;
./lib/tvs-backend-tv-devices.ts:63:      manifestUrl: normalizeOptionalText(input.manifestUrl),
./app/player/[screenId]/route.ts:89:  manifest: ReturnType<typeof createEmptyTvManifest>;
./app/player/[screenId]/route.ts:111:            Manifest
./app/player/[screenId]/route.ts:124:

./app/player/[screenId]/route.ts:150:  const manifest = await getTvManifestFromSource(screenId);
./app/player/[screenId]/route.ts:152:  if (!manifest.ok && manifest.error === "SCREEN_NOT_FOUND") {
./app/player/[screenId]/route.ts:162:  const initialManifest = !manifest.ok ? createEmptyTvManifest(screenId) : manifest;
./app/player/[screenId]/route.ts:167:      manifest: initialManifest,
./lib/tvs-player-runtime-core.ts:4:  manifest: ScreenManifest;
./lib/tvs-player-runtime-core.ts:38:    manifest: initialManifest,
./lib/tvs-player-runtime-core.ts:183:    return state.manifest.creatives[state.activeIndex] ?? null;
./lib/tvs-player-runtime-core.ts:187:    const creatives = state.manifest.creatives;
./lib/tvs-player-runtime-core.ts:198:    if (state.manifest.creatives.length <= 1) {
./lib/tvs-player-runtime-core.ts:226:    const validUrls = new Set(state.manifest.creatives.map((creative) => normalizeCreativeUrl(creative.url)));
./lib/tvs-player-runtime-core.ts:236:    const nextIds = new Set(state.manifest.creatives.map((creative) => creative.id));
./lib/tvs-player-runtime-core.ts:238:    for (const creative of state.manifest.creatives) {
./lib/tvs-player-runtime-core.ts:381:      const response = await fetch(`/api/tvs/manifest/${screenId}`, {
./lib/tvs-player-runtime-core.ts:393:        manifest: nextManifest,
./lib/tvs-player-runtime-core.ts:394:        activeIndex: getActiveCreativeIndex(state.manifest, nextManifest, state.activeIndex),
./lib/machine-ads-manifest.ts:6:const MACHINE_ADS_CONFIG_ROOT = path.join(process.cwd(), "data", "machine-ads");
./lib/tvs-backend-mappers.ts:52:  manifestUrl: string | null;
./lib/tvs-backend-mappers.ts:61:    manifestUrl: tvDevice.manifestUrl,
./lib/contracts/admin-tvs.ts:61:  manifestUrl: z.string().trim().url("Manifest URL must be valid").optional(),
./lib/contracts/admin-tvs.ts:68:    manifestUrl: z
./lib/contracts/admin-tvs.ts:73:    (value) => value.name !== undefined || value.location !== undefined || value.manifestUrl !== undefined,
./app/manifest.ts:3:export default function manifest(): MetadataRoute.Manifest {
./app/layout.tsx:33:  manifest: '/manifest.webmanifest',
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:1:# TCN API-driven machine ads RFC
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:8:- Correct target root on the machine is `/sdcard/TcnFolder`.
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:9:- `ImageScreen/` is the fullscreen standby slot.
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:10:- `VideoAndImageAd/` is the smaller top video slot.
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:19:Current backend manifest generation is hardcoded in `lib/machine-ads-manifest.ts`.
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:27:2. fetch manifest
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:37:## Proposed manifest shape
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:44:  "targetRootHint": "/sdcard/TcnFolder",
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:45:  "managedDirs": ["ImageScreen", "VideoAndImageAd"],
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:48:      "target": "ImageScreen/foo.mp4",
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:85:- move hardcoded manifest config into file-backed JSON
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:86:- expose `managedDirs` and `targetRootHint` in manifest
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:87:- update sidecar default target root to `/sdcard/TcnFolder`
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:111:- keep manifest truthful: only list assets that exist and hash correctly
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:121:2. refactor manifest builder to read config instead of hardcoded map
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:122:3. include `managedDirs` and `targetRootHint` in manifest response
./docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md:123:4. update Android sidecar default root to `/sdcard/TcnFolder`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:9:The active research direction is to control machine ads/media through the Android runtime and known machine file paths instead of depending on Yunshu cloud entitlements.
./docs/tcn-remote-ads-autonomy-2026-06-06.md:21:- Felipe later said: `yo puse un video en la carpeta ImageScreen` and clarified it was `el video grande`.
./docs/tcn-remote-ads-autonomy-2026-06-06.md:37:- `TcnFoldercopy/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:40:- `TcnFoldercopy/ImagePay/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:41:- `TcnFoldercopy/ImageRight/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:42:- `TcnFoldercopy/ImageScreen/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:43:- `TcnFoldercopy/ImageBackground/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:44:- `TcnFoldercopy/ImageHelp/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:45:- `TcnFoldercopy/VideoAndImageAd/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:46:- `TcnFoldercopy/pollFile/`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:49:1. Ballbox service publishes manifest + files
./docs/tcn-remote-ads-autonomy-2026-06-06.md:74:- `TcnFoldercopy/ImagePay/46d3a954-ec76-4f45-8696-e153b4ef48be.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:75:- `TcnFoldercopy/ImageRight/a2f1d5b7-2291-4fa5-8fa3-1385218008a4.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:76:- `TcnFoldercopy/ImageScreen/流程图.jpg`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:77:- `TcnFoldercopy/pollFile/Screeempty.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:78:- `TcnFoldercopy/pollFile/adEmpty.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:81:- `TcnFoldercopy/ImageBackground/ballbox-home-secondary.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:82:- `TcnFoldercopy/ImageScreen/ballbox-home-secondary.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:83:- `TcnFoldercopy/ImageHelp/ballbox-help-selection.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:84:- `TcnFoldercopy/ImageHelp/ballbox-help-payment-qr.png`
./docs/tcn-remote-ads-autonomy-2026-06-06.md:92:- Felipe explicitly said he put a video into `ImageScreen`.
./docs/tcn-remote-ads-autonomy-2026-06-06.md:120:- polling Ballbox manifest
./docs/screen-runtime-delivery-investigation.md:30:  - `/api/tvs/manifest/[screenId]`
./docs/screen-runtime-delivery-investigation.md:100:- Do not move manifest/reporting/auth logic out of Ballbox in the same step.
./app/admin/screens/page.tsx:9:  { label: "TV device sync", value: "Polling internal /api/tvs/manifest/:screenId" },
./docs/streetcast-parity.md:5:- Sequential creative playback: covered by runtime rotation over active manifest creatives.
./docs/streetcast-parity.md:7:- Background preload: covered by manifest-driven media warming after each runtime refresh.
./docs/streetcast-parity.md:8:- Offline continuity: covered by last-good-manifest retention plus cached blob playback fallback.
./docs/streetcast-parity.md:13:- Ballbox runtime uses Ballbox-owned manifest/impression APIs instead of Streetcast endpoints.
./docs/streetcast-parity.md:20:- The runtime now ships an on-screen `Export parity snapshot` action that downloads a JSON snapshot (screen id, manifest/playback/cache/network/reporting state, user agent, capture time) to standardize evidence capture.
./docs/streetcast-parity.md:26:- Stock seed data now provides active TV programming for `screen_001` after `pnpm db:seed`, so local cached-blob playback, first impression write, queued-impression recovery, and manifest-refresh-failure continuity can be validated without manual TV fixture repair first.
./docs/streetcast-parity.md:42:6. Keep the device offline past one manifest refresh interval and verify `Manifest refresh: failed` appears without playback stopping.
./docs/streetcast-parity.md:56:- Runtime keeps playing through at least one failed manifest refresh while offline.
./docs/bb-002-slice-1-plan.md:7:- web manifest
./docs/bb-002-slice-1-plan.md:19:- `app/manifest.ts`
./docs/bb-002-slice-1-plan.md:23:- optional: `tests/contracts/manifest-route.test.ts`
./docs/index.md:59:- [TCN API-driven machine ads RFC](./tcn-api-driven-machine-ads-rfc-2026-06-08.md)
./docs/implemented-tvs.md:9:- `/admin/tvs` links each screen directly to its runtime and manifest.
./docs/implemented-tvs.md:16:- `/api/tvs/manifest/[screenId]`
./docs/implemented-tvs.md:37:- The runtime rotates creatives from a Ballbox DB-backed manifest derived from active screen-to-campaign assignments.
./docs/implemented-tvs.md:38:- The runtime posts a heartbeat to Ballbox every 30 seconds, independent of manifest refreshes.
./docs/implemented-tvs.md:42:- Runtime keeps the last good manifest during transient manifest fetch failures so cached media can continue playing offline.
./docs/implemented-tvs.md:43:- Runtime preloads manifest creatives after refresh and evicts stale cached media when programming changes.
./docs/implemented-tvs.md:44:- Cache/media/impression/heartbeat/manifest-refresh behavior now comes from one shared runtime core in `lib/tvs-player-runtime-core.ts`; React and lightweight HTML+JS are delivery adapters over the same logic.
./docs/implemented-tvs.md:46:- Runtime now exposes operator-facing diagnostics for playback source, Cache API support, cached creative count, network state, and manifest refresh status to support real-device parity checks.
./docs/implemented-tvs.md:51:- `GET /api/tvs/manifest/[screenId]` returns:
./docs/implemented-tvs.md:73:  - runtime helper invariants for cache naming, manifest continuity, and bounded retry behavior
./docs/tcn-machine-reality-2026-05-26.html:61:
Observed server: qrc.ourvend.com:4150.

./docs/tcn-machine-reality-2026-05-26.html:63:
Observed remote-content hints: ad.ourvend.com, OTA/update references, remote ads flags.

./docs/maintainability-priorities-2026-03.md:112:  - The duplicated runtime logic covers manifest refresh, cache storage, blob URLs, heartbeats, and impression retry behavior.
./docs/maintainability-priorities-2026-03.md:119:  - TV runtime cache/media/impression/heartbeat/manifest-refresh logic now lives in one shared core used by both shells.
./docs/maintainability-priorities-2026-03.md:301:- Source of truth for cache, retry, manifest polling, diagnostics, and playback state.
./docs/tcn-future-action-options.html:68:
Investigate OurVend TCP behavior at qrc.ourvend.com:4150.

./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:8:Serve the simplest possible Ballbox-controlled manifest plus static files to test remote ad changes on one machine.
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:12:- `GET /api/machines/2601070188/ads-manifest`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:15:- `https://ballbox.app/api/machines/2601070188/ads-manifest`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:21:- manifest is generated from files stored in `public/machine-assets/2601070188/...`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:31:- `VideoAndImageAd/See You Again (Cover)--音悦Tai.mp4`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:32:- `ImageScreen/流程图.jpg`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:35:- `/machine-assets/2601070188/VideoAndImageAd/See You Again (Cover)--音悦Tai.mp4`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:36:- `/machine-assets/2601070188/ImageScreen/流程图.jpg`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:49:- `app/api/machines/[machineId]/ads-manifest/route.ts`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:50:- `lib/machine-ads-manifest.ts`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:51:- `public/machine-assets/2601070188/VideoAndImageAd/See You Again (Cover)--音悦Tai.mp4`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:52:- `public/machine-assets/2601070188/ImageScreen/流程图.jpg`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:59:  "manifest": {
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:66:        "target": "VideoAndImageAd/See You Again (Cover)--音悦Tai.mp4",
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:67:        "url": "https://ballbox.app/machine-assets/2601070188/VideoAndImageAd/See%20You%20Again%20(Cover)--音悦Tai.mp4",
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:79:1. machine polls manifest
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:88:- `scripts/machine-ads-sync.mjs`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:91:- `node scripts/machine-ads-sync.mjs <manifest-url> <target-root>`
./docs/tcn-simple-ads-backend-mvp-2026-06-06.md:94:- fetches the manifest
./app/api/machines/[machineId]/ads-manifest/route.ts:3:import { getMachineAdsManifest } from "@/lib/machine-ads-manifest";
./app/api/machines/[machineId]/ads-manifest/route.ts:10:  const manifest = await getMachineAdsManifest(machineId, request.url);
./app/api/machines/[machineId]/ads-manifest/route.ts:12:  if (!manifest) {
./app/api/machines/[machineId]/ads-manifest/route.ts:17:        message: `No simple ads manifest is configured for machine ${machineId}.`,
./app/api/machines/[machineId]/ads-manifest/route.ts:23:  return NextResponse.json({ ok: true, manifest });
./app/api/tvs/manifest/[screenId]/route.ts:13:  const manifest = await getTvManifestFromSource(screenId);
./app/api/tvs/manifest/[screenId]/route.ts:15:  if (!manifest.ok) {
./app/api/tvs/manifest/[screenId]/route.ts:16:    return NextResponse.json(createTvsErrorResponse(manifest.error, manifest.status), {
./app/api/tvs/manifest/[screenId]/route.ts:17:      status: manifest.status,
./app/api/tvs/manifest/[screenId]/route.ts:23:      version: manifest.version,
./app/api/tvs/manifest/[screenId]/route.ts:24:      screenId: manifest.screenId,
./app/api/tvs/manifest/[screenId]/route.ts:25:      generatedAt: manifest.generatedAt,
./app/api/tvs/manifest/[screenId]/route.ts:26:      creatives: manifest.creatives,


docs/html-first-accessibility-plan.md
docs/coaches-jtbd-workflow-map.md
docs/tcn-simple-ads-backend-mvp-2026-06-06.md
docs/classes-subroute-plan.md
docs/coaches-solution-thesis.md
docs/tcn-future-action-options.html
docs/coaches-interview-script.md
docs/atc-integration-spec-skeleton.md
docs/coaches-design-partner-outreach.md
docs/coaches-wedges-matrix.md
docs/coaches-coordination-gap-analysis.md
docs/coaches-research-repository.md
docs/maintainability-priorities-2026-03.md
docs/classes-mvp-rfc.md
docs/coach-availability-rfc.md
docs/classes-implementation-notes.md
docs/coaches-opportunity-brief.md
docs/tcn-maquinas-recibido-2026-05-26/PARTE 6 - Ingenieria Inversa Avanzada y Autonomia Tecnologica.docx
docs/tcn-maquinas-recibido-2026-05-26/PARTE 5 - Manual Operativo BallBox.docx
docs/tcn-maquinas-recibido-2026-05-26/PARTE 3 - EasyCoin BillWallet Operacion Comercial y Arquitectura Futura.docx
docs/tcn-maquinas-recibido-2026-05-26/PARTE 2 - Android USB Publicidad Exportaciones y Sistema Interno.docx
docs/tcn-maquinas-recibido-2026-05-26/PARTE 1 - DOCUMENTACION MAESTRA DE INVESTIGACION Y OPERACION.docx
docs/tcn-maquinas-recibido-2026-05-26/PARTE 4 - Ingenieria Inversa Traducciones Backend Propio y Plan de Investigacion.docx
docs/tcn-machine-reality-2026-05-26.html
docs/implemented-host-app.md
docs/domain-model-target.md
docs/atc-mock-integration-plan.md
docs/implemented-network.md
docs/implemented-payments.md
docs/coaches-icp-segmentation.md
docs/implemented-tvs.md
docs/demo-iteration-mode.md
docs/index.md
docs/atc-access-request-checklist.md
docs/coaches-validation-checklist-2-weeks.md
docs/bb-002-slice-1-plan.md
docs/payments-club-settlement-strategy.md
docs/mercadopago-webhook-replay-notes-2026-04-23.md
docs/streetcast-parity.md
docs/implemented-players.md
docs/atc-integration-discovery.md
docs/coaches-form-current.md
docs/coaches-discovery-execution-plan.md
docs/implemented-sports.md
docs/repo-map.md
docs/ballbox-db-plan.md
docs/coaches-discovery-stage.md
docs/screen-runtime-delivery-investigation.md
docs/tcn-remote-ads-autonomy-2026-06-06.md
docs/tcn-api-driven-machine-ads-rfc-2026-06-08.md


**Evaluating app integration options**

I'm considering the user's request regarding the Ballbox app repo, focusing on integrating the main APK. Changing the TCN app's remote ad base URL to point to the Ballbox API could work by emulating the TCN AdsManage response instead of creating a new manifest engine. However, since the RFC moved to the manifest, it complicates things. Perhaps I could add a small bridge or embed the existing sidecar sync engine into the TCN app, but that's challenging. A limited patch might be more feasible, maybe reusing manual menu buttons to improve compatibility.

**Exploring synchronization options**

I'm looking into whether the existing app already has periodic auto-polling and the option for manual polling. I should check if TcnAdvertControl starts on boot or the main activity, as that might fulfill the auto-sync requirements. For manual sync, perhaps the existing system menu supports copying ads or has a remote ad refresh option. I'll need to search for methods in TcnAdvertControl to identify the request triggers and routes, focusing on the public methods available.

bash

cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && rg -n '^\.method public ' smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl.smali | sed -n '1,120p'


63:.method public constructor <init>()V
4242:.method public static declared-synchronized getInstance()Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;
7407:.method public dealADModel()V
7514:.method public decryptFileBackGroundAdvert(Ljava/lang/String;)Z
7550:.method public decryptFileGoouWuAdvert(Ljava/lang/String;)Z
7586:.method public decryptFileHelpAdvert(Ljava/lang/String;)Z
7622:.method public decryptFileMainAdvert(Ljava/lang/String;)Z
7658:.method public decryptFilePayAdvert(Ljava/lang/String;)Z
7694:.method public decryptFileRightAdvert(Ljava/lang/String;)Z
7730:.method public decryptFileStandbyAdvert(Ljava/lang/String;)Z
7766:.method public deleteAllFile(Ljava/lang/String;Ljava/lang/String;)V
7914:.method public deleteFile(Ljava/lang/String;Ljava/util/List;)V
8108:.method public getAdvertStatus(ILjava/lang/String;)I
9137:.method public getLocalIpAddress()Ljava/lang/String;
9206:.method public getNetWorkType()I
9239:.method public init(Landroid/os/Handler;)V
9248:.method public isAdvertExist(Ljava/lang/String;Ljava/lang/String;)Z
9384:.method public isCannotPlayBackground(Ljava/lang/String;)Z
9407:.method public isCannotPlayGouwu(Ljava/lang/String;)Z
9430:.method public isCannotPlayHelp(Ljava/lang/String;)Z
9453:.method public isCannotPlayMain(Ljava/lang/String;)Z
9474:.method public isCannotPlayPay(Ljava/lang/String;)Z
9497:.method public isCannotPlayRight(Ljava/lang/String;)Z
9520:.method public isCannotPlayStandBy(Ljava/lang/String;)Z
9543:.method public isImageOK(Ljava/lang/String;)Z
9618:.method public readFile(Ljava/lang/String;)Ljava/lang/String;
9865:.method public requestAdvert(Landroid/content/Context;)V
10051:.method public requestAdvertParam()V
10217:.method public requestResult(Ljava/lang/String;)V


cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '9865,10140p' smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl.smali

cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && rg -n 'requestAdvert\(Landroid/content/Context;\)|dealADModel\(\)|requestAdvertParam\(\)' smali* | head -n 120


.method public requestAdvert(Landroid/content/Context;)V
    .locals 6

    if-eqz p1, :cond_0

    .line 370
    iput-object p1, p0, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->mContext:Landroid/content/Context;

    .line 371
    :cond_0
    sget-object p1, Lcom/tcn/tools/constants/TcnConstant;->USE_TCN_OR_CUSTOMER_IP:[Ljava/lang/String;

    const/4 v0, 0x1

    aget-object p1, p1, v0

    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getUseCustomerIP()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result p1

    if-eqz p1, :cond_1

    const-string p1, "api/AdsManage/"

    .line 372
    invoke-virtual {p0, p1}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getBaseHttp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    iput-object p1, p0, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->ADVERT_BASE_Path:Ljava/lang/String;

    goto :goto_0

    :cond_1
    const-string p1, "http://ad.ourvend.com:8090/api/AdsManage/"

    .line 375
    iput-object p1, p0, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->ADVERT_BASE_Path:Ljava/lang/String;

    .line 377
    :goto_0
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/AdHttpRequest;->getInstall()Lcom/tcn/cpt_advert/adpoll/AdHttpRequest;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_advert/adpoll/AdHttpRequest;->httpDPiAd()V

    .line 378
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/AdHttpRequest;->getInstall()Lcom/tcn/cpt_advert/adpoll/AdHttpRequest;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_advert/adpoll/AdHttpRequest;->httpADModel()V

    .line 379
    new-instance p1, Lcom/google/gson/JsonObject;

    invoke-direct {p1}, Lcom/google/gson/JsonObject;-><init>()V

    .line 380
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getMachineID()Ljava/lang/String;

    move-result-object v0

    const-string v1, "Mid"

    invoke-virtual {p1, v1, v0}, Lcom/google/gson/JsonObject;->addProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 381
    invoke-direct {p0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getUIType()I

    move-result v0

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    const-string v1, "UItype"

    invoke-virtual {p1, v1, v0}, Lcom/google/gson/JsonObject;->addProperty(Ljava/lang/String;Ljava/lang/Number;)V

    .line 383
    invoke-direct {p0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getRequestUrl()Ljava/lang/String;

    move-result-object v0

    .line 385
    invoke-static {}, Lcom/tcn/logger/TcnLog;->getInstance()Lcom/tcn/logger/TcnLog;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "reqUrl: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v3, " requestParam: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const-string v3, "ComponentAdvert"

    const-string v4, "TcnAdvertControl"

    const-string v5, "requestAdvert"

    invoke-virtual {v1, v3, v4, v5, v2}, Lcom/tcn/logger/TcnLog;->LoggerDebug(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 387
    new-instance v1, Lokhttp3/OkHttpClient;

    invoke-direct {v1}, Lokhttp3/OkHttpClient;-><init>()V

    const-string v2, "application/json"

    .line 389
    invoke-static {v2}, Lokhttp3/MediaType;->parse(Ljava/lang/String;)Lokhttp3/MediaType;

    move-result-object v2

    .line 390
    invoke-virtual {p1}, Lcom/google/gson/JsonObject;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {v2, p1}, Lokhttp3/RequestBody;->create(Lokhttp3/MediaType;Ljava/lang/String;)Lokhttp3/RequestBody;

    move-result-object p1

    .line 391
    new-instance v2, Lokhttp3/Request$Builder;

    invoke-direct {v2}, Lokhttp3/Request$Builder;-><init>()V

    .line 392
    invoke-virtual {v2, v0}, Lokhttp3/Request$Builder;->url(Ljava/lang/String;)Lokhttp3/Request$Builder;

    move-result-object v0

    .line 393
    invoke-virtual {v0, p1}, Lokhttp3/Request$Builder;->post(Lokhttp3/RequestBody;)Lokhttp3/Request$Builder;

    move-result-object p1

    .line 394
    invoke-virtual {p1}, Lokhttp3/Request$Builder;->build()Lokhttp3/Request;

    move-result-object p1

    .line 396
    invoke-virtual {v1, p1}, Lokhttp3/OkHttpClient;->newCall(Lokhttp3/Request;)Lokhttp3/Call;

    move-result-object p1

    new-instance v0, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl$3;

    invoke-direct {v0, p0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl$3;-><init>(Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;)V

    invoke-interface {p1, v0}, Lokhttp3/Call;->enqueue(Lokhttp3/Callback;)V

    return-void
.end method

.method public requestAdvertParam()V
    .locals 7

    .line 233
    sget-object v0, Lcom/tcn/tools/constants/TcnConstant;->USE_TCN_OR_CUSTOMER_IP:[Ljava/lang/String;

    const/4 v1, 0x1

    aget-object v0, v0, v1

    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v1

    invoke-virtual {v1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getUseCustomerIP()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "api/AdsManage/"

    .line 234
    invoke-virtual {p0, v0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getBaseHttp(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->ADVERT_BASE_Path:Ljava/lang/String;

    goto :goto_0

    :cond_0
    const-string v0, "http://ad.ourvend.com:8090/api/AdsManage/"

    .line 236
    iput-object v0, p0, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->ADVERT_BASE_Path:Ljava/lang/String;

    .line 238
    :goto_0
    new-instance v0, Lcom/google/gson/JsonObject;

    invoke-direct {v0}, Lcom/google/gson/JsonObject;-><init>()V

    .line 239
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v1

    invoke-virtual {v1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getMachineID()Ljava/lang/String;

    move-result-object v1

    const-string v2, "mid"

    invoke-virtual {v0, v2, v1}, Lcom/google/gson/JsonObject;->addProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 240
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v1

    invoke-virtual {v1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getAesKey()Ljava/lang/String;

    move-result-object v1

    const-string v2, "key"

    invoke-virtual {v0, v2, v1}, Lcom/google/gson/JsonObject;->addProperty(Ljava/lang/String;Ljava/lang/String;)V

    .line 242
    invoke-direct {p0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getRequestParamUrl()Ljava/lang/String;

    move-result-object v1

    .line 244
    invoke-static {}, Lcom/tcn/logger/TcnLog;->getInstance()Lcom/tcn/logger/TcnLog;

    move-result-object v2

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "reqParamUrl: "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;


smali_classes8/com/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon.smali:1279:    invoke-virtual {v1}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvertParam()V
smali_classes8/com/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon.smali:1291:    invoke-virtual {v1, v2}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvert(Landroid/content/Context;)V
smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl$3.smali:11:    value = Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvert(Landroid/content/Context;)V
smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl$1.smali:11:    value = Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvertParam()V
smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl.smali:7407:.method public dealADModel()V
smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl.smali:9865:.method public requestAdvert(Landroid/content/Context;)V
smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl.smali:10051:.method public requestAdvertParam()V
smali_classes8/com/tcn/cpt_advert/adpoll/AdHttpRequest$3.smali:239:    invoke-virtual {p1}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->dealADModel()V
smali_classes8/com/tcn/cpt_advert/HandlerThreadAdvert.smali:1227:    invoke-virtual {v0, v1}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvert(Landroid/content/Context;)V
smali_classes8/com/tcn/cpt_advert/HandlerThreadAdvert.smali:1234:    invoke-virtual {v0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->dealADModel()V


**Inspecting thread methods**

I need to take a closer look at the handler thread method names to see if I can request a remote advertisement. I'll check if this can be done manually from the UI, maybe there's already a button for it. I could possibly map the existing copy ads button to send a message that triggers the requestAdvert function. First, I need to identify the handler, so I’ll search through the HandlerThreadAdvert methods to find what I need.

cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '1180,1255p' smali_classes8/com/tcn/cpt_advert/HandlerThreadAdvert.smali && sed -n '1240,1315p' smali_classes8/com/tcn/cpt_advert/HandlerThreadAdvert\$HandlerCommon.smali


    invoke-virtual {v2}, Lcom/tcn/cpt_advert/ControlAdvert;->getImageHeight()I

    move-result v2

    invoke-virtual {p0, v0, v1, v2}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->setImageSurfaceCreated(Landroid/view/SurfaceHolder;II)V

    return-void
.end method

.method private initialize()V
    .locals 13

    .line 73
    new-instance v0, Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;

    const/4 v1, 0x0

    invoke-direct {v0, p0, v1}, Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;-><init>(Lcom/tcn/cpt_advert/HandlerThreadAdvert;Lcom/tcn/cpt_advert/HandlerThreadAdvert$1;)V

    sput-object v0, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->m_commonHandler:Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;

    .line 74
    invoke-static {}, Lcom/tcn/cpt_advert/advert/ImageController;->instance()Lcom/tcn/cpt_advert/advert/ImageController;

    move-result-object v0

    iget-object v1, p0, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->m_context:Landroid/content/Context;

    invoke-virtual {v0, v1}, Lcom/tcn/cpt_advert/advert/ImageController;->init(Landroid/content/Context;)V

    .line 75
    invoke-static {}, Lcom/tcn/cpt_advert/advert/ImageController;->instance()Lcom/tcn/cpt_advert/advert/ImageController;

    move-result-object v0

    sget-object v1, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->m_commonHandler:Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;

    invoke-virtual {v0, v1}, Lcom/tcn/cpt_advert/advert/ImageController;->setHandler(Landroid/os/Handler;)V

    .line 76
    invoke-static {}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getInstance()Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;

    move-result-object v0

    iget-object v1, p0, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->m_context:Landroid/content/Context;

    invoke-virtual {v0, v1}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvert(Landroid/content/Context;)V

    .line 77
    invoke-static {}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getInstance()Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->dealADModel()V

    .line 78
    invoke-direct {p0}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->initVideoImageInHandThread()V

    .line 79
    invoke-direct {p0}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->initVideoImageHDMIViceInHandThread()V

    .line 80
    invoke-direct {p0}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->OnDecodeScreenBitmap()V

    .line 81
    invoke-direct {p0}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->OnDecodeBackgroundBitmap()V

    .line 82
    invoke-direct {p0}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->OnDecodeHelpImagePath()V

    .line 83
    invoke-direct {p0}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->OnDecodeRightBitmap()V

    .line 84
    invoke-direct {p0}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->OnDecodeGouwuBitmap()V

    .line 905
    :sswitch_14
    iget-object v1, v0, Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;->this$0:Lcom/tcn/cpt_advert/HandlerThreadAdvert;

    invoke-static {v1}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->access$2500(Lcom/tcn/cpt_advert/HandlerThreadAdvert;)V

    goto/16 :goto_7

    .line 930
    :sswitch_15
    iget-object v1, v0, Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;->this$0:Lcom/tcn/cpt_advert/HandlerThreadAdvert;

    invoke-static {v1}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->access$2600(Lcom/tcn/cpt_advert/HandlerThreadAdvert;)V

    .line 931
    iget-object v1, v0, Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;->this$0:Lcom/tcn/cpt_advert/HandlerThreadAdvert;

    invoke-static {v1}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->access$2800(Lcom/tcn/cpt_advert/HandlerThreadAdvert;)V

    goto/16 :goto_7

    .line 901
    :sswitch_16
    invoke-static {}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getInstance()Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;

    move-result-object v1

    invoke-static {}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->access$2400()Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->init(Landroid/os/Handler;)V

    .line 902
    invoke-static {}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getInstance()Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;

    move-result-object v1

    invoke-virtual {v1}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvertParam()V

    goto/16 :goto_7

    .line 898
    :sswitch_17
    invoke-static {}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->getInstance()Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->requestAdvert(Landroid/content/Context;)V

    goto/16 :goto_7

    .line 895
    :sswitch_18
    iget-object v1, v0, Lcom/tcn/cpt_advert/HandlerThreadAdvert$HandlerCommon;->this$0:Lcom/tcn/cpt_advert/HandlerThreadAdvert;

    invoke-static {v1}, Lcom/tcn/cpt_advert/HandlerThreadAdvert;->access$2300(Lcom/tcn/cpt_advert/HandlerThreadAdvert;)V

    goto/16 :goto_7

    .line 890
    :sswitch_19
    invoke-static {}, Lcom/tcn/logger/TcnLog;->getInstance()Lcom/tcn/logger/TcnLog;

    move-result-object v1

    const-string v2, "TRK_STOP_STANDBY"

    invoke-virtual {v1, v9, v8, v2, v2}, Lcom/tcn/logger/TcnLog;->LoggerDebug(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 891
    invoke-static {}, Lcom/tcn/cpt_advert/advert/ImageController;->instance()Lcom/tcn/cpt_advert/advert/ImageController;


**Exploring app initialization**

I see that the app seems to have auto-request settings for ads and the dealADModel. It might start up and sync automatically, which is interesting! I feel curious about what exactly the dealADModel does, so it's worth digging into that. Maybe I could also poll periodically to gather more information. I'll need to inspect the surrounding lines around 7407 to get a better understanding of how it all works.

cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '7407,7525p' smali_classes8/com/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl.smali


.method public dealADModel()V
    .locals 3

    .line 348
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADtype()Ljava/lang/String;

    move-result-object v0

    const-string v1, "dealADModel"

    invoke-virtual {p0, v1, v0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->logx(Ljava/lang/String;Ljava/lang/String;)V

    .line 349
    sget-object v0, Lcom/tcn/tools/constants/TcnConstant;->TCN_ADTYPE:[Ljava/lang/String;

    const/4 v2, 0x2

    aget-object v0, v0, v2

    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v2

    invoke-virtual {v2}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADtype()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v0

    if-eqz v0, :cond_1

    .line 350
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->getInstall()Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll()Z

    move-result v0

    if-nez v0, :cond_0

    .line 351
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->getInstall()Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->startTime()V

    :cond_0
    const/4 v0, 0x5

    .line 353
    invoke-static {}, Lcom/tcn/cpt_advert/advert/ImageController;->instance()Lcom/tcn/cpt_advert/advert/ImageController;

    move-result-object v2

    invoke-virtual {v2}, Lcom/tcn/cpt_advert/advert/ImageController;->getScreenType()I

    move-result v2

    if-ne v0, v2, :cond_2

    const-string v0, "SCREEN_TYPE_S1080X1920"

    .line 354
    invoke-virtual {p0, v1, v0}, Lcom/tcn/cpt_advert/tcn_remote_ad/TcnAdvertControl;->logx(Ljava/lang/String;Ljava/lang/String;)V

    .line 355
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v0

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->setShowScreenProtect(Z)V

    .line 356
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v0

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->setFullScreen(Z)V

    goto :goto_0

    .line 360
    :cond_1
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->getInstall()Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->stopTimer()V

    :cond_2
    :goto_0
    return-void
.end method

.method public decryptFileBackGroundAdvert(Ljava/lang/String;)Z
    .locals 2

    .line 2274
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {}, Lcom/tcn/tools/utils/TcnUtility;->getExternalStorageDirectory()Ljava/lang/String;

    move-result-object v1


cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '1,260p' smali_classes8/com/tcn/cpt_advert/adpoll/ImageTimer.smali && rg -n 'startTime|postDelayed|Timer|schedule|sendEmptyMessageDelayed' smali_classes8/com/tcn/cpt_advert/adpoll/ImageTimer.smali


.class public Lcom/tcn/cpt_advert/adpoll/ImageTimer;
.super Ljava/lang/Object;
.source "ImageTimer.java"

# static fields
.field private static imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

# instance fields
.field awaitTime:J

.field beforeTime:J

.field handler:Landroid/os/Handler;

.field isBaiduAD:Z

.field isPoll:Z

.field final pollTime:I

# direct methods
.method public constructor <init>()V
    .locals 3

    .line 24
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    const/4 v0, 0x0

    .line 26
    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isBaiduAD:Z

    const-wide/16 v1, 0x3e8

    .line 27
    iput-wide v1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->awaitTime:J

    .line 28
    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z

    const/16 v0, 0x44d

    .line 30
    iput v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->pollTime:I

    .line 32
    new-instance v0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;

    invoke-direct {v0, p0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;-><init>(Lcom/tcn/cpt_advert/adpoll/ImageTimer;)V

    iput-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;

    return-void
.end method

.method public static declared-synchronized getInstall()Lcom/tcn/cpt_advert/adpoll/ImageTimer;
    .locals 2

    const-class v0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    monitor-enter v0

    .line 66
    :try_start_0
    sget-object v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    if-nez v1, :cond_0

    .line 67
    new-instance v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    invoke-direct {v1}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;-><init>()V

    sput-object v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    .line 68
    :cond_0
    sget-object v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit v0

    return-object v1

    :catchall_0
    move-exception v1

    monitor-exit v0

    throw v1
.end method

# virtual methods
.method deleteFile(Ljava/util/List;)V
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    if-nez p1, :cond_0

    .line 109
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    const/4 v1, 0x2

    if-ge v0, v1, :cond_0

    return-void

    .line 112
    :cond_0
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/AdDealUtils;->getInstall()Lcom/tcn/cpt_advert/adpoll/AdDealUtils;

    move-result-object v0

    const/4 v1, 0x0

    invoke-interface {p1, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/String;

    invoke-virtual {v0, v2}, Lcom/tcn/cpt_advert/adpoll/AdDealUtils;->getLocalPath(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 113
    new-instance v2, Ljava/io/File;

    invoke-direct {v2, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object v0

    if-eqz v0, :cond_2

    .line 114
    array-length v2, v0

    const/4 v3, 0x1

    if-le v2, v3, :cond_2

    .line 115
    array-length v2, v0

    :goto_0
    if-ge v1, v2, :cond_2

    aget-object v3, v0, v1

    .line 116
    invoke-virtual {v3}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v4

    invoke-interface {p1, v4}, Ljava/util/List;->contains(Ljava/lang/Object;)Z

    move-result v4

    if-nez v4, :cond_1

    .line 117
    invoke-virtual {v3}, Ljava/io/File;->delete()Z

    :cond_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    :cond_2
    return-void
.end method

.method public isPoll()Z
    .locals 1

    .line 77
    iget-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z

    return v0
.end method

.method logx(Ljava/lang/String;Ljava/lang/String;)V
    .locals 3

    .line 124
    invoke-static {}, Lcom/tcn/logger/TcnLog;->getInstance()Lcom/tcn/logger/TcnLog;

    move-result-object v0

    const-string v1, "cpt_advert"

    const-string v2, "ImageTimer"

    invoke-virtual {v0, v1, v2, p1, p2}, Lcom/tcn/logger/TcnLog;->LoggerDebug(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public sendPoll()V
    .locals 4

    .line 72
    iget-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;

    const/16 v1, 0x44d

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    .line 73
    iget-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;

    const-wide/16 v2, 0x3e8

    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    return-void
.end method

.method public startTime()V
    .locals 3

    const/4 v0, 0x1

    .line 82
    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z

    .line 83
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;->getInstall()Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;

    move-result-object v0

    const-wide/16 v1, 0x0

    invoke-virtual {v0, v1, v2}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;->setFlux(J)V

    .line 84
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADpalyName()Ljava/lang/String;

    move-result-object v0
1:.class public Lcom/tcn/cpt_advert/adpoll/ImageTimer;
3:.source "ImageTimer.java"
7:.field private static imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;
34:    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isBaiduAD:Z
39:    iput-wide v1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->awaitTime:J
42:    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z
47:    iput v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->pollTime:I
50:    new-instance v0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;
52:    invoke-direct {v0, p0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;-><init>(Lcom/tcn/cpt_advert/adpoll/ImageTimer;)V
54:    iput-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;
59:.method public static declared-synchronized getInstall()Lcom/tcn/cpt_advert/adpoll/ImageTimer;
62:    const-class v0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;
68:    sget-object v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;
73:    new-instance v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;
75:    invoke-direct {v1}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;-><init>()V
77:    sput-object v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;
81:    sget-object v1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->imageTimer:Lcom/tcn/cpt_advert/adpoll/ImageTimer;
194:    iget-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z
209:    const-string v2, "ImageTimer"
220:    iget-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;
227:    iget-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;
231:    invoke-virtual {v0, v1, v2, v3}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z
236:.method public startTime()V
242:    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z
274:    new-instance v2, Lcom/tcn/cpt_advert/adpoll/ImageTimer$2;
276:    invoke-direct {v2, p0, v0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer$2;-><init>(Lcom/tcn/cpt_advert/adpoll/ImageTimer;Ljava/lang/String;)V
282:    invoke-virtual {p0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->sendPoll()V
287:.method public stopTimer()V
293:    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z
296:    iget-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;


cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '236,320p' smali_classes8/com/tcn/cpt_advert/adpoll/ImageTimer.smali && sed -n '1,220p' smali_classes8/com/tcn/cpt_advert/adpoll/ImageTimer\$1.smali


.method public startTime()V
    .locals 3

    const/4 v0, 0x1

    .line 82
    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z

    .line 83
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;->getInstall()Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;

    move-result-object v0

    const-wide/16 v1, 0x0

    invoke-virtual {v0, v1, v2}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;->setFlux(J)V

    .line 84
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v0

    invoke-virtual {v0}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADpalyName()Ljava/lang/String;

    move-result-object v0

    .line 85
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 86
    invoke-static {}, Lcom/tcn/tools/constants/MyThread;->getInstace()Lcom/tcn/tools/constants/MyThread;

    move-result-object v1

    new-instance v2, Lcom/tcn/cpt_advert/adpoll/ImageTimer$2;

    invoke-direct {v2, p0, v0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer$2;-><init>(Lcom/tcn/cpt_advert/adpoll/ImageTimer;Ljava/lang/String;)V

    invoke-virtual {v1, v2}, Lcom/tcn/tools/constants/MyThread;->execute(Ljava/lang/Runnable;)V

    .line 99
    :cond_0
    invoke-virtual {p0}, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->sendPoll()V

    return-void
.end method

.method public stopTimer()V
    .locals 2

    const/4 v0, 0x0

    .line 104
    iput-boolean v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isPoll:Z

    .line 105
    iget-object v0, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;

    const/16 v1, 0x44d

    invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V

    return-void
.end method
.class Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;
.super Landroid/os/Handler;
.source "ImageTimer.java"

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/tcn/cpt_advert/adpoll/ImageTimer;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation

# instance fields
.field final synthetic this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

# direct methods
.method constructor <init>(Lcom/tcn/cpt_advert/adpoll/ImageTimer;)V
    .locals 0

    .line 32
    iput-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    invoke-direct {p0}, Landroid/os/Handler;-><init>()V

    return-void
.end method

# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 4

    .line 35
    invoke-super {p0, p1}, Landroid/os/Handler;->handleMessage(Landroid/os/Message;)V

    .line 36
    iget p1, p1, Landroid/os/Message;->what:I

    const/16 v0, 0x44d

    if-eq p1, v0, :cond_0

    goto/16 :goto_0

    .line 38
    :cond_0
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v1

    invoke-virtual {v1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADpalyCompany()Ljava/lang/String;

    move-result-object v1

    const-string v2, "\u767e\u5ea6"

    invoke-virtual {v2, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    iput-boolean v1, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isBaiduAD:Z

    .line 39
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADShowType()I

    move-result p1

    const-wide/16 v1, 0x3e8

    if-nez p1, :cond_2

    .line 40
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    iget-object p1, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;

    invoke-virtual {p1, v0, v1, v2}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 41
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    iget-boolean p1, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isBaiduAD:Z

    if-eqz p1, :cond_1

    .line 42
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/baidu/AdpollbaiduScree;->getInstall()Lcom/tcn/cpt_advert/adpoll/baidu/AdpollbaiduScree;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_advert/adpoll/baidu/AdpollbaiduScree;->playAD()V

    goto :goto_0

    .line 44
    :cond_1
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;->getInstall()Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlScree;->playAD()V

    goto :goto_0

    :cond_2
    const/4 p1, 0x1

    .line 46
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v3

    invoke-virtual {v3}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADShowType()I

    move-result v3

    if-ne p1, v3, :cond_4

    .line 47
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    iget-object p1, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;

    invoke-virtual {p1, v0, v1, v2}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 48
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    iget-boolean p1, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->isBaiduAD:Z

    if-eqz p1, :cond_3

    .line 49
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/baidu/AdpollbaiduMain;->getInstall()Lcom/tcn/cpt_advert/adpoll/baidu/AdpollbaiduMain;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_advert/adpoll/baidu/AdpollbaiduMain;->playAD()V

    goto :goto_0

    .line 51
    :cond_3
    invoke-static {}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlMain;->getInstall()Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlMain;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_advert/adpoll/yishou/AdpollControlMain;->playAD()V

    goto :goto_0

    .line 54
    :cond_4
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    iget-object p1, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->handler:Landroid/os/Handler;

    const-wide/16 v1, 0x1388

    invoke-virtual {p1, v0, v1, v2}, Landroid/os/Handler;->sendEmptyMessageDelayed(IJ)Z

    .line 55
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    iget-wide v2, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->beforeTime:J

    sub-long/2addr v0, v2

    const-wide/32 v2, 0xea60

    cmp-long p1, v0, v2

    if-lez p1, :cond_5

    .line 56
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v0

    iput-wide v0, p1, Lcom/tcn/cpt_advert/adpoll/ImageTimer;->beforeTime:J

    .line 57
    iget-object p1, p0, Lcom/tcn/cpt_advert/adpoll/ImageTimer$1;->this$0:Lcom/tcn/cpt_advert/adpoll/ImageTimer;

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "\u5e7f\u544a\u5f02\u5e38\uff1a"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object v1

    invoke-virtual {v1}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getADShowType()I

    move-result v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;


**Assessing timer functionality**

I’m realizing the ImageTimer serves as a playback timer rather than a sync scheduler. The RequestAdvert can only be called at app initialization, which is enough for boot-time sync but not for periodic content refresh. I think I need to search for any requestAdvert call sites beyond the initial one to see if there might be callbacks after downloads. It's possible I could add a patch for a callback, but that might be hard. Given the user’s request for a periodic sync, I should implement a practical solution that works with the available setup.

**Exploring implementation options**

I’m considering the easiest approach might be to add a periodic call to requestAdvert() in the ImageTimer handler after a minute anomaly. However, I could also modify the TcnAdvertControl.requestAdvert callback, or perhaps the dealADModel, to set a Handler that manages scheduling. It could be complex, but using an existing Android handler seems simpler than manually editing smali, which I know is error-prone. Given time constraints, maybe it's best to consult about the risks involved in decompiling the APK, especially if the user was adamant about it.

**Investigating button functionality**

I need to find how the system menu handles clicks, specifically to swap out the USB copy ads button for a remote request. I noticed the `copy_ads_from_u_disk` string in the AndroidSystemFragment's onClick method. Instead of copying ads, I could call requestAdvert when that button is clicked, and maybe restart or reboot prompts with the existing reboot button. I should inspect the layout IDs for the AndroidSystemFragment buttons. Repurposing `btCopyAds` and `btDeleteAllAds` to "Sync now" and "Restart app" could be a viable option, especially if it doesn't require resource changes.

cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && rg -n 'btCopyAds|btDeleteAllAds|tvRebootRegularly|btBackupLog|btRestore' smali_classes8/com/tcn/background/standard/fragmentv2/system/AndroidSystemFragment.smali | head -n 100


31:.field private btCopyAds:Landroid/widget/Button;
35:.field private btDeleteAllAds:Landroid/widget/Button;
43:.field private btRestore:Landroid/widget/Button;
123:.field private tvRebootRegularly:Landroid/widget/TextView;
340:    iget-object p0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btDeleteAllAds:Landroid/widget/Button;
382:    iget-object p0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btCopyAds:Landroid/widget/Button;
2101:    sget v1, Lcom/tcn/background/R$id;->btDeleteAllAds:I
2106:    iget-object p1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btDeleteAllAds:Landroid/widget/Button;
2133:    iget-object p1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btDeleteAllAds:Landroid/widget/Button;
2168:    sget v1, Lcom/tcn/background/R$id;->btCopyAds:I
2192:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btCopyAds:Landroid/widget/Button;
2479:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btCopyAds:Landroid/widget/Button;
2642:    sget v1, Lcom/tcn/background/R$id;->btRestore:I
3585:    sget p1, Lcom/tcn/background/R$id;->btDeleteAllAds:I
3593:    iput-object p1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btDeleteAllAds:Landroid/widget/Button;
3596:    sget p1, Lcom/tcn/background/R$id;->btCopyAds:I
3604:    iput-object p1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btCopyAds:Landroid/widget/Button;
3629:    sget p1, Lcom/tcn/background/R$id;->btRestore:I
3637:    iput-object p1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btRestore:Landroid/widget/Button;
3684:    sget p1, Lcom/tcn/background/R$id;->tvRebootRegularly:I
3692:    iput-object p1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvRebootRegularly:Landroid/widget/TextView;
4304:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btDeleteAllAds:Landroid/widget/Button;
4318:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btDeleteAllAds:Landroid/widget/Button;
4344:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btCopyAds:Landroid/widget/Button;
4358:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btCopyAds:Landroid/widget/Button;
4364:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btRestore:Landroid/widget/Button;
4378:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btRestore:Landroid/widget/Button;
4424:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvRebootRegularly:Landroid/widget/TextView;
4438:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvRebootRegularly:Landroid/widget/TextView;
5533:    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvRebootRegularly:Landroid/widget/TextView;


**Evaluating click cases**

I need to focus on the onClick cases around 4304 and beyond. It seems like there will be a significant amount of text set. But I also have to remember that the click dispatcher might be set for 5533 later. So, I’d like to inspect everything from 5480 onward to ensure I’ve got a full picture of what’s happening. It feels like I need to gather more information to get this right!

cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '5480,5605p' smali_classes8/com/tcn/background/standard/fragmentv2/system/AndroidSystemFragment.smali


    .line 525
    invoke-virtual {p1, v1}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    .line 527
    :cond_3e
    invoke-direct {p0}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->initSkinStr()V

    .line 528
    invoke-static {}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->getInstance()Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->isSystemSpecialLanguage()Z

    move-result p1

    if-nez p1, :cond_3f

    invoke-static {}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->getInstance()Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->isBackgroundSpecialLanguage()Z

    move-result p1

    if-eqz p1, :cond_40

    :cond_3f
    const/16 p1, 0xf

    new-array p1, p1, [Landroid/widget/TextView;

    .line 529
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvKeepFront:Landroid/widget/TextView;

    aput-object v0, p1, v6

    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tv_choose_language_show:Landroid/widget/TextView;

    aput-object v0, p1, v5

    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvSkinPlugin:Landroid/widget/TextView;

    aput-object v0, p1, v3

    const/4 v0, 0x3

    iget-object v2, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvWatchDog:Landroid/widget/TextView;

    aput-object v2, p1, v0

    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvRebootRegularly:Landroid/widget/TextView;

    aput-object v0, p1, v4

    const/4 v0, 0x5

    iget-object v2, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tv_use_start:Landroid/widget/TextView;

    aput-object v2, p1, v0

    const/4 v0, 0x6

    iget-object v2, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tv_start_image:Landroid/widget/TextView;

    aput-object v2, p1, v0

    const/4 v0, 0x7

    iget-object v2, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvDebug_model:Landroid/widget/TextView;

    aput-object v2, p1, v0

    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tv_hint_version:Landroid/widget/TextView;

    aput-object v0, p1, v1

    const/16 v0, 0x9

    iget-object v1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvRebootTime:Landroid/widget/TextView;

    aput-object v1, p1, v0

    const/16 v0, 0xa

    iget-object v1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvControlToSelectPayM:Landroid/widget/TextView;

    aput-object v1, p1, v0

    const/16 v0, 0xb

    iget-object v1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvQuickGuide:Landroid/widget/TextView;

    aput-object v1, p1, v0

    const/16 v0, 0xc

    iget-object v1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvPrinter:Landroid/widget/TextView;

    aput-object v1, p1, v0

    const/16 v0, 0xd

    iget-object v1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvPrinterTitle:Landroid/widget/TextView;

    aput-object v1, p1, v0

    const/16 v0, 0xe

    iget-object v1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvControlToBackground:Landroid/widget/TextView;

    aput-object v1, p1, v0

    invoke-direct {p0, p1}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->setViewDirection([Landroid/widget/TextView;)V

    :cond_40
    return-void
.end method

.method protected onResumeLazy()V
    .locals 2

    .line 566
    invoke-super {p0}, Lcom/tcn/background/standard/fragmentv2/V2BaseLazyFragment;->onResumeLazy()V


cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && rg -n '^\.method public onClick' smali_classes8/com/tcn/background/standard/fragmentv2/system/AndroidSystemFragment.smali && sed -n '760,1040p' smali_classes8/com/tcn/background/standard/fragmentv2/system/AndroidSystemFragment.smali


1611:.method public onClick(Landroid/view/View;)V
    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    .line 1293
    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v0, "\u590d\u5236apk\u547d\u4ee4:"

    invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-virtual {p0, p2}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->logx(Ljava/lang/String;)V

    .line 1294
    invoke-static {p1}, Lcom/tcn/tools/utils/TcnUtility;->execShellCmdWithResult(Ljava/lang/String;)Z

    move-result p1

    return p1

    :cond_2
    const/4 p1, 0x0

    return p1
.end method

.method private getAdvertPath(Ljava/lang/String;)Ljava/lang/String;
    .locals 2

    .line 1303
    invoke-static {}, Lcom/tcn/tools/utils/Utils;->getExternalStorageDirectory()Ljava/lang/String;

    move-result-object v0

    .line 1304
    invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 1305
    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v0, "/"

    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    :cond_0
    return-object p1
.end method

.method private getAllChildren(Landroid/view/View;)Ljava/util/ArrayList;
    .locals 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/view/View;",
            ")",
            "Ljava/util/ArrayList<",
            "Landroid/view/View;",
            ">;"
        }
    .end annotation

    .line 573
    instance-of v0, p1, Landroid/view/ViewGroup;

    if-nez v0, :cond_0

    .line 574
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 575
    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-object v0

    .line 578
    :cond_0
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 579
    move-object v1, p1

    check-cast v1, Landroid/view/ViewGroup;

    const/4 v2, 0x0

    .line 580
    :goto_0
    invoke-virtual {v1}, Landroid/view/ViewGroup;->getChildCount()I

    move-result v3

    if-ge v2, v3, :cond_1

    .line 581
    invoke-virtual {v1, v2}, Landroid/view/ViewGroup;->getChildAt(I)Landroid/view/View;

    move-result-object v3

    .line 582
    new-instance v4, Ljava/util/ArrayList;

    invoke-direct {v4}, Ljava/util/ArrayList;-><init>()V

    .line 583
    invoke-virtual {v4, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 584
    invoke-direct {p0, v3}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getAllChildren(Landroid/view/View;)Ljava/util/ArrayList;

    move-result-object v3

    invoke-virtual {v4, v3}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    .line 585
    invoke-virtual {v0, v4}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_1
    return-object v0
.end method

.method private getRebootTimeInfo()V
    .locals 4

    const/4 v0, 0x0

    .line 536
    :goto_0
    iget-object v1, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->reBootTimeInfo:[Ljava/lang/String;

    array-length v2, v1

    if-ge v0, v2, :cond_0

    .line 537
    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v3, ":00"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    aput-object v2, v1, v0

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :cond_0
    return-void
.end method

.method private getUsbPath()Ljava/lang/String;
    .locals 1

    .line 1318
    new-instance v0, Lcom/tcn/background/standard/util/USBpath;

    invoke-direct {v0}, Lcom/tcn/background/standard/util/USBpath;-><init>()V

    .line 1319
    invoke-static {}, Lcom/tcn/background/standard/util/USBpath;->getPath()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private hidePrinterTitle()V
    .locals 2

    .line 1264
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->rlPrinter:Landroid/widget/RelativeLayout;

    const/16 v1, 0x8

    invoke-virtual {v0, v1}, Landroid/widget/RelativeLayout;->setVisibility(I)V

    .line 1265
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvPrinterTitle:Landroid/widget/TextView;

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setVisibility(I)V

    .line 1266
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->etPrinterTitle:Landroid/widget/EditText;

    invoke-virtual {v0, v1}, Landroid/widget/EditText;->setVisibility(I)V

    .line 1267
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btPrinterTitle:Landroid/widget/Button;

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setVisibility(I)V

    return-void
.end method

.method private initSkinStr()V
    .locals 2

    .line 551
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btPrinterTitle:Landroid/widget/Button;

    sget v1, Lcom/tcn/background/R$string;->change:I

    invoke-virtual {p0, v1}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getStringSkin(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 552
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->clear_app:Landroid/widget/Button;

    sget v1, Lcom/tcn/background/R$string;->app_clear_garbage:I

    invoke-virtual {p0, v1}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getStringSkin(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 553
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->btn_change_start_image:Landroid/widget/Button;

    sget v1, Lcom/tcn/background/R$string;->launch_page_setting_image:I

    invoke-virtual {p0, v1}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getStringSkin(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/Button;->setText(Ljava/lang/CharSequence;)V

    .line 554
    iget-object v0, p0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->tvKeepFront:Landroid/widget/TextView;

    sget v1, Lcom/tcn/background/R$string;->keep_app_front_running:I

    invoke-virtual {p0, v1}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getStringSkin(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V


cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '1611,1825p' smali_classes8/com/tcn/background/standard/fragmentv2/system/AndroidSystemFragment.smali


.method public onClick(Landroid/view/View;)V
    .locals 9

    .line 601
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    sget v1, Lcom/tcn/background/R$id;->btn_change_start_image:I

    if-ne v0, v1, :cond_1

    .line 602
    invoke-static {}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->getInstance()Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;

    move-result-object p1

    invoke-virtual {p1}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->getStartImageGoodsPath()Ljava/lang/String;

    move-result-object p1

    .line 603
    new-instance v0, Ljava/io/File;

    invoke-direct {v0, p1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 604
    invoke-virtual {v0}, Ljava/io/File;->exists()Z

    move-result p1

    if-nez p1, :cond_0

    .line 605
    invoke-virtual {v0}, Ljava/io/File;->mkdir()Z

    .line 608
    :cond_0
    invoke-static {}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->getInstance()Lcom/tcn/tools/ysConfig/TcnShareUseData;

    move-result-object p1

    const-string v0, "start_image"

    invoke-virtual {p1, v0}, Lcom/tcn/tools/ysConfig/TcnShareUseData;->setImgAndDetailsImg(Ljava/lang/String;)V

    .line 609
    new-instance p1, Landroid/content/Intent;

    invoke-virtual {p0}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getContext()Landroid/content/Context;

    move-result-object v1

    const-class v2, Lcom/tcn/bcomm/AislePics;

    invoke-direct {p1, v1, v2}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    .line 610
    invoke-virtual {p1, v0, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    const/16 v0, 0xa6

    .line 611
    invoke-virtual {p0, p1, v0}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->startActivityForResult(Landroid/content/Intent;I)V

    goto/16 :goto_6

    .line 612
    :cond_1
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    sget v1, Lcom/tcn/background/R$id;->clear_app:I

    if-ne v0, v1, :cond_2

    .line 614
    :try_start_0
    invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

    move-result-object p1

    invoke-virtual {p1}, Ljava/lang/Runtime;->gc()V

    .line 615
    new-instance p1, Lcom/tcn/background/standard/dialog/LoadingDialog;

    invoke-virtual {p0}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p1, v0}, Lcom/tcn/background/standard/dialog/LoadingDialog;-><init>(Landroid/content/Context;)V

    .line 616
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    sget v1, Lcom/tcn/background/R$string;->app_clear_garbage:I

    invoke-virtual {p0, v1}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getStringSkin(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v1, "..."

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x5

    invoke-virtual {p1, v0, v1}, Lcom/tcn/background/standard/dialog/LoadingDialog;->show(Ljava/lang/String;I)V

    .line 617
    new-instance v0, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment$6;

    invoke-direct {v0, p0}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment$6;-><init>(Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;)V

    invoke-virtual {p1, v0}, Lcom/tcn/background/standard/dialog/LoadingDialog;->setOnDismissListener(Landroid/content/DialogInterface$OnDismissListener;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto/16 :goto_6

    :catch_0
    move-exception p1

    .line 624
    invoke-static {}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->getInstance()Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;

    move-result-object v0

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "\u6e05\u7406\u7f13\u5b58 e = "

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v1, "AndroidSystemFragment"

    invoke-virtual {v0, v1, p1}, Lcom/tcn/cpt_board/vend/controller/TcnBoardIF;->LoggerDebug(Ljava/lang/String;Ljava/lang/String;)V

    .line 625
    sget p1, Lcom/tcn/background/R$string;->app_clear_garbage_fail:I

    invoke-virtual {p0, p1}, Lcom/tcn/background/standard/fragmentv2/system/AndroidSystemFragment;->getStringSkin(I)Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Lcom/hjq/toast/ToastUtils;->show(Ljava/lang/CharSequence;)V

    goto/16 :goto_6

    .line 627
    :cond_2
    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v0

    sget v1, Lcom/tcn/background/R$id;->bt2Es:I

    const/4 v2, 0x1

    const/4 v3, 0x0

    if-ne v0, v1, :cond_5

    .line 629
    :try_start_1
    new-instance p1, Landroid/content/Intent;

    invoke-direct {p1}, Landroid/content/Intent;-><init>()V

    const-string v0, "rk3568_r"

    .line 631
    sget-object v1, Landroid/os/Build;->MODEL:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_4

    invoke-static {}, Lcom/tcn/tools/utils/TcnUtility;->isAndroidBoardQY3568()Z

    move-result v0

    if-eqz v0, :cond_3

    goto :goto_0

    .line 634
    :cond_3
    new-instance v0, Landroid/content/ComponentName;

    const-string v1, "com.estrongs.android.pop"

    const-string v4, "com.estrongs.android.pop.view.FileExplorerActivity"

    invoke-direct {v0, v1, v4}, Landroid/content/ComponentName;-><init>(Ljava/lang/String;Ljava/lang/String;)V


2101:    sget v1, Lcom/tcn/background/R$id;->btDeleteAllAds:I
2168:    sget v1, Lcom/tcn/background/R$id;->btCopyAds:I
2642:    sget v1, Lcom/tcn/background/R$id;->btRestore:I
3585:    sget p1, Lcom/tcn/background/R$id;->btDeleteAllAds:I
3596:    sget p1, Lcom/tcn/background/R$id;->btCopyAds:I
3629:    sget p1, Lcom/tcn/background/R$id;->btRestore:I
3684:    sget p1, Lcom/tcn/background/R$id;->tvRebootRegularly:I


cd /home/sebas/work/tasks/T-001-tcn-apk/decompiled-smali && sed -n '2060,2198p' smali_classes8/com/tcn/background/standard/fragmentv2/system/AndroidSystemFragment.smali && sed -n '2620,2688p' smali_classes8/com/tcn/background/standard/fragmentv2/system/AndroidSystemFragment.smali