Skip to content

Commit 8b19084

Browse files
CopilotPixelCode01
andcommitted
Add shell scripts for Samsung, Xiaomi, OnePlus, Realme, Oppo, and Vivo
Co-authored-by: PixelCode01 <105023758+PixelCode01@users.noreply.github.com>
1 parent d700814 commit 8b19084

File tree

6 files changed

+1796
-0
lines changed

6 files changed

+1796
-0
lines changed

OnePlus/oneplus_remover.sh

Lines changed: 323 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,323 @@
1+
#!/system/bin/sh
2+
# OnePlus Bloatware Remover for Shizuku
3+
# Remove unwanted pre-installed apps from OnePlus devices
4+
# Compatible with Shizuku terminal environment
5+
# Version: 1.0
6+
7+
# Colors for better visibility (if terminal supports them)
8+
RED='\033[0;31m'
9+
GREEN='\033[0;32m'
10+
YELLOW='\033[1;33m'
11+
BLUE='\033[0;34m'
12+
NC='\033[0m' # No Color
13+
14+
# Function to print colored text
15+
print_colored() {
16+
local color=$1
17+
local text=$2
18+
printf "${color}${text}${NC}\n"
19+
}
20+
21+
# Function to print header
22+
print_header() {
23+
echo "=================================================="
24+
print_colored $BLUE "OnePlus Bloatware Remover for Shizuku"
25+
print_colored $BLUE "Version 1.0"
26+
echo "=================================================="
27+
echo ""
28+
print_colored $YELLOW "WARNING: This script will remove applications from your device."
29+
print_colored $YELLOW "Always create a backup before proceeding."
30+
echo ""
31+
}
32+
33+
# Function to check if we're running in Shizuku environment
34+
check_environment() {
35+
if [ -z "$SHIZUKU_SERVER_VERSION" ] && [ "$(id -u)" != "2000" ]; then
36+
print_colored $RED "Warning: This script is designed for Shizuku environment."
37+
print_colored $YELLOW "Make sure you're running this through Shizuku terminal."
38+
echo ""
39+
read -p "Continue anyway? (y/n): " choice
40+
case "$choice" in
41+
y|Y) ;;
42+
*) exit 1 ;;
43+
esac
44+
fi
45+
}
46+
47+
# Function to create backup
48+
create_backup() {
49+
print_colored $BLUE "Creating backup of installed packages..."
50+
BACKUP_FILE="/sdcard/oneplus_backup_$(date +%Y%m%d_%H%M%S).txt"
51+
pm list packages > "$BACKUP_FILE"
52+
if [ $? -eq 0 ]; then
53+
print_colored $GREEN "Backup created: $BACKUP_FILE"
54+
else
55+
print_colored $RED "Failed to create backup!"
56+
exit 1
57+
fi
58+
}
59+
60+
# OnePlus bloatware packages categorized by risk level
61+
SAFE_PACKAGES="
62+
com.oneplus.account:OnePlus Account service
63+
com.oneplus.backuprestore:OnePlus Clone Phone
64+
com.oneplus.brickmode:Brick mode service
65+
com.oneplus.calculator:OnePlus Calculator
66+
com.oneplus.camera:OnePlus Camera
67+
com.oneplus.card:OnePlus Card service
68+
com.oneplus.cloud:OnePlus Cloud storage
69+
com.oneplus.compass:Compass application
70+
com.oneplus.deskclock:Clock and alarm app
71+
com.oneplus.filemanager:OnePlus File Manager
72+
com.oneplus.gallery:OnePlus Gallery
73+
com.oneplus.gamespace:Game Space
74+
com.oneplus.iconpack.circle:Circle icon pack
75+
com.oneplus.iconpack.square:Square icon pack
76+
com.oneplus.market:OnePlus Store
77+
com.oneplus.note:OnePlus Notes
78+
com.oneplus.opsocialnetwork:OnePlus Community
79+
com.oneplus.screenshot:Screenshot service
80+
com.oneplus.skin:OnePlus themes
81+
com.oneplus.soundrecorder:Sound recorder
82+
com.oneplus.weather:OnePlus Weather
83+
com.oneplus.widget:OnePlus widgets
84+
com.oneplus.worklife:Work Life Balance
85+
net.oneplus.commonlogtool:Common log tool
86+
net.oneplus.odm:ODM service
87+
net.oneplus.oemtcma:OEM TCMA service
88+
net.oneplus.push:OnePlus push service
89+
net.oneplus.weather:Weather service
90+
com.google.android.apps.docs:Google Drive
91+
com.google.android.apps.photos:Google Photos
92+
com.google.android.apps.youtube.music:YouTube Music
93+
com.google.android.music:Google Play Music
94+
com.google.android.videos:Google Play Movies
95+
com.google.android.youtube:YouTube
96+
com.google.android.keep:Google Keep
97+
com.google.android.apps.tachyon:Google Duo
98+
com.google.ar.lens:Google Lens
99+
com.google.android.feedback:Google Feedback
100+
com.netflix.mediaclient:Netflix
101+
com.netflix.partner.activation:Netflix activation
102+
com.facebook.katana:Facebook
103+
com.facebook.orca:Facebook Messenger
104+
com.facebook.services:Facebook Services
105+
com.facebook.system:Facebook System
106+
com.instagram.android:Instagram
107+
com.spotify.music:Spotify
108+
com.qualcomm.qti.workloadclassifier:Workload classifier
109+
com.qualcomm.qti.poweroffalarm:Power off alarm
110+
com.qualcomm.qti.devicestatisticsservice:Device statistics
111+
com.android.bips:Built-in Print Service
112+
com.android.bookmarkprovider:Bookmark provider
113+
com.android.printspooler:Print spooler
114+
com.android.wallpaperbackup:Wallpaper backup
115+
com.android.wallpapercropper:Wallpaper cropper
116+
"
117+
118+
CAUTION_PACKAGES="
119+
com.oneplus.contacts:OnePlus Contacts
120+
com.oneplus.dialer:OnePlus Phone app
121+
com.oneplus.launcher:OnePlus Launcher
122+
com.oneplus.mms:OnePlus Messages
123+
com.oneplus.music:OnePlus Music player
124+
com.oneplus.setupwizard:Setup wizard
125+
com.oneplus.systemui:System UI components
126+
net.oneplus.launcher:OxygenOS Launcher
127+
net.oneplus.opsystemhelper:System helper
128+
com.google.android.apps.maps:Google Maps
129+
com.google.android.gm:Gmail
130+
com.google.android.googlequicksearchbox:Google Search
131+
com.google.android.inputmethod.latin:Gboard
132+
com.google.android.calendar:Google Calendar
133+
com.qualcomm.qti.callenhancement:Call enhancement
134+
com.qualcomm.qti.callfeaturessetting:Call features
135+
com.qualcomm.qti.dynamicddsservice:Dynamic DDS service
136+
com.qualcomm.qti.simsettings:SIM settings
137+
com.android.chrome:Chrome browser
138+
com.android.mms.service:MMS service
139+
"
140+
141+
DANGEROUS_PACKAGES="
142+
com.oneplus.framework:OnePlus framework
143+
com.oneplus.opbugreportlite:Bug reporting service
144+
com.oneplus.security:Security framework
145+
net.oneplus.opdiagnose:System diagnostics
146+
com.google.android.gms:Google Play Services
147+
com.google.android.gsf:Google Services Framework
148+
com.google.android.tts:Text-to-speech
149+
com.qualcomm.qti.ims:IMS service for VoLTE
150+
com.qualcomm.qti.telephonyservice:Telephony service
151+
com.android.cellbroadcastreceiver:Emergency alerts
152+
com.android.emergency:Emergency information
153+
"
154+
155+
# Function to remove packages
156+
remove_packages() {
157+
local packages="$1"
158+
local category="$2"
159+
local count=0
160+
local failed=0
161+
162+
print_colored $BLUE "Removing $category packages..."
163+
164+
echo "$packages" | while IFS=':' read -r package desc; do
165+
if [ -n "$package" ] && [ "$package" != "" ]; then
166+
echo "Removing: $desc ($package)"
167+
168+
# Try uninstalling first
169+
pm uninstall --user 0 "$package" 2>/dev/null
170+
if [ $? -eq 0 ]; then
171+
print_colored $GREEN "✓ Uninstalled: $package"
172+
count=$((count + 1))
173+
else
174+
# If uninstall fails, try disabling
175+
pm disable-user --user 0 "$package" 2>/dev/null
176+
if [ $? -eq 0 ]; then
177+
print_colored $YELLOW "⚠ Disabled: $package"
178+
count=$((count + 1))
179+
else
180+
print_colored $RED "✗ Failed: $package"
181+
failed=$((failed + 1))
182+
fi
183+
fi
184+
fi
185+
done
186+
187+
echo ""
188+
print_colored $GREEN "Processed packages in $category category"
189+
echo ""
190+
}
191+
192+
# Function for interactive removal
193+
interactive_removal() {
194+
print_colored $BLUE "=== INTERACTIVE PACKAGE REMOVAL ==="
195+
echo ""
196+
197+
print_colored $GREEN "SAFE packages (recommended to remove):"
198+
echo "$SAFE_PACKAGES" | grep -v '^$' | while IFS=':' read -r package desc; do
199+
if [ -n "$package" ]; then
200+
echo "$desc"
201+
fi
202+
done
203+
echo ""
204+
205+
read -p "Remove SAFE packages? (y/n): " choice
206+
if [ "$choice" = "y" ] || [ "$choice" = "Y" ]; then
207+
remove_packages "$SAFE_PACKAGES" "SAFE"
208+
fi
209+
210+
print_colored $YELLOW "CAUTION packages (may affect functionality):"
211+
echo "$CAUTION_PACKAGES" | grep -v '^$' | while IFS=':' read -r package desc; do
212+
if [ -n "$package" ]; then
213+
echo "$desc"
214+
fi
215+
done
216+
echo ""
217+
218+
read -p "Remove CAUTION packages? (y/n): " choice
219+
if [ "$choice" = "y" ] || [ "$choice" = "Y" ]; then
220+
remove_packages "$CAUTION_PACKAGES" "CAUTION"
221+
fi
222+
223+
print_colored $RED "DANGEROUS packages (NOT recommended):"
224+
echo "$DANGEROUS_PACKAGES" | grep -v '^$' | while IFS=':' read -r package desc; do
225+
if [ -n "$package" ]; then
226+
echo "$desc"
227+
fi
228+
done
229+
echo ""
230+
231+
read -p "Remove DANGEROUS packages? (y/n): " choice
232+
if [ "$choice" = "y" ] || [ "$choice" = "Y" ]; then
233+
print_colored $RED "WARNING: Removing these packages may break device functionality!"
234+
read -p "Are you absolutely sure? (yes/no): " confirm
235+
if [ "$confirm" = "yes" ]; then
236+
remove_packages "$DANGEROUS_PACKAGES" "DANGEROUS"
237+
fi
238+
fi
239+
}
240+
241+
# Function for batch removal (safe packages only)
242+
batch_removal() {
243+
print_colored $BLUE "=== BATCH REMOVAL (SAFE PACKAGES ONLY) ==="
244+
echo ""
245+
print_colored $YELLOW "This will remove all SAFE OnePlus bloatware packages."
246+
print_colored $YELLOW "These are apps that can be safely removed without affecting core functionality."
247+
echo ""
248+
249+
read -p "Continue with batch removal? (y/n): " choice
250+
if [ "$choice" = "y" ] || [ "$choice" = "Y" ]; then
251+
remove_packages "$SAFE_PACKAGES" "SAFE"
252+
print_colored $GREEN "Batch removal completed!"
253+
else
254+
print_colored $YELLOW "Batch removal cancelled."
255+
fi
256+
}
257+
258+
# Function to list all installed packages
259+
list_all_packages() {
260+
print_colored $BLUE "=== ALL INSTALLED PACKAGES ==="
261+
echo ""
262+
print_colored $YELLOW "Listing all installed packages (this may take a moment)..."
263+
pm list packages -f | sort
264+
echo ""
265+
print_colored $GREEN "Package listing completed."
266+
}
267+
268+
# Main menu
269+
show_menu() {
270+
echo ""
271+
print_colored $BLUE "=== ONEPLUS BLOATWARE REMOVER MENU ==="
272+
echo "1. Interactive removal (recommended)"
273+
echo "2. Batch removal (remove all safe packages)"
274+
echo "3. List all installed packages"
275+
echo "4. Create backup only"
276+
echo "5. Exit"
277+
echo ""
278+
read -p "Choose an option (1-5): " choice
279+
280+
case $choice in
281+
1)
282+
create_backup
283+
interactive_removal
284+
;;
285+
2)
286+
create_backup
287+
batch_removal
288+
;;
289+
3)
290+
list_all_packages
291+
;;
292+
4)
293+
create_backup
294+
print_colored $GREEN "Backup created successfully!"
295+
;;
296+
5)
297+
print_colored $GREEN "Exiting OnePlus Bloatware Remover."
298+
exit 0
299+
;;
300+
*)
301+
print_colored $RED "Invalid option. Please choose 1-5."
302+
show_menu
303+
;;
304+
esac
305+
}
306+
307+
# Main execution
308+
main() {
309+
print_header
310+
check_environment
311+
312+
# Check if pm command is available
313+
if ! command -v pm >/dev/null 2>&1; then
314+
print_colored $RED "Error: 'pm' command not found!"
315+
print_colored $YELLOW "Make sure you're running this in a Shizuku terminal with proper permissions."
316+
exit 1
317+
fi
318+
319+
show_menu
320+
}
321+
322+
# Run the script
323+
main

0 commit comments

Comments
 (0)