How thecybersandeep/apkauditor works
1. Overall shape
- This is a single-page, fully client-side APK analysis tool.
- The architecture is intentionally flat: index.html provides the UI, apk-analyzer.js contains nearly all analysis logic, and lib/ holds third-party browser libraries.
- There is no backend service, database, or upload pipeline; the APK is processed entirely in the user’s browser.
2. Primary boundary: browser-only execution
- The key architectural boundary is between the local APK file chosen by the user and the in-memory analysis workspace inside the browser.
- All extraction, parsing, scanning, browsing, and PDF generation happen locally, so the system’s trust and privacy model depends on client-side execution only.
3. Presentation layer
- index.html is the presentation shell for the whole product.
- It hosts the drag-and-drop entry point, tabbed views, search, findings navigation, code browsing, manifest/component views, and report export controls.
- Since there is no server-rendered layer, the UI is the main orchestration surface for the analysis workflow.
4. Analysis engine
- apk-analyzer.js is the core subsystem and likely acts as both parser and coordinator.
- It is responsible for taking the APK archive, unpacking its contents, dispatching parsers for different file types, building the analysis model, and wiring results back to the UI.
- The repository structure suggests a monolithic client-side analyzer rather than a set of isolated services.
5. APK ingestion and archive extraction
- The first data flow is: APK file → ZIP extraction → file inventory.
- JSZip from lib/jszip.min.js is used to read the APK as a ZIP archive and enumerate its internal files.
- This extracted file set becomes the shared source for later subsystems such as DEX analysis, manifest parsing, file explorer, and tracker detection.
6. DEX analysis pipeline
- Multi-DEX support means the analyzer processes classes.dex through classes9.dex as a combined code corpus.
- The DEX subsystem turns bytecode into higher-level representations: Java-like pseudocode, Smali disassembly, class trees, method lists, field lists, and string tables.
- This is the main source of evidence for both code browsing and many security findings.
7. Security scanning subsystem
- A rule-based scanner searches the decompiled code and extracted strings for security issues.
- The rules cover several domains: storage misuse, weak crypto, insecure network handling, component exposure, WebView misconfiguration, secrets, reflection/dynamic loading, and native library usage.
- Findings are enriched with security taxonomy labels such as CWE, OWASP Mobile Top 10, and MASVS, which makes the scanner a reporting layer as well as a detection layer.
8. Android manifest and component analysis
- The manifest parser decodes binary AXML to expose app metadata and security-relevant configuration.
- It extracts exported activities, services, receivers, providers, permissions, SDK levels, backup settings, deep links, and custom permissions.
- Component inspection sits on top of this and generates testable ADB commands for exported entry points, making it a specialized analysis view rather than a separate pipeline.
9. Certificate and signing analysis
- The tool also parses APK signing certificates from PKCS#7/DER data.
- This is a distinct subsystem because it does not depend on DEX decompilation; it operates on the APK’s signing metadata.
- In architecture terms, it is a package-level trust and provenance check alongside code and manifest analysis.
10. Tracker and SDK detection
- Tracker detection is implemented as a string/signature matching layer over the extracted DEX content.
- It identifies common ad SDKs, analytics libraries, crash reporters, and payment libraries.
- This subsystem is separate from security scanning: it is about third-party ecosystem fingerprinting rather than vulnerability detection.
11. File explorer and artifact viewing
- The file explorer exposes the APK as a browsable package, not just as code.
- It supports inspection of XML, JSON, images, SQLite databases, native .so files, and other embedded assets with appropriate renderers such as syntax highlighting or hex view.
- This is the artifact exploration boundary between raw package contents and derived analysis results.
12. Reporting and export
- Findings can be exported into a PDF report using jspdf from lib/jspdf.umd.min.js.
- The report layer consumes the already-built analysis model rather than rerunning analysis, which keeps reporting as a downstream output stage.
- That makes the flow: analysis model → UI views and PDF report.
13. Key runtime and dependency implications
- The runtime is a modern browser; the README explicitly targets Chrome, Firefox, and Edge.
- The project is JavaScript-only on the client side, which shapes everything: memory-based processing, local file access via browser APIs, and no external calls.
- The only substantive third-party dependencies are ZIP extraction and PDF generation.
14. Deployment and hosting
- CNAME indicates the project is meant to be hosted as a static site, likely via a custom domain.
- That fits the architecture: static assets served to the browser, with all meaningful computation happening after the page loads.
- For diagramming, treat deployment as a static front end with no application server.
15. Good diagram summary
- The main architecture diagram should show:
- User drops APK into browser UI
- UI passes file to client-side analyzer
- Analyzer extracts archive contents
- Parallel parsers process DEX, manifest, certificates, and assets
- Rule engine produces security findings and tracker/component metadata
- UI renders tabs and search results
- PDF export consumes the same analysis results
- The critical architectural message is that this is a local, browser-based APK forensics and security analysis pipeline, not a networked application.
Main entry points: apk-analyzer.js Analyzer Core · index.html UI Shell
Components 17
Browser App
Static single-page APK analysis tool running fully in the browser.
- APK File · Local APK selected or dropped by the user for analysis.
- UI Shell · Presentation layer with drag-and-drop entry, tabs, search, findings, artifact views, and export controls.
index.html
Client Analysis
In-browser APK ingestion, parsing, scanning, browsing, and reporting pipeline.
- Analyzer Core · Monolithic browser-side engine that coordinates extraction, parsing, scanning, and model assembly.
apk-analyzer.js - Archive Extract · Reads the APK as a ZIP archive and enumerates internal files.
- File Inventory · Shared in-memory set of extracted APK files used by downstream analyses.
- DEX Pipeline · Processes classes.dex through multi-DEX inputs into code representations and symbols.
- Code Views · Java-like output, Smali disassembly, class trees, method lists, field lists, and strings.
- Manifest Parser · Decodes AndroidManifest metadata and component configuration from binary XML.
- Components · Summarizes exported activities, services, receivers, providers, permissions, and test commands.
- Signing Check · Parses APK signing certificates and provenance metadata from PKCS#7 or DER data.
- Tracker Scan · Fingerprints ads, analytics, crash reporting, payment, and other third-party SDKs.
- Security Rules · Finds weak crypto, insecure storage, WebView issues, secrets, reflection, native usage, and other risks.
- Findings Model · Unified in-memory result set consumed by UI views and report export.
- Artifact Browser · Browses XML, JSON, images, SQLite databases, native libraries, and other embedded assets.
- PDF Export · Builds downloadable reports from the completed analysis model.
Vendor Libraries
Third-party browser dependencies used for archive reading and PDF export.
- JSZip · Browser ZIP library used to read APK archives.
- jsPDF · Browser PDF library used for report generation.
Connections 23
- APK File → UI Shell: drop/select · User provides the APK through the browser interface.
- UI Shell → Analyzer Core: invoke · UI hands the selected APK to the client-side analyzer.
- Analyzer Core → JSZip: read archive · Analyzer uses JSZip to unpack the APK as a ZIP archive.
- JSZip → Archive Extract: enumerate files · ZIP reader produces the APK file listing and contents.
- Archive Extract → File Inventory: build inventory · Extracted files become the shared package inventory.
- File Inventory → DEX Pipeline: provide dex · DEX analysis consumes the extracted bytecode files.
- DEX Pipeline → Code Views: emit views · Decompiler and disassembler outputs feed code browsing.
- File Inventory → Manifest Parser: provide manifest · Manifest analysis reads binary XML from the package inventory.
- Manifest Parser → Components: summarize · Parsed manifest data becomes exported component and permission views.
- File Inventory → Signing Check: provide signing data · Signing metadata is parsed from package contents.
- File Inventory → Artifact Browser: browse assets · Raw package contents are exposed through artifact viewers.
- DEX Pipeline → Tracker Scan: fingerprint · Tracker detection matches SDK and library signatures in code and strings.
- DEX Pipeline → Security Rules: scan code · Rule engine scans decompiled code and extracted strings for issues.
- Manifest Parser → Security Rules: scan config · Security checks also use manifest configuration and component exposure.
- Tracker Scan → Findings Model: record results · Tracker matches are added to the unified analysis model.
- Security Rules → Findings Model: record findings · Security findings are aggregated into the unified result set.
- Components → Findings Model: add metadata · Component exposure and testable entry points enrich the result model.
- Signing Check → Findings Model: add provenance · Signing and certificate data contribute trust-related metadata.
- Artifact Browser → Findings Model: link artifacts · Browsable files are connected back to the analysis workspace.
- Findings Model → UI Shell: render tabs · UI renders search, findings, code browsing, manifest views, and reports from the shared model.
- Findings Model → PDF Export: export report · PDF generation consumes the completed analysis model without rerunning analysis.
- PDF Export → jsPDF: generate pdf · Report output is built with jsPDF in the browser.
- Analyzer Core → Findings Model: assemble model · Analyzer coordinates all parsers and produces the unified workspace state.