removeElectraBeta.c 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. //
  2. // removeElectraBeta.c
  3. // electra
  4. //
  5. // Created by CoolStar on 2/12/18.
  6. // Copyright © 2018 Electra Team. All rights reserved.
  7. //
  8. #include "removeElectraBeta.h"
  9. #include "file_utils.h"
  10. #include <unistd.h>
  11. #include <spawn.h>
  12. #include <sys/wait.h>
  13. void cleanupPotentialManualFiles(){
  14. int rv;
  15. pid_t pd;
  16. unlink("/bin/bash");
  17. unlink("/authorize.sh");
  18. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Applications/jjjj.app", NULL }, NULL);
  19. waitpid(pd, NULL, 0);
  20. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Applications/Extender.app", NULL }, NULL);
  21. waitpid(pd, NULL, 0);
  22. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Applications/GBA4iOS.app", NULL }, NULL);
  23. waitpid(pd, NULL, 0);
  24. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Applications/Filza.app", NULL }, NULL);
  25. waitpid(pd, NULL, 0);
  26. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Library/dpkg", NULL }, NULL);
  27. waitpid(pd, NULL, 0);
  28. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Library/Cylinder", NULL }, NULL);
  29. waitpid(pd, NULL, 0);
  30. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Library/LaunchDaemons", NULL }, NULL);
  31. waitpid(pd, NULL, 0);
  32. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Library/Zeppelin", NULL }, NULL);
  33. waitpid(pd, NULL, 0);
  34. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/etc/alternatives", NULL }, NULL);
  35. waitpid(pd, NULL, 0);
  36. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/etc/apt", NULL }, NULL);
  37. waitpid(pd, NULL, 0);
  38. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/etc/dpkg", NULL }, NULL);
  39. waitpid(pd, NULL, 0);
  40. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/etc/dropbear", NULL }, NULL);
  41. waitpid(pd, NULL, 0);
  42. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/etc/pam.d", NULL }, NULL);
  43. waitpid(pd, NULL, 0);
  44. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/etc/profile.d", NULL }, NULL);
  45. waitpid(pd, NULL, 0);
  46. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/etc/ssh", NULL }, NULL);
  47. waitpid(pd, NULL, 0);
  48. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/include", NULL }, NULL);
  49. waitpid(pd, NULL, 0);
  50. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/lib/apt", NULL }, NULL);
  51. waitpid(pd, NULL, 0);
  52. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/lib/dpkg", NULL }, NULL);
  53. waitpid(pd, NULL, 0);
  54. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/lib/pam", NULL }, NULL);
  55. waitpid(pd, NULL, 0);
  56. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/lib/pkgconfig", NULL }, NULL);
  57. waitpid(pd, NULL, 0);
  58. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/lib/cycript0.9", NULL }, NULL);
  59. waitpid(pd, NULL, 0);
  60. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/libexec/cydia", NULL }, NULL);
  61. waitpid(pd, NULL, 0);
  62. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/libexec/gnupg", NULL }, NULL);
  63. waitpid(pd, NULL, 0);
  64. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/share/bigboss", NULL }, NULL);
  65. waitpid(pd, NULL, 0);
  66. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/share/dpkg", NULL }, NULL);
  67. waitpid(pd, NULL, 0);
  68. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/share/gnupg", NULL }, NULL);
  69. waitpid(pd, NULL, 0);
  70. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/share/tabset", NULL }, NULL);
  71. waitpid(pd, NULL, 0);
  72. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/var/cache/apt", NULL }, NULL);
  73. waitpid(pd, NULL, 0);
  74. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/var/db/stash", NULL }, NULL);
  75. waitpid(pd, NULL, 0);
  76. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/var/lib/apt", NULL }, NULL);
  77. waitpid(pd, NULL, 0);
  78. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/var/lib/dpkg", NULL }, NULL);
  79. waitpid(pd, NULL, 0);
  80. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/var/stash", NULL }, NULL);
  81. waitpid(pd, NULL, 0);
  82. posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/var/tweak", NULL }, NULL);
  83. waitpid(pd, NULL, 0);
  84. }
  85. void removeElectraBeta(void){
  86. cleanupPotentialManualFiles();
  87. int rv;
  88. pid_t pd;
  89. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Applications/Anemone.app", NULL }, NULL);
  90. waitpid(pd, NULL, 0);
  91. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Applications/SafeMode.app", NULL }, NULL);
  92. waitpid(pd, NULL, 0);
  93. unlink("/usr/lib/SBInject.dylib");
  94. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/usr/lib/SBInject", NULL }, NULL);
  95. waitpid(pd, NULL, 0);
  96. unlink("/usr/lib/libsubstitute.0.dylib");
  97. unlink("/usr/lib/libsubstitute.dylib");
  98. unlink("/usr/lib/libsubstrate.dylib");
  99. unlink("/usr/lib/libjailbreak.dylib");
  100. unlink("/usr/bin/recache");
  101. unlink("/usr/bin/killall");
  102. unlink("/usr/share/terminfo");
  103. unlink("/usr/libexec/sftp-server");
  104. unlink("/usr/lib/SBInject.dylib");
  105. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Library/Frameworks", NULL }, NULL);
  106. waitpid(pd, NULL, 0);
  107. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/System/Library/Themes", NULL }, NULL);
  108. waitpid(pd, NULL, 0);
  109. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/bootstrap", NULL }, NULL);
  110. waitpid(pd, NULL, 0);
  111. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Library/Themes", NULL }, NULL);
  112. waitpid(pd, NULL, 0);
  113. unlink("/usr/lib/SBInject.dylib");
  114. rv = posix_spawn(&pd, "/electra/rm", NULL, NULL, (char **)&(const char*[]){ "rm", "-rf", "/Library/MobileSubstrate", NULL }, NULL);
  115. waitpid(pd, NULL, 0);
  116. }