Skip to content

Instantly share code, notes, and snippets.

@valeth
Last active March 17, 2018 14:04
Show Gist options
  • Save valeth/025928c9286988ab001fea8fc4e4a5ee to your computer and use it in GitHub Desktop.
Save valeth/025928c9286988ab001fea8fc4e4a5ee to your computer and use it in GitHub Desktop.
RottenSys Check
#!/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