RE env for inspecting APKs
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

148 lines
5.1 KiB

  1. setImmediate(function() {
  2. Java.perform(function() {
  3. var url = Java.use("java.net.URL");
  4. url.$init.overload('java.lang.String').implementation = function (var0) {
  5. console.log("[*] Created new URL with value: " + var0 +"\n");
  6. return this.$init(var0);
  7. };
  8. url.openConnection.overload().implementation = function () {
  9. console.log("[*] Created new URL connection\n");
  10. return this.openConnection();
  11. };
  12. url.openConnection.overload('java.net.Proxy').implementation = function (var0) {
  13. console.log("[*] Created new URL connection with proxy value: " + var0 +"\n");
  14. return this.openConnection(var0);
  15. };
  16. var URLConnection = Java.use("java.net.URLConnection");
  17. URLConnection.connect.implementation = function () {
  18. console.log("[*] Connect called.\n");
  19. this.connect();
  20. };
  21. URLConnection.getContent.overload().implementation = function () {
  22. var content = this.getContent();
  23. console.log("[*] Get content called. Content: " + content + "\n");
  24. return content;
  25. };
  26. URLConnection.getContentType.implementation = function () {
  27. var contentType = this.getContentType();
  28. console.log("[*] Get content type called. Content type: " + contentType + "\n");
  29. return contentType;
  30. };
  31. URLConnection.getContentLength.implementation = function () {
  32. var contentLength = this.getContentLength();
  33. console.log("[*] Get content length called. Content length: " + contentLength + "\n");
  34. return contentLength;
  35. };
  36. URLConnection.getContentLengthLong.implementation = function () {
  37. var contentLengthLong = this.getContentLengthLong();
  38. console.log("[*] Get content length long called. Content length long: " + contentLengthLong + "\n");
  39. return contentLengthLong;
  40. };
  41. URLConnection.getContentEncoding.implementation = function () {
  42. var contentEncoding = this.getContentEncoding();
  43. console.log("[*] Get content encoding called. Content encoding: " + contentEncoding + "\n");
  44. return contentEncoding;
  45. };
  46. URLConnection.getDate.implementation = function () {
  47. var contentDate = this.getDate();
  48. console.log("[*] Get date called. Date: " + contentDate + "\n");
  49. return contentDate;
  50. };
  51. URLConnection.getExpiration.implementation = function () {
  52. var contentExpiration = this.getExpiration();
  53. console.log("[*] Get expiration called. Expiration: " + contentExpiration + "\n");
  54. return contentExpiration;
  55. };
  56. URLConnection.getLastModified.implementation = function () {
  57. var lastModified = this.getLastModified();
  58. console.log("[*] Get last modified called. Value: " + lastModified + "\n");
  59. return lastModified;
  60. };
  61. URLConnection.getInputStream.implementation = function () {
  62. console.log("[*] Get input stream called.\n");
  63. return this.getInputStream;
  64. };
  65. URLConnection.setDoOutput.overload('boolean').implementation = function (var0) {
  66. console.log("[*] URLConnection.setDoOutput called with value: " + var0 + ".\n");
  67. this.setDoOutput(var0);
  68. };
  69. URLConnection.setDoInput.overload('boolean').implementation = function (var0) {
  70. console.log("[*] URLConnection.setDoInput called with value: " + var0 + ".\n");
  71. this.setDoInput(var0);
  72. };
  73. var httpURLConnection = Java.use("com.android.okhttp.internal.huc.HttpURLConnectionImpl");
  74. httpURLConnection.setRequestMethod.overload('java.lang.String').implementation = function (var0) {
  75. console.log("[*] Set request method called: " + var0 + "\n");
  76. this.setRequestMethod(var0);
  77. };
  78. httpURLConnection.setRequestMethod.overload('java.lang.String').implementation = function (var0) {
  79. console.log("[*] Set request method called: " + var0 + "\n");
  80. this.setRequestMethod(var0);
  81. };
  82. httpURLConnection.connect.implementation = function () {
  83. console.log("[*] Connect called.\n");
  84. this.connect();
  85. };
  86. httpURLConnection.disconnect.implementation = function () {
  87. console.log("[*] Disconnect called.\n");
  88. this.disconnect();
  89. };
  90. httpURLConnection.getResponseCode.implementation = function () {
  91. var responseCode = this.getResponseCode();
  92. console.log("[*] Get response code called: " + responseCode + "\n");
  93. return responseCode;
  94. };
  95. var httpsURLConnection = Java.use("com.android.okhttp.internal.huc.HttpsURLConnectionImpl");
  96. httpsURLConnection.setRequestMethod.overload('java.lang.String').implementation = function (var0) {
  97. console.log("[*] Set request method called: " + var0 + "\n");
  98. this.setRequestMethod(var0);
  99. };
  100. httpsURLConnection.connect.implementation = function () {
  101. console.log("[*] Connect called.\n");
  102. this.connect();
  103. };
  104. httpsURLConnection.disconnect.implementation = function () {
  105. console.log("[*] Disconnect called.\n");
  106. this.disconnect();
  107. };
  108. httpsURLConnection.getResponseCode.implementation = function () {
  109. var responseCode = this.getResponseCode();
  110. console.log("[*] Get response code called: " + responseCode + "\n");
  111. return responseCode;
  112. };
  113. httpsURLConnection.setRequestProperty.overload('java.lang.String', 'java.lang.String').implementation = function (var0, var1) {
  114. console.log("[*] URLConnection.setRequestProperty called with key: " + var0 + " and value: " + var1 + ".\n");
  115. this.setRequestProperty(var0, var1);
  116. };
  117. });
  118. });