Can AI Recover the Source Code of a Published Android App? We Tested It on Our Own
- We took the published Android package of an app we had built and shipped, and asked an AI coding agent to turn it back into a project a developer could work on. No repository, no team, no backend access.
- After roughly one day of engineer time we had a build that installed and ran. Turning it into code you could maintain took most of the remaining time. The whole recovery took around 30 hours of engineer time, plus 8 hours of independent senior review.
- Every secret in the binary was readable. So was the full API map. Standard obfuscation (code shrinking and renaming) made no difference to reading the app; it only slowed down turning it into code a human would maintain.
- Three things did not come back: the native component (binary only), the code generators and build setup, and the tests. That is where the real value of a codebase lives, and it is not in the store.

Does compiling an app still protect it?
For years, compiling a mobile app was treated as a form of protection. It added enough friction that reading the logic out of a published package took a specialist days or weeks, and most of the time nobody bothered.
That friction is gone. In October 2026, decompiled versions of commercial games were circulating within days of agents being pointed at them, and the publishers answered with legal action. Security vendors have been writing about AI-assisted reverse engineering for a year. What we had not seen was anyone taking an app they had built themselves, running the experiment end to end, and reporting what came back, including the parts that didn't.
So we did it. The app was a consumer-facing Android product Nomtek had built and shipped: a native Kotlin app with a web layer inside it and a compiled native component for the heavy lifting. What we did not have was the source: after handover we were required to delete it, so this was a real no-repository scenario. The only reference points were the public developer documentation and the memory of the team that had built it. The experiment was done by Wojciech Dawiskiba from nomtek Labs. The agent was Codex, working directly with jadx and Apktool that were already set up on the engineer's machine, plus a standard mobile security scanner. No special skill or plugin was needed; extraction worked out of the box. We never touched the backend and never ran anything against the live service beyond a single authorized check that the rebuilt app actually works.
How we recovered an Android app without the source code
The process had four steps, and the agent did most of each.
Build domain context first. Before opening the binary, the agent read the public product pages and the developer documentation for the integration. This matters more than it sounds: a decompiler gives you structure, and the public docs give you the names for it.
Decompile. The published package was 42.7 MB across twenty APKs (one base and nineteen configuration splits). Inside: 8,386 classes, 41,384 methods, three native libraries, a few JavaScript assets and all resources. The agent inventoried everything, verified signatures, and decoded the bytecode to Smali and to a decompiled Java interpretation.
Reconstruct. From Smali and resources, the agent rebuilt an Android project that compiles: Kotlin, Gradle, manifest, resources, dependencies pinned from the version markers left inside the package. First it assembled a complete, editable mirror of the original (every class, every method, same resource IDs), then wrote readable Kotlin on top of it, screen by screen, with tests.
Refactor. Several rounds of renaming toward domain language, splitting responsibilities, adding tests, and a senior code review targeted at the specific kinds of mistakes an agent makes when it reconstructs code it does not fully understand.
Engineer time: about five hours for the decompilation, four and a half for the first Smali-to-Kotlin pass, then roughly eighteen hours of restructuring, quality work and review rounds, and three hours for tests, the security pass and conclusions. In total that is around thirty hours, plus eight hours of independent review. The agent ran for much longer than that.
What AI recovered from the published package
The logic: fully readable
The rebuilt app installs, cold-launches, and passes through its screens. Routing, the web layer with its request interception, the orchestration of the main user flow, local persistence, diagnostics and telemetry all exist as readable Kotlin now, with 215 unit tests and 60 device tests that did not exist in the binary.
Does R8 obfuscation protect an Android app from AI?
Obfuscation was on, using standard R8 shrinking and renaming. Helper classes came out as m6.a and g5.b, and the final ledger still lists about four thousand class identities that could not be attributed to anything named. The agent did not care. It read and followed obfuscated code without trouble; the classes declared in the manifest keep their names by design, Kotlin metadata survives, JSON field names survive, URL paths survive. That was enough to hang the skeleton on and dress it in the domain vocabulary built in the first step. Where obfuscation did cost us was later: turning that code into something a human would maintain took longer. If all you want is distillation (understanding the app, copying it or modifying it), none of the refactoring is necessary: you can stop after the first extraction pass and have the agent talk you through the logic. For reverse engineering, piracy or customisation, obfuscation made no difference at all.
This applies to standard R8, which is what most apps ship with. Layered protection such as stronger obfuscation, encryption, integrity checks and anti-tampering is a separate question. Vendors such as Licel argue that it removes exactly the context an AI agent relies on. We did not test that.
The secrets: in plain sight
Everything the app needs to talk to its backend is in the package: the API base URL, six endpoints with their request and response shapes, fifty-six data models, a separate upload path with its own token header, the analytics configuration, and a credential-like constant on the entry path. None of this required cleverness. It is what a security scanner prints out in minutes, and what an agent will happily organise into a reference document. Finding hardcoded secrets is a standard part of mobile security testing (see the OWASP MASTG), and recent research already evaluates how well LLMs do it.
The important nuance: the engineers who had built the app took part in reviewing the result, and every item on the list was something they already knew about and had consciously accepted for that product. That is the right answer for a lot of apps. A client-side secret is going to be read; the question is what it can do once it is. The practice that matters is scoping: each key carries the minimum privilege it needs, so reading it buys an attacker as little as possible. This matters most where a key can reach personal data. HR and workforce apps hold data about candidates and employees, so the first question to ask is what a key read from the package can actually reach.
The same caution applies to the agent itself. Simon Willison has written about building a tool so he could edit a credentials file without passing those credentials through the model. When you point an agent at a package, assume that everything it reads ends up in its context.
What can't be recovered from a published APK
This is the half of the result we find more useful, and the half the security articles leave out.
The original project had a separate SDK module, published on its own. After reconstruction it is a sub-package. The original API client was generated from a specification; after reconstruction there is only the output, and the generator is a thing you have to know existed. Bindings to the native component were generated too; the agent regenerated the declarations from metadata inside the library (599 of them), but the implementation is still a binary we reuse, and we have no source for it. Recovering that source is possible, but it needs a separate decompilation and restore pass for the native library, which was outside the scope of this test. And the tests: a published binary contains none, so everything you see in the rebuilt project was written from scratch, from inferred behaviour, and the coverage was uneven until someone sat down and measured it.
What survives compilation is behaviour. What does not survive is intent: how the code was organised, what was generated versus written, what was tested and why. An agent can reconstruct the first. The second cannot be recovered, so the practical approach is to shape the recovered code the way you want to maintain it and stop looking for the shape it used to have.
What this means for field service and medtech apps
Field service apps are a common case. A technician or dealer app is often built by an external agency, handed over and then left running for years, while it holds keys to ERP systems, parts catalogues or telematics APIs. If that vendor has moved on, the build in the store may be the most complete copy of the app you still have.
In medtech, the missing half matters most. A recovered codebase gives you the app's behaviour, but a regulated product also needs its test history, build configuration and traceability, and none of that is in the binary. Recovery can be a starting point for rebuilding that documentation, and it is worth planning for from day one.
What this is not
Not "good code" out of the box. The first Kotlin that came back was poorly structured and hard to read. Even after agent-led refactoring toward domain names and a clean architecture, there were mistakes that mixed concepts (a val repository = interactor kind of mistake) while the app kept working. A general review did not catch them; a review targeted at that specific class of error did. The more complex the original class, the worse its reconstruction read.
Not a reconstruction of the native part. The compiled component works because we reuse the original binary. Its source is not recovered and this experiment makes no claim about it.
Not an attack. We decompiled our own work, touched no backend, and published nothing that identifies the application. Decompiling software you have rights to is one thing; redistributing what comes out is another, and the recent game cases are a reminder of where that line sits.
Not Android-specific in spirit. Other platforms and other build setups will be harder or easier in detail. The direction is the same: the cost of reading published software is dropping; the cost of protecting it is not.
Questions worth asking about your own app
- What is in your published package that you would not want to see in a public repository?
- For each key in it: what is the smallest set of privileges it needs, and does it have more?
- Do you have the source code of every app you have in the store? The agency that built it and has since moved on, the SDK that was published separately, the version that is still live?
- When did someone last look at your app from the store side rather than from the repository side?
Where Nomtek can help
We are not in the business of selling fear about this. Three conversations we are happy to have:
- A look at an app from the store side: what is readable, what it authorises, and what, if anything, should change.
- Recovering a project from a binary when the source is gone and you hold the rights, honestly scoped, including the parts that will not come back.
- Maintenance in which rotating a key or updating a trust store is a routine task rather than an incident.
Each one starts with understanding your context.
If any of this sounds like your situation, write to hello@nomtek.com. We can start with a sixty-minute call with no commitment.
FAQ
Can AI recover the source code of an Android app?
Yes. In our test, Codex working with jadx and Apktool turned a 42.7 MB published package into an Android project that builds after about one day of engineer time. Getting to code developers can maintain took around 30 hours in total.
Does R8 obfuscation protect an Android app from AI?
In our test it did not stop the agent from reading the app. Manifest class names, Kotlin metadata, JSON field names and URL paths survive compilation, and that was enough to follow the logic. Obfuscation slowed down only the later work of turning the code into something a human would maintain.
What can't be recovered from an APK?
The source of native components, code generators, build configuration, the original module structure and the tests. The code generators, the build configuration, the original module structure and the tests do not survive compilation. The source of native components can be recovered too, but each native library needs its own decompilation and restore pass, which we did not run in this test.
How long did the recovery take?
Around 30 hours of engineer time plus 8 hours of independent senior review, for an app with 8,386 classes and 41,384 methods.
Sources
Cited
- Stratechery, Ben Thompson — "Game Decompilation, Is This Legal?, A Well-Trodden Path", Stratechery Update, 6 October 2026 (publishers' legal responses to LLM-decompiled games; examples reported via X and gaming press)
- Simon Willison — "web-edit", 12 October 2026, https://simonwillison.net/2026/Oct/12/web-edit/ (keeping secrets out of the model's context)
- OWASP Mobile Application Security Testing Guide, https://mas.owasp.org/MASTG/
- Evaluating Large Language Models in detecting Secrets in Android Apps, arXiv 2510.18601, https://arxiv.org/abs/2510.18601
- Licel — "Can AI reverse engineer a mobile app?", July 2026, https://licelus.com/insights/can-ai-reverse-engineer-a-mobile-app
Background context
- NowSecure — "Decompiling apps with AI language models", 29 January 2025, https://www.nowsecure.com/blog/2025/01/29/decompiling-apps-with-ai-language-models/
- Challenges and Future Directions in Agentic Reverse Engineering Systems, arXiv 2604.14317, https://arxiv.org/pdf/2604.14317
- Wired — "The PHP meltdown shows how AI makes bugs more exploitable", October 2026
Tools used
- Codex (no additional skills or plugins); Apktool 2.12.1; JADX 1.5.3; MobSF
Author's note on sourcing: figures about decompiled games come from Stratechery's summary of reports on X and in gaming media; we cite the analysis and do not repeat the underlying counts. We deliberately do not link to agencies that publish "we can reverse-engineer your app" pieces with a consultation form at the end; the point of this article is the result.

Related articles
Supporting companies in becoming category leaders. We deliver full-cycle solutions for businesses of all sizes.
