Last active
March 17, 2018 14:04
-
-
Save valeth/025928c9286988ab001fea8fc4e4a5ee to your computer and use it in GitHub Desktop.
RottenSys Check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
services = / | |
com.android.yellowcalendarz | |
|com.changmi.launcher | |
|com.android.services.securewifi | |
|com.system.service.zdsgt | |
/x | |
devices = `adb devices`.lines[1..-2].map { |x| x.split("\t").first } | |
abort 'No device connected' if devices.empty? | |
devices.each do |device| | |
packages = `adb -s #{device} shell 'pm list packages -f'`.lines | |
issues = packages | |
.select { |x| services.match?(x) } | |
.reduce('') { |acc, x| acc += " #{x.chomp}\n" } | |
issues = " No suspicious packages found\n" if issues.empty? | |
puts "Results for #{device}:\n#{issues}\n" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment