Skip to content

Wasted v2.0.0 with P2P Remote Control and Android 14+ Device Owner Setup#84

Open
anonfaded wants to merge 10 commits into
x13a:mainfrom
anonfaded:main
Open

Wasted v2.0.0 with P2P Remote Control and Android 14+ Device Owner Setup#84
anonfaded wants to merge 10 commits into
x13a:mainfrom
anonfaded:main

Conversation

@anonfaded
Copy link
Copy Markdown

@x13a Hey. I've fixed a critical feature which was broken on Android 14+ devices that you mentioned in README.md.
TL;DR: Now the Wasted app works on all latest Android versions without issues. Tested on Android 17-beta.

Below is the summary and all details, along with pictures of the whole setup working. I've released v2.0.0 of Wasted on my fork which you can use to test the features: https://github.com/anonfaded/Wasted/releases/tag/v2.0.0

Summary

New P2P network for remote factory reset over local Wi-Fi. Android 14+ Device Owner setup enables full reset capability. Fixed reset on Android 14+ (now uses wipeDevice() API). Tested on Pixel 7 Pro (Android 17-beta).

What's New

1. P2P Network (New)

  • TLS encrypted messaging on port 9876
  • mDNS discovery on local Wi-Fi
  • QR/PIN-based pairing
  • Remote factory reset commands via P2P
  • Settings sync <500ms latency

2. Device Owner Setup (Android 14+ Fix)

  • Shizuku-based enrollment to make app Device Owner (no root or factory reset needed for making Wasted Device Owner)
  • Checks for Work Profiles and linked accounts blocking enrollment
  • Shows what needs to be removed; user removes via device settings
  • Re-check confirms removal, then enrolls as Device Owner
  • Enables full factory reset capability on Android 14+

Technical Details

P2P Network

TLS socket connections on port 9876 with mDNS discovery. Remote reset messages delivered with ACK tracking.

Device Owner Setup Flow

  1. Check for Work Profiles via dumpsys user; show to user if found
  2. Check for account packages via dumpsys account list; show to user if found
  3. User removes blocking items from device settings, then taps "Check Again"
  4. Execute dpm set-device-owner via Shizuku once clear (persists, Shizuku no longer needed after)

Testing

Verified on Pixel 7 Pro (Android 17-beta):

  • P2P discovery and pairing works
  • Remote factory reset via P2P executes
  • Device Owner setup succeeds
  • Android 14+ reset fixed (uses wipeDevice())
  • ForegroundService runs indefinitely (no ANR)

Backward Compatibility

No breaking changes:

  • Android 6-13: wipeData() unchanged
  • Android 14+: Now uses wipeDevice() (fixed reset support)

Verification Media

P2P Network Screen Device Owner Setup
p2p_screen device_owner
Local Factory Reset Remote Reset Logcat Confirmation
local_reset logcat_remote_reset

anonfaded and others added 10 commits May 3, 2026 11:26
…e service permissions

Co-authored-by: Copilot <copilot@github.com>
…ctivity

Co-authored-by: Copilot <copilot@github.com>
…ance

Co-authored-by: Copilot <copilot@github.com>
- Implemented DeviceControlFragment to manage individual connected devices, including lock and reset functionalities.
- Created layout for fragment_p2p_network.xml to display device settings and peer management options.
- Updated navigation menu to include P2P Network option.
- Modified device_admin.xml to support transfer ownership policy.
- Enhanced build.gradle for cleaner build directory handling.
- Introduced build.sh script for streamlined build and deployment process across multiple devices.

Co-authored-by: Copilot <copilot@github.com>
- Added ShizukuManager to manage Shizuku lifecycle and commands.
- Created ShizukuShell to execute commands with ADB-level privileges.
- Updated P2PNetworkFragment to include Device Owner setup card and actions.
- Enhanced user guidance for pairing and setup processes.
- Introduced protection level indicators in the main fragment layout.
- Updated strings.xml for new UI elements and messages.
- Refactored layout files to accommodate new setup and protection cards.

Co-authored-by: Copilot <copilot@github.com>
- Updated AndroidManifest.xml to use new foreground service permission
- Added P2P settings to Preferences for enabling/disabling P2P
- Modified Utils to manage foreground service based on P2P status
- Improved P2PController to handle start/stop logic
- Updated P2PNetworkFragment to manage UI and state for P2P settings
- Enhanced SettingsSyncManager to handle local settings asynchronously
- Refactored ForegroundService to manage P2P lifecycle
- Added UI elements for P2P settings in fragment_p2p_network.xml

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Copilot AI review requested due to automatic review settings May 6, 2026 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant