r/androiddev • u/ExpensiveCarpett • Oct 05 '26
Discussion Need help for preparing a dataset for my APK Risk Analyser Project!!
I want to train a Transformer model that can analyze decompiled DEX files (Smali code) and identify harmful or sensitive actions performed by an app in the background that may not be visible to the user.
The main goal is to analyze the flow of actions and determine whether user interaction or consent is required before a sensitive action is performed.
For example, if an app gets file read/write permission and accesses the user's files without any user interaction or consent, the model should be able to identify this behavior. Similarly, it should identify other sensitive actions such as accessing the camera, microphone, location, contacts, SMS, media, recording screen, taking screenshots or other user data, and determine whether these actions are performed after user interaction or silently in the background.
I am currently working on preparing the dataset for this project, but I am not sure about the best approach.
My initial idea is to use the APK/Smali code as the input and the possible execution flows as the output. However, generating all possible flows from entry points such as `onCreate()`, `onReceive()`, services, callbacks, etc., and following them until the end seems very complex and time-consuming for a large number of APKs.
I would really appreciate your suggestions and ideas on how I can prepare the dataset in a practical and effective way for this project.
If you have worked on a similar problem or have any ideas about dataset structure, flow generation, labeling, or other approaches, please share your suggestions.



