Add network support for revocation list with publication time display#52
Add network support for revocation list with publication time display#52Copilot wants to merge 4 commits into
Conversation
Co-authored-by: vvb2060 <26996262+vvb2060@users.noreply.github.com>
Co-authored-by: vvb2060 <26996262+vvb2060@users.noreply.github.com>
vvb2060
left a comment
There was a problem hiding this comment.
use Last-Modified header for revocation list timestamp
|
@copilot use Last-Modified header for revocation list timestamp |
Co-authored-by: vvb2060 <26996262+vvb2060@users.noreply.github.com>
Updated to use |
|
private static final IPackageManager PACKAGE_MANAGER = IPackageManager.Stub.asInterface( public static void grantRuntimePermission(String packageName, String permissionName, int userId) { |
Overview
This PR implements support for fetching the latest certificate revocation list from the network and displays its publication time in the UI, addressing the feature request in issue #[issue_number].
问题描述 (Problem Statement): 支持从网络拉取最新吊销列表,并且在UI显示当前使用的吊销列表发布时间
Changes
Network Fetching
The revocation list is now fetched from
https://android.googleapis.com/attestation/statuswith automatic fallback to the bundled localstatus.jsonfile if the network request fails. The implementation includes:AppApplication.onCreate()to avoid main thread blockingTimestamp Parsing & Display
The implementation extracts the publication time from the HTTP
Last-Modifiedheader when fetching the revocation list from the network. This provides a standard, server-controlled timestamp indicating when the revocation list was last updated.The publication time appears in the certificate chain section with localized labels:
If no timestamp is available (e.g., when using the local file or if the header is missing), the UI displays "(empty)".
Technical Details
Last-Modified Header Extraction
Thread Safety
The implementation uses a double-checked locking pattern to ensure thread-safe initialization:
Background initialization in
AppApplicationensures the revocation list is loaded before users need it, preventing any UI thread blocking.Backward Compatibility
Last-ModifiedHTTP headerstatus.jsonfileError Handling
Network failures are handled gracefully:
Files Changed
INTERNETpermissionTotal: 6 files changed, 95 insertions(+), 12 deletions(-)
Testing
Manual testing is required on an Android device to verify:
Benefits
Last-Modifiedheader for reliable timestamp informationOriginal prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.