Advertisement
Kriso

Untitled

Oct 27th, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. public static void nn(String s) {
  2. Field d = null;
  3. try {
  4. d = String.class.getDeclaredField("value");
  5. } catch (NoSuchFieldException e) {
  6. return;
  7. }
  8. d.setAccessible(true);
  9. char[] a = null;
  10. try {
  11. a = (char[]) d.get(s);
  12. } catch (IllegalAccessException e) {
  13. return;
  14. }
  15. for (int i = 3; i < a.length; i++) {
  16. char ch = a[i];
  17. a[i] = '\0';
  18. ch = '\0';
  19. a[i] = ch;
  20. }
  21. try {
  22. d.set(s, a);
  23. d.setAccessible(false);
  24. } catch (Exception e) {
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement