Title: Unable to reflect response in android app using appium and Java · Issue #17 · appium/mitmproxy-java · GitHub
Open Graph Title: Unable to reflect response in android app using appium and Java · Issue #17 · appium/mitmproxy-java
X Title: Unable to reflect response in android app using appium and Java · Issue #17 · appium/mitmproxy-java
Description: I am using below configuration. Installed MITM certificate on my emulator. Installed MITM proxy, websocket and other related dependecy as mentioned in appiumPro article Part of code dealing with proxy is as per below ` List messages = ne...
Open Graph Description: I am using below configuration. Installed MITM certificate on my emulator. Installed MITM proxy, websocket and other related dependecy as mentioned in appiumPro article Part of code dealing with pr...
X Description: I am using below configuration. Installed MITM certificate on my emulator. Installed MITM proxy, websocket and other related dependecy as mentioned in appiumPro article Part of code dealing with pr...
Opengraph URL: https://github.com/appium/mitmproxy-java/issues/17
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Unable to reflect response in android app using appium and Java","articleBody":"I am using below configuration. \r\n1. Installed MITM certificate on my emulator.\r\n2. Installed MITM proxy, websocket and other related dependecy as mentioned in appiumPro [article](https://appiumpro.com/editions/65-capturing-network-traffic-in-java-with-appium)\r\n\r\nPart of code dealing with proxy is as per below\r\n `\r\n List\u003cInterceptedMessage\u003e messages = new ArrayList\u003c\u003e();\r\n\r\n // remember to set local OS proxy settings in the Network Preferences\r\n proxy = new MitmproxyJava(\"C:\\\\Python311\\\\Scripts\\\\mitmdump.exe\", (InterceptedMessage m) -\u003e {\r\n if(\r\n\r\n m.getRequest().getUrl().toString().toLowerCase().startsWith(apiURL.toLowerCase()) \u0026\u0026\r\n m.getRequest().getMethod().equalsIgnoreCase(\"post\")\u0026\u0026\r\n getJsonObject(new String(m.getRequest().getBody())).hasNonNull(\"operationName\")\u0026\u0026\r\n getJsonObject(new String(m.getRequest().getBody())).get(\"operationName\").asText().equalsIgnoreCase(\"getPharamcyTATInfo\")\r\n )\r\n {\r\n\r\n JsonNode responseBodyJson = getJsonObject(new String(m.getResponse().getBody()));\r\n String modifiedResp = updateValuesInJson(responseBodyJson.toString(),\r\n \"data.getSkuInfo.tatInfo.tatResponse.inventoryExist\",false,\r\n \"data.getSkuInfo.tatInfo.tatResponse.items[0].exist\",false);\r\n m.getResponse().setBody(modifiedResp.getBytes(StandardCharsets.UTF_8));\r\n m.getResponse().getHeaders().add(new String[]{\"My Test Resp Header\",\"Header Value\"});\r\n messages.add(m);\r\n }\r\n return m;\r\n });\r\n proxy.start();\r\n\r\n login(initializeDriver(testMethod),credentialManager);\r\n`\r\n\r\nnow I have printed the intercepted message and modified response. but the app is still receiving the unmodified request. \r\nwhen I do below\r\n`\r\nmessages.forEach(\r\n x-\u003e{\r\n LOGGER.info(\"########Request Operation : \"+x.toString() +getJsonObject(new String(x.getRequest().getBody())).get(\"operationName\"));\r\n LOGGER.info(\"########### Response Body :\" +new String(x.getResponse().getBody()));\r\n }\r\n\r\n );`\r\ni see the proper response (modified one), this response never made it app, it is still showing the normal behaviour.\r\n\r\nP.S. the app is Android native app\r\nPlease advice","author":{"url":"https://github.com/ashuaviator1987","@type":"Person","name":"ashuaviator1987"},"datePublished":"2023-02-14T16:44:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/17/mitmproxy-java/issues/17"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:dd07243b-29ac-5018-c2a7-a7983d3e3b21 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D158:31B4C:2015752:2945ED3:697D77E5 |
| html-safe-nonce | b7a94c24eaa9cfd32eb2e72c6b66c522b0f762c7df580294cf41506f1ad1623a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTU4OjMxQjRDOjIwMTU3NTI6Mjk0NUVEMzo2OTdENzdFNSIsInZpc2l0b3JfaWQiOiI4MTc1NTIzNTY2MTc4NDQ3MDkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 446ec6f8bc7aba49b6c60c8fb3c8cf39d5636322887f2483efc6c2d31da8ffa2 |
| hovercard-subject-tag | issue:1584492749 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/appium/mitmproxy-java/17/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4582213481068709a80fa5ee251ea33316a8a6b356d22b46e6d19d75ad50d70b/appium/mitmproxy-java/issues/17 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4582213481068709a80fa5ee251ea33316a8a6b356d22b46e6d19d75ad50d70b/appium/mitmproxy-java/issues/17 |
| og:image:alt | I am using below configuration. Installed MITM certificate on my emulator. Installed MITM proxy, websocket and other related dependecy as mentioned in appiumPro article Part of code dealing with pr... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ashuaviator1987 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6 |
| turbo-cache-control | no-preview |
| go-import | github.com/appium/mitmproxy-java git https://github.com/appium/mitmproxy-java.git |
| octolytics-dimension-user_id | 3221291 |
| octolytics-dimension-user_login | appium |
| octolytics-dimension-repository_id | 181068418 |
| octolytics-dimension-repository_nwo | appium/mitmproxy-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 181068418 |
| octolytics-dimension-repository_network_root_nwo | appium/mitmproxy-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7c85641c598ad130c74f7bcc27f58575cac69551 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width