Skip to main content

Audit Log System

Browser Limit maintains a complete audit trail of every detection decision, AI classification, and uninstallation attempt. The log is stored in a local Room database and can be viewed, searched, and exported.

Database Schema​

The log is stored in a Room database named browserlimit_logs with a single table logs.

LogEntry Entity​

ColumnTypeDescription
idInt (auto-generated primary key)Unique log entry identifier
timestampLongUnix timestamp in milliseconds
appNameStringHuman-readable app name from PackageManager
packageNameStringAndroid package name
detectionMethodStringHow the app was classified
decisionStringWhat action was taken
geminiResponseStringDetection reason or Gemini API response
shizukuResultStringShizuku uninstallation result (currently unused)

Decision Values​

DecisionMeaning
RemovedApp was classified as a browser and uninstalled
KeptApp was classified as a non-browser
ExceptedApp was found in the exceptions list and skipped
ErrorUninstallation was attempted but failed

Detection Method Values​

MethodMeaning
GeminiClassified by Gemini API
Gemini (Recheck)Rechecked via Gemini from the Logs screen
Local CacheFound in the local confirmed browsers/non-browsers cache
LocalFound in the KNOWN_BROWSERS database
Fallback (Error: ...)Gemini failed, fell back to local database
System AppSkipped because it is a system app
SettingsSkipped because Browser Limit is inactive

Log Entry Lifecycle​

Viewing Logs​

The Logs screen displays all log entries in reverse chronological order (newest first). Each entry shows:

  • App name and package name
  • Decision (color-coded: red for Removed, green for Kept, yellow for Excepted)
  • Detection method
  • Detection reason

Log Details​

Tap any log entry to open the details dialog, which shows:

  • Timestamp (formatted as yyyy-MM-dd HH:mm:ss)
  • Package name
  • Decision and method
  • Detection reason

For Gemini-classified entries, the details also show:

  • The exact prompt sent to Gemini
  • The raw Gemini output
  • The Shizuku uninstallation command and result

Rechecking with Gemini​

Each log entry has a "Recheck with Gemini" button. This:

  1. Clears the local cache for that package.
  2. Re-runs the full detection flow with Gemini (even if the daily limit is reached).
  3. If the app is reclassified as a browser, it is uninstalled.
  4. A new log entry is created with the recheck result.
note

Rechecking bypasses the daily Gemini limit. Use it sparingly.

Exporting Logs​

Bulk Export​

Tap Export on the Logs screen to export all log entries to a text file:

1717200000000 | Chrome (com.android.chrome) | Removed | Gemini - Gemini returned YES
1717199000000 | Firefox (org.mozilla.firefox) | Kept | Local Cache - User overrides

The file is saved to the Downloads folder as browserlimit_logs_{timestamp}.txt.

If the Downloads folder is not accessible, the file is saved to the app's external files directory.

Individual Export​

In the log details dialog, tap Export Log to export a single entry with full details:

App Name: Chrome
Package Name: com.android.chrome
Time: 2024-01-15 14:30:00
Decision: Removed
Method: Gemini
Reason: Gemini returned YES

Retention​

The log database automatically trims entries to the most recent 500. This happens after every new log entry is inserted.

DELETE FROM logs WHERE id NOT IN (
SELECT id FROM logs ORDER BY timestamp DESC LIMIT 500
)

To clear all logs manually, tap Clear on the Logs screen.

Dashboard Statistics​

The Dashboard screen shows two real-time counters:

MetricQuery
Scanned TodayCount of all log entries where timestamp >= todayStart
Removed TodayCount of log entries where decision = 'Removed' AND timestamp >= todayStart

Both counters update in real-time using Room Flow queries.