Conclusions and decision conditions
- Successful installation, successful signature verification, and official publisher identity are three distinct judgments; the first two cannot substitute for the third.
- Re-signed packages typically cannot overlay an official version installed under a different signature identity; the upgrade chain is a critical gate for identifying anomalous artifacts.
- The final APK must fix the package name, version, certificate digest, file digest, build origin, and channel processing order.
- The server must maintain an allowlist of permitted versions and application identities, treating platform integrity signals as risk inputs rather than trusting client-self-reported data.
Distinguish Installation Validation, Signature Identity, and Business Authorization
Android requires APKs to be signed. The system verifies whether the installer package structure and signature data prove that the current content was signed by the corresponding private key. If an attacker modifies DEX files, resources, or the Manifest, then fully re-signs the result with their own key, the new package can be cryptographically self-consistent and may satisfy conditions for a fresh installation.
This outcome only answers whether the current package has a verifiable signature; it does not answer whether the signer is the official publisher. Brand authorization, legitimate channels, account login permissions, and access to high-risk interfaces are business concerns that the application and server must evaluate separately.
Therefore, test reports must not equate 'installable after re-signing' with 'signature protection failure,' nor equate 'installation failure' with 'all repackaging risks closed.' The correct questions are: Can the modified package reach user devices? Can it impersonate the official version during an upgrade? Can it connect to real services? And how does the server identify and handle such cases?
| Judgment | Question Answered | Required Evidence | Conclusion That Cannot Be Extrapolated |
|---|---|---|---|
| Package Parseable | Can the installer read the file structure? | Installer result, Manifest, and resource structure | Does not prove signature legitimacy or code safety |
| Current Signature Self-Consistent | Is the current content signed by the private key corresponding to the current certificate? | Signature scheme verification and certificate digest | Does not prove the certificate belongs to the official entity |
| Upgrade Identity Continuity | Can it overlay an already installed official application? | Executing an upgrade from a genuine live version | Does not prove all business interfaces will reject anomalous clients |
| Business Authorization Passed | Does the server allow the account and version to access resources? | Server-side version, account, integrity, and behavior policies | Does not guarantee client code is immune to analysis or modification |
Why Re-signed Packages Often Only Allow Fresh Installation
Android uses application signature identity to maintain update continuity. When an installed application accepts an overlay upgrade, the platform must confirm that the new version satisfies signature identity rules relative to the existing version. A modified package signed with an unrelated certificate usually cannot directly overlay the official version; it requires uninstalling the official app first, changing the package name, or inducing the user to install it in a separate environment.
This is why repackaging tests must execute both fresh installation and overlay upgrades. Testing only fresh installation misses signature continuity checks, while testing only overlay upgrades misses paths where spoofed packages enter the device via different package names or uninstall-reinstall cycles. Results for both scenarios must be recorded separately.
Signature rotation and Play App Signing add complexity to the release chain. Teams must preserve current and historically allowed certificate identities, rotation rules, and the responsibilities of upload keys versus app signing keys. Server-side policies must use data matching the distribution method. Development certificates, upload certificates, and final distribution certificates must never be conflated into a single field.
- Execute overlay upgrade from the current live version
- Perform fresh installation after uninstallation
- Check for package name changes and data directory impacts
- Verify certificate rotation against distribution platform rules
Repackaging Governance Must Start with Final Artifact Identity
Teams often save only the build number, neglecting to record the final APK's file digest and signing certificate digest. Channel resource injection, realignment, re-signing, or package optimization can alter the final file. If security scanning analyzes pre-channel artifacts, the files received by live users are not covered by the same evidence.
We recommend generating unambiguous artifact records for every release candidate: package name, versionCode, versionName, file SHA-256, certificate SHA-256, signature scheme verification result, build origin, channel, processing order, and generation timestamp. Static checks, installation upgrades, functional regression testing, and server-side allowance rules should all reference this record.
File digests are not protective measures themselves; their value lies in preventing the test object from silently changing during the workflow. Any change in digest, signature, or channel sequence indicates a new release candidate, requiring re-execution of affected gates.
artifact:
package: com.example.redacted
version_code: 240
version_name: 2.4.0
sha256: REDACTED
signing:
certificate_sha256: REDACTED
schemes: [v2, v3]
distribution: managed-channel
pipeline:
- build-release
- harden-candidate
- channel-resources
- final-sign
acceptance:
install_fresh: required
upgrade_from_production: required
server_policy_check: requiredServers Must Treat Anomalous Clients as a Policy Problem
Clients can report package names, versions, certificates, or integrity materials, but modified clients can also tamper with these standard reporting fields. Servers must prioritize verifiable signals, combining account status, version, request behavior, device risk, and distribution environment into a policy, rather than trusting a single client-reported boolean.
Play Integrity can return verdicts on application recognition, device integrity, account licensing, and environmental risk. Official documentation notes that certain signals may be unavailable due to OS version, device form factor, distribution source, Play Services status, or configuration. The correct approach is to model 'unavailable,' 'failure,' and 'high-risk' states separately, preparing strategies for degradation, secondary verification, privilege restriction, or denial.
Non-Google Play distribution scenarios cannot simply copy Play-exclusive signals. Enterprise distribution, domestic channels, and private delivery require establishing their own allowlists of versions, certificate mappings, upgrade mechanisms, and anomaly handling procedures. Platform signals are part of the evidence, not a universal answer across all channels.
| Input | Verification Method | Possible States | Recommended Action |
|---|---|---|---|
| Version and Package Name | Compare against release ledger and channel rules | Allowed, Expired, Unknown | Allow, prompt upgrade, restrict high-risk capabilities |
| Application Recognition Signal | Validate platform-returned signature and application identity results | Identified, Unidentified, Unavailable | Normal, challenge or restrict, degrade per channel |
| Account and Licensing | Server-side account permissions and distribution licenses | Valid, Expired, Anomalous | Authorize or deny based on resource scope |
| Request Behavior | Rate, replay, device changes, and business context | Normal, Suspicious, High-Risk | Log, secondary verification, rate limit, or block |
| Device and Environment | Platform verdicts and proprietary risk rules | Satisfied, Weak Signal, Unknown | Risk grading rather than single-point absolute judgment |
Incorrect Release Sequencing Invalidates Prior Checks
Modifying DEX, resources, or the Manifest after final signing breaks the content covered by the signature; rebuilding or re-signing after scanning decouples scan conclusions from the final file. If channel processing tools need to modify the package body, they must complete this before final signing, and the sequence must be fixed in the artifact ledger.
AAB distribution further distinguishes between uploaded artifacts and split APKs received by user devices. Teams should download or obtain actual delivered artifacts from the distribution platform for spot checks, confirming that package names, versions, signature identities, and key resources match release records. Locally generated generic APKs cannot automatically represent all device configurations.
Rollback packages must also undergo the same signature and upgrade validation. In an incident, temporarily re-signing an old file may fail to overlay install due to mismatches in version numbers, signatures, or data migration requirements.
| Stage | Input | Output Evidence | Primary Failure Conditions |
|---|---|---|---|
| Release Build | Frozen source code and dependencies | Build record and base artifacts | Dependencies or configuration not reproducible |
| Hardening Processing | Explicit protection configuration | Configuration version and candidate artifacts | Processing object mismatched with target version |
| Channel Processing | Channel resources and compliance info | Channel candidate artifacts | Content modified after signing |
| Final Signing | Controlled keys and final package body | Certificate digest and signature verification result | Use of incorrect key or environment |
| Acceptance Release | Unique final file | Installation, upgrade, business, and server-side gates | Substitution of accepted objects with other files |
How to Determine Repackaging Risk is Under Publishable Control
A publishable conclusion does not mean modified packages can never install. It means official artifact identity is traceable, anomalous artifacts cannot silently overlay official versions, the server can identify or restrict untrusted clients, users have paths to obtain genuine versions and recover, and teams can audit final delivery files.
Tests must retain evidence for both success and failure paths. Success paths include normal installation/upgrades of official versions, logins, and key business flows. Anomaly paths include overlay upgrades with unrelated certificates, unknown versions accessing high-risk interfaces, expired versions, unavailable integrity signals, and false positive recovery. Verifying only rejection without a recovery process traps real users in unresolvable states.
This article does not claim any hardening technology alone can prevent all re-signed installations. Repackaging governance is a systems engineering effort jointly completed by signature management, upgrade controls, artifact management, client resilience, platform signals, and server-side policies.
- Official artifact identity can be independently audited
- Anomalous certificates cannot silently overlay official installations
- Server has graded policies for unknown clients
- Users can recover to trusted release channels
- Rollback packages have completed upgrade validation in advance
Evidence and applicability boundaries
This section separates documented platform facts, engineering judgment, and limits that cannot be generalized into unverified product claims.
| Article judgment | Fact or engineering basis | Applicability limit |
|---|---|---|
| Installability of a re-signed package does not equate to official publisher identity. | Android requires APKs to have verifiable signatures; attackers can generate self-consistent signatures using their own keys on modified content. | Installability is also affected by package name, device policies, OS version, and installation source; specific sample results cannot be inferred solely from design principles. |
| Overlay upgrades must verify signature identity continuity. | Android official documentation states the platform uses the app signing key to confirm updates come from the same key holder. | Certificate rotation and distribution platform signing rules must be verified according to project configuration. |
| Platform integrity signals must be validated and handled on the backend. | Play Integrity verdicts include application recognition, device, account, and environmental information; officials recommend backend responses based on risk. | Play signals do not cover all countries, channels, devices, or offline scenarios. |
| Final delivery files must correspond one-to-one with test evidence. | Rebuilding, modifying resources, or re-signing changes artifact identity and potential runtime behavior. | File digests establish identity association but do not provide anti-tampering capabilities themselves. |
| Installation failure alone does not prove repackaging risks are closed. | Anomalous packages may still pose risks by changing package names, uninstall-reinstall cycles, using other channels, or exploiting lack of server-side version policies. | Specific attack paths must be verified within authorized testing scopes against real distribution and business architectures. |
Engineering questions
Why doesn't the system directly reject all APKs signed with non-official certificates?
The Android installer can verify if a current package's signature is self-consistent, but the system does not know which certificate each brand recognizes. Official identity must be jointly determined by the upgrade chain, distribution platform, and business services.
If a re-signed package cannot overlay upgrade, is there no risk?
No. Attackers may still induce uninstall-reinstall cycles, modify package names, or exploit missing server-side version policies to access business logic. Overlay upgrade prevention is just one item in the governance matrix.
Is it sufficient for the client to read its own certificate digest?
No. A modified client may simultaneously alter local checks or reporting logic. Certificate information can participate in defense-in-depth, but high-risk authorization decisions should be made by the server combining verifiable signals.
After AAB release, which file digest should be saved?
Save the identity of the uploaded AAB, and also obtain and spot-check actual delivered artifacts from the distribution platform. Different devices may receive split APKs; saving only a locally generated generic APK is insufficient.
When can a release conclusion be formed?
A conclusion can only be formed for the covered scope once the final signed artifact identity is fixed, and installation, upgrade from live versions, key business flows, server-side policies, target OS ranges, and rollback validation are all complete.
Want to test this on your own app?
Submit the release candidate, target systems, and critical business paths for a Yudun PoC and compatibility assessment.
Continue with: How to accept APK, DEX, and signing integrity together