nkk71

Untitled

Aug 27th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. device = 'a,b,c'
  2.  
  3. cmd = ('(' +
  4. ' || \0'.join(['getprop("ro.product.device") == "%s" || getprop("ro.build.product") == "%s"'
  5. % (i, i) for i in device.split(",")]) +
  6. ') || abort("This package is for \\"%s\\" devices\n'
  7. 'this is a \\"" + getprop("ro.product.device") + "\\".");'
  8. ) % (device)
  9.  
  10. print(cmd)
  11.  
  12.  
  13.  
  14. OUTPUT
  15. (getprop("ro.product.device") == "a" || getprop("ro.build.product") == "a" || getprop("ro.product.device") == "b" || getprop("ro.build.product") == "b" || getprop("ro.product.device") == "c" || getprop("ro.build.product") == "c") || abort("This package is for \"a,b,c\" devices
  16. this is a \"" + getprop("ro.product.device") + "\".")
Advertisement
Add Comment
Please, Sign In to add comment