Mosmoxmosmox

Mosmox journal

In focus — quality.

A selection of publications grouped under the quality tag.

Crash-Free Users and Crash Monitoring: Crashlytics, Sentry and a Triage Process That Works

Crash-Free Users and Crash Monitoring: Crashlytics, Sentry and a Triage Process That Works

Users whose app crashes rarely contact support. They close it, maybe try again, then leave a one-star review or simply uninstall. So the team needs to learn about crashes from monitoring before it learns about them from reviews — and it needs a process that turns thousands of reports into a handful of clear tasks.

In this article we unpack what the crash-free users metric really means, what stability thresholds Google Play enforces, how Firebase Crashlytics and Sentry differ, and how we at Mosmox run a weekly crash triage so stability doesn't slip with every release.

Stability metrics: what exactly we measure

There are several metrics, and they're often confused:

  • Crash-free users — the share of users with no crash during the period. The metric closest to how your audience experiences the app.
  • Crash-free sessions — the share of sessions without a crash. Usually higher than crash-free users, since one user has many sessions.
  • User-perceived crash rate in Android vitals — the share of daily active users who hit at least one crash they noticed (background crashes, for example, are often excluded).
  • ANR rate — the share of users whose app froze and the system showed an "App isn't responding" dialog or equivalent.

Note that numbers from Crashlytics, Sentry and Play Console won't match. They use different denominators (daily users vs. users over the period), different counting rules and different coverage (an SDK only sees users who consented to data collection, if you ask for consent). Compare each metric with itself over time, not one source against another.

The thresholds at which Google Play notices you

Google Play publishes bad behaviour thresholds in Android vitals. Exceeding them can reduce your app's visibility in the store, and users may see a warning on your store listing.

MetricOverall thresholdPer-device-model threshold
User-perceived crash rate1.09%8%
User-perceived ANR rate0.47%8%

A 1.09% threshold means roughly 98.9% of users crash-free per day — that's a floor you must not drop below, not a target. iOS has no equivalent public thresholds, but crashes hurt ratings and reviews just the same.

The benchmarks we use on projects (studio experience, not a platform standard):

Crash-free users, 7 daysAssessmentAction
≥ 99.8%ExcellentMaintain; handle new issues as planned work
99.5–99.8%HealthyWeekly triage of the top 5 issues
99.0–99.5%WorryingPart of the sprint goes to stability; halt rollout increases
< 99.0%CriticalHotfix; pause new features until fixed

Crashlytics or Sentry: how to choose

Both tools capture crashes, group them by root cause, show stack traces and let you attach context. The difference is focus and ecosystem.

CriterionFirebase CrashlyticsSentry
CostFreeFree tier with limited event volume, then paid plans; self-hosting possible
PlatformsiOS, Android, Flutter, Unity, React Native (via libraries)Mobile, web, backend — one system for the whole stack
EcosystemAnalytics, Remote Config, App Distribution, BigQuery exportPerformance tracing, session replay, linking to backend errors
Release healthCrash-free users and sessions per version, velocity alertsCrash-free sessions and users, release adoption, release comparison
Data residencyGoogle infrastructureUS or EU cloud, or your own server

Our practical choice: Crashlytics when the project already runs on Firebase and needs a reliable free baseline; Sentry when you want the full "app → API → database" chain in one place or have data residency requirements. We don't recommend running both SDKs: two crash handlers can conflict, and the team will only look at one anyway.

Setup without which reports are useless

Symbolication

Without symbols, a release-build stack trace is a list of memory addresses. iOS needs the dSYM files for every build uploaded; Android with R8 needs mapping files; native code needs NDK symbols. We automate this in the CI pipeline — manual uploads are forgotten by the third release.

Context

  • Breadcrumbs / logs — the last actions before a crash: screens opened, network calls, taps. Crashlytics caps log size at 64 KB per session, so log the essentials, not response bodies.
  • Custom keys — state that matters for reproduction: subscription type, active feature flags, UI language. Crashlytics allows up to 64 key-value pairs.
  • User identifier — only an internal pseudonymous ID, never an email or phone number.

Non-fatal errors

Not every problem ends in a crash. A parsing error the app "recovered" from by showing an empty screen is just as bad for the user. We log such cases as non-fatals, but sparingly: thousands of noisy events bury the real problems.

The triage process: from a thousand reports to five tasks

A tool without a process becomes a dashboard nobody opens. Our standard cycle:

  1. Real-time alerts. A new issue in the latest release or a sudden spike in an existing one (velocity alert) goes straight to the team channel.
  2. Daily check during rollout. While a new version is rolling out, the owner compares its crash-free rate with the previous version every day. A regression is grounds to halt the rollout.
  3. Weekly triage. 30 minutes: take the top issues by number of affected users, not number of events, and decide for each: fix now, schedule, or ignore with a documented reason.
  4. A ticket with context. The ticket links to the issue and lists versions, device models, OS versions and a hypothesis about the cause.
  5. Verify the fix. We close the issue only after the fixed version has reached enough users and the crash hasn't returned. If it does, the tool flags it as a regression.

How to prioritise

We look at three dimensions: how many users are affected, how critical the journey is (a crash at checkout matters more than one in settings), and whether the issue is growing. A crash hitting 0.1% of users on the checkout screen often outranks one hitting 1% in a rarely visited section.

Where crashes usually come from

In our experience, most mobile stability problems fall into a few groups:

  • Unexpected API data: a null where one "never happens", a new enum value, an empty array.
  • Lifecycle: updating the UI after the screen has closed; restoring after the process was killed.
  • Concurrency: race conditions on shared state.
  • Memory: large images on low-end devices, leaks that build up over a long session.
  • Third-party SDKs: crashes inside an ad, analytics or payments library after an update.
  • Specific devices and firmware: heavily modified Android builds from certain manufacturers — which is exactly why Google Play has a separate 8% per-device threshold.

Common mistakes

  1. Missing symbols. Reports exist but can't be read, and the team loses a week trying to reproduce.
  2. Sorting by event count. One user stuck in a crash loop generates thousands of reports and hides an issue affecting hundreds of people.
  3. Swallowing errors. An empty catch around problematic code: the crash disappears from reports, but the feature silently stops working.
  4. Personal data in logs. Emails, phone numbers and tokens in breadcrumbs — a privacy violation and a store-compliance risk.
  5. No halt threshold. The team sees a regression, but the rollout continues because nobody agreed on the number at which to stop it.
  6. Ignoring ANRs. Android users often find freezes as irritating as crashes, and the 0.47% threshold is much stricter than the crash threshold.

Stability checklist

  • One primary crash monitoring tool is chosen, and the SDK initialises as early as possible.
  • dSYMs and mapping files are uploaded automatically from CI for every build.
  • Custom keys (version, flags, account type) and concise breadcrumbs without personal data are configured.
  • New-issue and velocity alerts go to the team channel.
  • A crash-free threshold for halting a staged rollout is agreed.
  • Weekly triage has an owner and prioritises by affected users.
  • Android vitals are checked weekly: crash rate below 1.09%, ANR below 0.47%, individual device models below 8%.
  • Every fix is verified on the new version before the issue is closed.

Sources: Android vitals; Android vitals: Crashes; Android vitals: ANRs; Firebase Crashlytics; Crashlytics: Customize crash reports; Sentry Release Health; Apple: Diagnosing issues using crash reports.

The Mobile Test Pyramid: Unit, Integration and UI Tests, and What to Automate First

The Mobile Test Pyramid: Unit, Integration and UI Tests, and What to Automate First

"We have tests" can mean almost anything on a mobile project: from three unit tests for date formatting to two hundred UI scenarios that fail every other run and that everyone ignores. Neither extreme protects you from regressions. The question isn't whether to write tests, but which ones, how many, and in what order.

This article explains how we at Mosmox build a testing strategy for iOS and Android: what belongs on each level of the pyramid, where to start on a project with no tests, how to tame flaky UI tests and how much time to budget.

The test pyramid: the classic model and what's different on mobile

Mike Cohn popularised the pyramid: lots of fast, cheap unit tests at the base, fewer integration tests in the middle, and a small number of end-to-end tests through the UI at the top. The model is explored in depth in The Practical Test Pyramid on Martin Fowler's site.

Android's documentation uses similar language: small, medium and large tests, defined by how much code they exercise and where they run. The logic is simple: the higher a test sits, the slower and costlier it is to maintain and the more often it fails spuriously — but the closer it gets to the real user experience.

Mobile adds two factors. First, UI tests need an emulator or simulator, which means CI minutes and start-up time. Second, mobile bugs often live at the boundary with the platform: permissions, screen lifecycle, rotation, process death and restoration. That makes the middle of the pyramid more important for mobile apps than for many backends.

What each level covers

LevelWhat it checksToolsSpeedRough share
UnitViewModels, use cases, validation, formatting, calculations, mappersJUnit, Kotest, MockK; XCTest, Swift TestingMilliseconds60–75%
IntegrationRepository + database, network layer against a fake server, cross-module navigationRobolectric, in-memory Room, MockWebServer; XCTest with URLProtocol stubsSeconds15–30%
UI component / snapshotA single screen or component in isolation, visual regressionsCompose UI testing, Paparazzi, Roborazzi; swift-snapshot-testingSeconds5–15%
End-to-endCritical journeys through the real UI and a test backendEspresso, UI Automator, XCUITest, MaestroMinutes5–10%

The shares are a guideline from our projects, not a rule. One principle matters more than percentages: write each check at the lowest level where it can be written at all. If email validation can be covered by a unit test, it has no business living in a UI scenario.

Unit tests: a foundation that needs the right architecture

Unit tests are only cheap when the code is ready for them. If business logic lives inside an Activity, Fragment or SwiftUI View, you can only test it through the UI — and the pyramid flips. So testability is an architectural requirement for us: logic in ViewModels and use cases, dependencies passed through constructors, time, network and storage hidden behind interfaces.

What to cover with unit tests first:

  • calculations involving money, discounts, taxes and currencies;
  • access rules: what free and paying users can see;
  • screen state transitions: loading → content → error → empty;
  • parsing and mapping API responses, including incomplete or malformed data;
  • date and time-zone logic — one of the most frequent bug sources on our projects.

On iOS, consider Swift Testing, introduced with Xcode 16, for new code: parameterised tests and clearer failure messages cut boilerplate. XCTest remains necessary for UI tests and existing suites.

Integration and snapshot tests: the sweet spot

Integration tests prove the layers actually work together: the repository writes to and reads from the database correctly, a schema migration doesn't lose data, the network layer handles a 401 and retries after refreshing the token. This is where you catch bugs that mock-heavy unit tests miss.

On Android, Robolectric runs tests against the Android framework on the JVM without an emulator — an order of magnitude faster than instrumented tests. For networking we use a fake server with recorded responses, so tests don't depend on the state of staging and don't break when someone edits test data.

Snapshot tests compare a rendered screen with a reference image. They're excellent at catching visual regressions: broken padding, truncated text in a long localisation, wrong colours in dark mode. One snapshot test can check a component in ten states — light and dark theme, large font, right-to-left language — in a few seconds.

End-to-end: few, but the most important

E2E tests are the most expensive. They're slow, depend on a test environment and are the most likely to be flaky. Google found that about 1.5% of all test runs in the company produced a flaky result, and roughly 16% of tests showed some level of flakiness. Mobile UI tests usually have it worse.

So we cover only the 5–10 journeys without which the business stops:

  1. sign-up and sign-in;
  2. the core product action (ordering, booking, creating an entry);
  3. payment or subscription purchase in a sandbox;
  4. account recovery;
  5. upgrading from the previous version with existing data.

For a quick start we often pick Maestro: flows are written in YAML, work on both platforms and wait for elements automatically, which reduces flakiness. Espresso and XCUITest remain the choice for deep integration with the codebase.

How to remove flakiness

  • No fixed sleeps — only waits for a specific element state.
  • Animations disabled on test devices.
  • Every test creates its own data and doesn't depend on execution order.
  • A flaky test is quarantined immediately with a ticket to fix it, not re-run "until it passes".

What to automate first on a project with no tests

Many projects come to us with no tests at all. Writing everything at once burns the team out and halts feature work. We go in stages:

StageWhat we doDuration (estimate)Outcome
1Run tests in CI on every pull request, even if there are only a handful1–2 daysInfrastructure that keeps tests from rotting
23–5 E2E tests for critical journeys as a pre-release smoke suite3–5 daysProtection against the costliest regressions
3Unit tests for money, access rules and screen statesOngoing, 10–20% of each taskCoverage where a bug costs most
4Rule: every fixed bug gets a test that reproduces itOngoingBugs don't come back
5Snapshot tests for the design system and key screens3–7 daysControl over visual regressions

Note that stage 2 temporarily inverts the pyramid by starting at the top. It's a deliberate trade-off: in code not designed for testing, a few E2E journeys give the most protection for the least time, and unit tests arrive alongside refactoring.

Metrics: how to tell your tests are working

  • PR pipeline duration. Target: under 10–15 minutes. Any longer and developers start working around the checks.
  • Flaky test rate. If more than 1–2% of runs fail without code changes, trust in the suite collapses.
  • Production regressions. How many post-release bugs involve features that previously worked. This is the main measure of test value.
  • Code coverage. Useful as an indicator of untested areas, harmful as a KPI: an "80% coverage" mandate breeds tests that assert nothing.

Common mistakes

  1. The inverted pyramid. Hundreds of UI tests and no unit tests; the suite takes an hour and fails for a different reason every time.
  2. Testing the mocks. The test verifies the mock returned what it was told to return, not how the code behaves.
  3. Depending on staging. Tests fail whenever someone changes data on the test server.
  4. No migration tests. A database schema update that wipes user data is one of the most painful bugs, because once released it can't be rolled back.
  5. Tests nobody runs. If a suite isn't wired into CI, it goes stale within weeks.

Testing strategy checklist

  • Tests run automatically on every pull request, and failures block the merge.
  • Business logic is pulled out of the UI layer and covered by unit tests.
  • The network layer and database have integration tests, migrations included.
  • Critical journeys (sign-in, core action, payment) are covered by E2E tests.
  • Key screens have snapshot tests for dark mode and large fonts.
  • Flaky tests are quarantined with a ticket to fix them.
  • Every fixed bug gets a regression test.
  • The PR pipeline takes no longer than 15 minutes.

Sources: The Practical Test Pyramid (martinfowler.com); Android: Fundamentals of testing; Apple XCTest; Swift Testing; Google Testing Blog: Flaky Tests at Google; Maestro; Firebase Test Lab.

CI/CD for Mobile Apps: Fastlane, GitHub Actions, Code Signing and Automated Releases

CI/CD for Mobile Apps: Fastlane, GitHub Actions, Code Signing and Automated Releases

A manual mobile release usually goes like this: a developer bumps the build number, opens Xcode or Android Studio, builds an archive, tries to remember where the right certificate lives, uploads to TestFlight and Play Console, types release notes — twice a week. It takes 1–3 hours, and every step is a chance to get it wrong: the wrong keystore, a forgotten build number, a debug configuration shipped to production.

CI/CD takes the human out of that chain. Below is how we at Mosmox build pipelines for iOS and Android with Fastlane and GitHub Actions: pipeline structure, code signing, secrets management, costs, and the traps that break automation at the worst possible moment.

What a mobile CI/CD pipeline actually needs to do

A mobile pipeline differs from a web one in three ways: every build has to be cryptographically signed, iOS only builds on macOS, and "deploying" goes through store review, which you cannot roll back instantly. So we split the pipeline into three tiers:

  • CI on every pull request: linting, unit tests, a debug build. Target: an answer within 10–15 minutes.
  • Internal builds: after a merge to the main branch, a signed build goes to TestFlight (internal), Play Console internal testing or Firebase App Distribution. Testers get new versions without pinging developers.
  • Release pipeline: triggered by a tag — production build, upload to App Store Connect and Google Play, metadata, release notes, start of a staged rollout.

Fastlane: why bother when you have scripts

Fastlane is an open-source tool that wraps xcodebuild, Gradle, the App Store Connect API and the Google Play Developer API into declarative "lanes". The key actions:

ActionPlatformWhat it does
matchiOSStores certificates and profiles in an encrypted repo or cloud bucket and syncs them across developers and CI
gym (build_app)iOSBuilds and exports a signed IPA
pilot (upload_to_testflight)iOSUploads a build to TestFlight and distributes it to testers
deliver (upload_to_app_store)iOSUploads metadata and screenshots and submits for review
gradleAndroidBuilds an AAB/APK for the chosen flavor
supply (upload_to_play_store)AndroidUploads the AAB to a track, with metadata and rollout fraction

Fastlane's main value isn't doing anything the CLI can't. It's that a lane behaves the same on a developer's laptop and on CI. When the pipeline fails, you reproduce it locally with one command instead of picking apart 400 lines of YAML.

iOS signing: the number one cause of broken builds

iOS needs a development or distribution certificate plus a provisioning profile tied to the bundle ID, the certificate and (for development) a list of devices. Managing these files by hand in a team of three or more sooner or later ends with a revoked certificate and everyone's builds broken.

How we set it up

  1. Create a dedicated private repo (or bucket) for match and an encryption passphrase kept only in the secrets manager.
  2. One designated person generates certificates with match for the development and appstore types.
  3. On CI, match runs in readonly mode: it only downloads existing certificates and never creates new ones. That protects you from CI accidentally revoking a certificate.
  4. For App Store Connect access we use an API key (.p8, Key ID, Issuer ID) instead of an Apple ID and password — no two-factor prompts, no expiring sessions.
  5. CI creates a temporary keychain for the build and deletes it afterwards.

An Apple distribution certificate is valid for one year. Set a reminder a month before expiry — five minutes of renewal beats an emergency release on a Friday.

Android signing: the upload key, not the app key

Play App Signing is mandatory for new apps on Google Play: Google holds the app signing key and you sign builds only with an upload key. This matters: if the upload key is lost or compromised, it can be reset through support, whereas losing the app key under the old scheme meant you could never update the app again.

  • We base64-encode the keystore and store it in CI secrets along with passwords and alias; it never goes into the repository.
  • For Play Console access we create a Google Cloud service account with minimal permissions (releases for the specific app only) and store its JSON key as a secret.
  • The very first build of a new app is uploaded to Play Console manually — the API can't create an app from scratch.
  • For new personal developer accounts, remember the closed testing requirement: 12 testers for 14 days before production access. No automation gets around it, so put those two weeks in the launch plan.

GitHub Actions: structuring the workflows

We keep three separate workflow files rather than one do-everything file:

  • pr.yml — on every pull request: Android on a Linux runner (cheaper and faster), iOS tests on macOS only when iOS code or shared modules change (path filters).
  • beta.yml — on push to the main branch: signed builds for internal testers.
  • release.yml — on a tag such as v1.4.0: production build, store uploads, a GitHub Release with the changelog.

Build numbers without conflicts

The simplest approach is to derive the number from GITHUB_RUN_NUMBER, or from the latest TestFlight or Play Console build number plus one. A build number committed by hand guarantees merge conflicts and rejected uploads with "build number already used".

Caching

Caching Gradle, CocoaPods/SPM and DerivedData cuts build time several-fold. On our projects a typical cold iOS build takes 15–25 minutes; with a warm cache, 6–10. But the cache must be keyed on lock-file hashes, or sooner or later you get "works on CI, fails locally".

Costs and which option to choose

macOS runner minutes on GitHub Actions are billed at a much higher rate than Linux, so anything that doesn't need Xcode runs on Linux. The options compared:

OptionProsConsBest for
GitHub Actions (hosted runners)Code and CI in one place, huge action marketplaceExpensive macOS minutes, lag in new Xcode imagesMost teams up to 10 developers
Xcode CloudNative Xcode and App Store Connect integration, 25 compute hours a month included with Apple Developer Program membershipApple platforms only, less flexibleiOS-only teams
Codemagic, BitriseReady templates for Flutter / React Native, fast Mac machinesAnother vendor and invoiceCross-platform projects, teams without DevOps
Your own Mac mini as a self-hosted runnerLowest cost per minute, fast warm cacheMaintenance, Xcode upgrades, physical securityTeams with heavy build volume

Setting up a baseline pipeline for both platforms typically takes us 3–6 working days, provided the project already has tests and tidy build configurations. It pays back within weeks: a team shipping weekly saves 6–12 developer hours a month on routine alone, not counting the mistakes that never happen.

Common mistakes

  1. Secrets in the repo. A keystore, .p8 key or production config sitting in git history. Deleting the file in a new commit doesn't help — the history remains.
  2. CI with admin rights. A service account with the Admin role in Play Console, or an App Store Connect API key with the Admin role. A role that can only upload builds is enough.
  3. One giant workflow. Any README edit triggers a 40-minute iOS build.
  4. Automatic 100% release. The pipeline ships to every user at once. The production lane should start a staged rollout to a small share of users; increasing it is a human decision made after looking at stability metrics.
  5. A stale Xcode. Apple regularly raises the minimum SDK required for App Store Connect uploads. If CI is pinned to an old image, the release hits an upload error exactly when it's urgent.
  6. No artifacts. Failing to keep dSYMs and R8 mapping files means production crash reports are unreadable.

A two-week rollout plan

  1. Days 1–2. Audit the current release process: write down every manual step and where the keys live. Move all secrets into a secrets manager.
  2. Days 3–4. Fastlane locally: test, beta and release lanes per platform; match for iOS, upload key and service account for Android.
  3. Days 5–6. PR pipeline in GitHub Actions with caching and path filters.
  4. Days 7–8. Beta pipeline: automatic internal builds, CI-generated build numbers, notifications in the team chat.
  5. Days 9–10. Tag-triggered release pipeline: store uploads, dSYM and mapping retention, staged rollout start.
  6. Afterwards. Document the process in the README and run the first release as a pair so the knowledge doesn't live in one head.

Readiness checklist: no secrets in the repository; match readonly on CI; App Store Connect API key instead of an Apple ID; Play App Signing enabled; least-privilege service accounts; build numbers generated automatically; dSYMs and mapping files retained; production starts with a staged rollout; reminders set for certificate expiry.

Sources: fastlane docs; fastlane match; GitHub Actions documentation; GitHub Actions billing; App Store Connect API; Xcode Cloud; Play App Signing; Google Play Developer API.

OWASP MASVS in Practice: A Security Checklist for Your Mobile App

OWASP MASVS in Practice: A Security Checklist for Your Mobile App

When a client asks "is our app secure?", the honest answer is almost always "secure against what?". That is why at Mosmox we never start an audit with a random grab-bag of checks. We anchor it in OWASP MASVS, the industry standard for mobile app security requirements. It gives developers, testers, lawyers and the security teams of banks or insurers a shared vocabulary — and those teams increasingly make compliance a contractual condition.

This article covers how MASVS is structured since version 2, which control groups we actually check on every project, how to choose the right level of rigour, how much time to budget, and the mistakes we keep finding. We have covered general security mistakes in an earlier journal post; here the focus is a methodical, standard-based review.

MASVS, MASTG and MASWE: what each one is for

The OWASP Mobile Application Security (MAS) project consists of three linked documents:

  • MASVS (Mobile Application Security Verification Standard) — high-level requirements: what must be ensured, e.g. "the app securely stores sensitive data".
  • MASTG (Mobile Application Security Testing Guide) — the hands-on manual: how to verify it on Android and iOS, with tools, commands and code samples.
  • MASWE (Mobile Application Security Weakness Enumeration) — a catalogue of concrete weaknesses that links abstract requirements to tests.

Version 2.0 (2023) simplified the standard dramatically: dozens of granular items were removed, and the old L1/L2/R levels are no longer part of the standard itself. MASVS now describes requirements, while testing profiles (L1, L2, R, P) live in MASTG. For a business, this means that a "MASVS L2" clause in an old tender document needs translating into current terminology — otherwise vendor and client will mean different things.

Eight control groups and what sits behind them

Current MASVS has eight groups. Here is how we explain them to the team and what we check first.

GroupCoversWhat we check first
MASVS-STORAGEOn-device data storageTokens only in Keychain / Android Keystore-backed storage; no personal data in logs, WebView caches or backups
MASVS-CRYPTOCryptographyNo home-grown algorithms, no hardcoded keys, modern modes (AES-GCM), proper random number generation
MASVS-AUTHAuthentication and authorizationPermissions enforced on the server, not the client; biometrics bound to a cryptographic key; proper session termination
MASVS-NETWORKNetwork communicationTLS only, no ATS or cleartext exceptions, a deliberate decision about certificate pinning
MASVS-PLATFORMInteraction with the OS and other appsExported activities, deep links, WebViews with JavaScript bridges, IPC, screenshot protection on sensitive screens
MASVS-CODECode quality and dependenciesInput validation, up-to-date SDKs, minimum OS version, a forced-update mechanism
MASVS-RESILIENCEResistance to reverse engineeringObfuscation, root/jailbreak and tamper detection, integrity checks via Play Integrity / App Attest
MASVS-PRIVACYPrivacyData minimisation, transparency, user control; consistency with the Privacy Manifest and Data safety form

The PRIVACY group arrived in version 2.1 (2024), which makes sense: Apple's Privacy Manifest requirements and Google Play's Data safety section turned privacy into something verifiable rather than aspirational.

Choosing a profile: L1, L2, R or P

The most expensive mistake is applying banking-grade requirements to a habit tracker, or the reverse. MASTG profiles let you scale the effort:

  • L1 — baseline security for any app. This is hygiene we treat as mandatory even for an MVP.
  • L2 — defence in depth for apps handling sensitive data: finance, health, government services, corporate access.
  • R — resilience against reverse engineering and client tampering. Needed when the value lives in the client itself: games with in-app economies, DRM content, anti-bot protection.
  • P — privacy; relevant to anyone processing personal data.

Our rule of thumb: L1 + P always; L2 if one user's data leaking means direct financial or medical harm to them; R if an attacker can profit from a modified client. R without L2 rarely makes sense — obfuscation will not save you if the server trusts the client.

Step by step: how we run an audit

Step 1. A one-page threat model

Before any testing we write down which data is valuable (tokens, payment data, medical records), who the attacker is (someone holding an unlocked phone, a malicious app on the same device, a public Wi-Fi attacker, a competitor decompiling the APK) and what the consequences would be. Without this, the report becomes a list of "findings" nobody knows how to prioritise.

Step 2. Static analysis

We decompile the build (jadx for Android, IPA analysis for iOS) and look for API keys, staging URLs, disabled certificate validation and debug flags. In parallel we run automated scanners such as MobSF — they surface the obvious quickly but produce plenty of false positives, so every finding is verified by hand.

Step 3. Dynamic analysis

We install the app on a rooted or jailbroken device, intercept traffic through a proxy and instrument it with Frida. We check what sits in the sandbox after login and after logout, what lands in the system log, and whether internal screens open via a deep link without authentication.

Step 4. Testing the backend from the client's side

Most critical findings in mobile audits are actually server-side: the API returns extra fields, lets you modify someone else's resource by swapping an ID (IDOR), or doesn't rate-limit OTP attempts. MASVS explicitly requires authorization to happen on the server, so we consider a mobile audit without API testing incomplete.

Step 5. Report and retest

Every finding gets a MASVS group and MASTG test reference, a severity rating and a concrete recommendation. A retest after fixes is mandatory: in our experience roughly one in five "fixes" addresses the symptom rather than the cause.

How long it takes

The estimates below are guidelines from our own practice for a mid-complexity app (20–40 screens, one platform). For two platforms budget roughly 1.6–1.8×, since part of the work (API, threat model) is shared.

ScopeDurationWhen it fits
Team self-review against an L1 checklist1–2 daysBefore every major release
External L1 + P audit3–5 daysBefore public launch or a funding round
L2 audit including the API7–12 daysFintech, healthtech, enterprise apps
L2 + R with protection-bypass testing10–20 daysPayment services, games with economies, DRM

An automated scanner in CI costs next to nothing and catches regressions, but it does not replace a manual audit: it cannot see broken authorization logic, which is exactly what hurts most.

The mistakes we find most often

  1. Secrets in the client. Third-party API keys that unlock paid services or other people's data. Anything shipped in the build should be treated as public — obfuscated or not.
  2. Tokens in insecure storage. SharedPreferences or UserDefaults instead of Keychain/Keystore; refresh tokens that never expire.
  3. Logs with personal data. Request bodies with phone numbers, addresses or tokens left over from debugging, ending up in system logs or a third-party analytics tool.
  4. Trusting the client. Price, discount, user role or subscription status sent from the app and never validated server-side.
  5. Open Android components. An activity with exported="true" that opens an internal screen without checking the session.
  6. Unrestricted WebViews. JavaScript enabled, a native bridge and arbitrary URL loading — the classic path to running someone else's code inside your app's context.
  7. Box-ticking pinning. Certificate pinning with no rotation plan: one day the app stops working for every user. Pinning makes sense at L2, but only with a backup key and a way to update the configuration.
  8. No forced update. When a vulnerability is found, old versions live on for years. MASVS-CODE explicitly calls for a mechanism that makes users update.

Making MASVS part of the process, not a one-off audit

A one-off audit is a snapshot of a single day. To keep security from decaying, we build MASVS into the normal development cycle:

  • Definition of Done. Tasks touching authentication, storage or networking get 3–5 relevant L1 items in the pull request checklist.
  • CI automation. Dependency scanning for known vulnerabilities, secret detection in the repository and static analysis of every release build.
  • Device attestation. For L2/R — the Play Integrity API on Android and App Attest on iOS, with the verdict checked on the server, not in the app.
  • Cadence. A full audit once a year or after significant architectural changes (a new payment provider, a new sign-in method).

An L1 checklist to start with

  • Tokens and keys are stored only in Keychain / Android Keystore.
  • The release build has no debug logs containing personal data or tokens.
  • Backups contain no sensitive data (allowBackup / backup rules configured on Android, file protection attributes on iOS).
  • All traffic is TLS; no unjustified ATS exceptions or cleartext traffic.
  • The build contains no secrets granting access to paid services or data.
  • Authorization and business rules (prices, roles, subscriptions) are enforced on the server.
  • Exported components and deep links cannot open protected screens without a session.
  • WebViews don't load arbitrary URLs and expose no unnecessary JavaScript bridges.
  • Dependencies are up to date with no known critical vulnerabilities.
  • A forced-update mechanism exists for the minimum supported version.
  • The Privacy Manifest and Data safety form match what the app actually collects.

If three or more of these items fail today, fix them before commissioning an in-depth audit: an external specialist will find the same things, just at a higher price.

Sources: OWASP MASVS; OWASP MASTG; OWASP MASWE; Android: Security guidelines; Apple Security documentation; Play Integrity API; Apple DeviceCheck / App Attest.

Journal

Ideas and products