Capture App JSON Requests Android via Fiddler - android

Recently I tried to figure out where the application Meet Mobile's data was being pulled from. This is mostly out of curiosity as I noticed they have this free app for Android/iOS but nothing available from a computer which struck me as odd.
I set up fiddler on my computer with my phone using my computer as a proxy to access the internet, but when I do this Meet Mobile is not able to fetch data, even though I can use the browser to navigate the web without issue. I followed this guide to set up my proxy:
http://www.cantoni.org/2013/11/06/capture-android-web-traffic-fiddler
I have discovered that the main site the data is being pulled from is https://awmobile.active.com/, and I believe it is being pulled via port 443. However, I cannot figure out the correct syntax to query from this site (which I believe the application uses JSON).
Please let me know if there is a better way to go about capturing the web requests my application is sending off to its home base. This is mostly an exercise of curiosity, and I'm excited to see what potential answers there are.
Cheers!

I figured it out - I needed to install the Fiddler certificate on my Android phone for it to allow the connections. I followed the steps listed here:
http://www.cantoni.org/2013/11/06/capture-android-web-traffic-fiddler
Thank you for your help and time!

Related

local storage being wiped in ionic on iOS and android

I am making a mobile app w/ a rails server for the backend. The basic premise is when a user signs in successfully, the server returns a unique token and their user_id. I store only those 2 things in local storage (window.localStorage not any library)
localStorage.setItem('user_id', data['id']);
localStorage.setItem('authToken', data['auth_token']);
I then use the token/ID to communicate with the server.
The problem, is recently in testing (app is already live w/ a couple dozen users), the token is occasionally not getting set or saving, and as a result, I get a 500 error. I say occasionally because sometimes it does work. I guess I'm mainly just confused. It was working fine w/ my initial pushes on the app, and works on ionic view. I don't know what has changed, as I have not changed any code.
From my standpoint and in my initial debugging, it looks like local storage is either unreliable, i need to use an angular/ionic option (not window.localStorage), find another way to store data like I have been (SQLite?), or it could be a permissions bug?
If anyone has experience something similar to this and found a viable solution, I would love to learn more about this and find a solution to fix it.
I think that before you choose another data store option, you must see your application in execution, try inspect the app in Google Chrome inspect or in Safari (case iOS), look at the localStorage proprieties using your app, I believe this is enough for you do fix your bug.
Inspect Chrome: https://developers.google.com/web/tools/chrome-devtools/remote-debugging/
Inspect Safari:
http://phonegap-tips.com/articles/debugging-ios-phonegap-apps-with-safaris-web-inspector.html

How to use local REST API on smartphone?

The environment: There is a REST API written in PHP running on a computer in my local network. I want a smartphone app to use this REST API just as it was on a real server.
The problem: How can I do that? Anyway I have to establish a URL, reachable by my smartphone, pointing to my computer. It doesn't matter for me, if the URL is a "real registrated url" or a local url such as "example.dev".
The restrictions: I don't want to have my smartphone rooted and I have no static IP.
Does anyone have some advices for me? It would be really great to come over this.
My thoughts: I was thinking about a local dns server (e.g. on a raspberry pi). But I don't know if this works, because all the guides say, you already must have two domains registrated and already pointing to static IP adresses to the target system.
Thank you for your help and I hope, nobody else has already asked that.
Luke
UPDATE: I don't want to run it on a real server, because it's currently under development. Forgot to mention that. So I want to develop the whole system locally.

Get JSON data from local server (IP via service announcement?)

I'm trying to communicate with a local API server, but found out Android devices are not able to communicate with local domains. I've been up all night looking for ways, but came with nothing. I found the jmdns packages, but don't know how to include it in my cordova/ionic app. Currently i am trying a Cordova plugin (diont), but am a little lost ;-) Does anybody here know of good working sollutions?
I am building a device for use in a local network, so i have to figure this out :-)
Thanks!
Bad news, this is a well known Android bug/missing feature.
https://code.google.com/p/android/issues/detail?id=8030
If you really need to make this work, the only "solution" i can think of is to do a DNS lookup yourself, since you are using Cordova, you'll probably need to write a plugin to do that.

Android - Orbot Built-in App

NOTE: If you have no idea what TOR or Orbot is, check out this links below:
https://www.torproject.org/
So, I was wondering if possible to add TOR support to my app. This would save the user alot of stress looking for a working proxy and besides, TOR is one of the most safest proxies out there.
Im aware that the The TOR team made an app called "Orbot" which allows Android devices to proxy apps using orbot. The problem is, the only way for Orbot to proxy apps is if they have ROOT and some users do not like taking techy approaches, especially when it has "THIS COULD BRICK YOUR DEVICE!" so I thought if its possible to rip out the Orbot source and add it to my app so my app gets proxied.
This can save lots of people from downloading multiple apps and cut time on setting this up (since my app has to have proxy support to be proxied through TOR which I havent seen much of so i really have no idea on how to have something like this) but im not sure where in the source code is the actual routing to the TOR network and thought i could get a little boost in this.
Im not trying to make my own Orbot, i will give credit
So, does anyone know where to start? I decompiled the regular Orbot app and skimmed through the source but not much rings a bell.
Thanks!
Use ORlib, which "is an Android Library for use by any application that wishes to route its network traffic through Orbot/Tor".
If you want to avoid forcing user to install Orbot, you can include Tor in your application using this project which includes Orbot's tor binary and allows full control over it.

I am almost there...PhoneGap Android connect to WCF Service

Firstly I would like to thank all the experts here on stackoverflow, by reading questions asked and looking at example code and reading the answers i have been able to get to this point. Thank you once again!
I have been spending hours and hours searching for a solution, I’ve read through many posts on this issue. It’s seem this is a issue a lot of others are/has been struggling with.I would highly appreciate any more advise or tips if somebody can assist in this frustrating issue.
All my development are done on my local machine. (Win 7, Visual Studio 11beta)
A WCF Service is hosted in IIS Express on its own port or IIS 7.5 (.Net Framework 4.0)
Second Web Application with only Html5/jQuery is hosted in IIS Express on a different port.
Using Eclipse 3.7.2 with Android SDK 17 also on my local machine.
Its seem all the software are functioning properly.
Android Emulator is working, Phonegap/Cordova library is installed, etc.
I am using Android 4.0.3 with Cordova 1.6.0
I am asking assistance to find out why my phonegap emulator ajax call won’t go through to my WCF REST Service. I don’t have a actual android device now to test the program on at this moment therefore I must use the Emulator.
Some more detail:
I have a WCF REST Service developed in .Net receiving & sending in JSON and JSON-P.
I have tested this with a second web application on a different port to make sure cross domain calls are allowed.
I have also used the RESTclient plugin for Firefox and can use it to make JSON and JSON-P calls successfully. [ http://restclient.net/ ]
So I am sure the WCF Service is working as it should. There shouldn't be any cross domain issue.
When I take the Html file with jQuery that I know is working within Visual Studio, to eclipse, copy into phonegap app, I try to make a basic call to my WCF server and I am unable to connect to the server.
I have changed the URL from [http://localhost:50425/LoginService.svc/GetData] to [http://10.0.2.2:50425/LoginService.svc/GetData]
according to android documentation : [http://developer.android.com/guide/developing/devices/emulator.html#networkaddresses]
I have created an allow all whitelist with the following setting:
[ access origin="*" ]
within the cordova.xml file. See: [http://professionalaspnet.com/archive/2012/05/15/Whitelisting-Domains-in-Cordova-_2800_PhoneGap_2900_-Android.aspx]
The correct permissions have been set inside the AndroidManifest.xml file according to [http://docs.phonegap.com/en/1.8.1/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android]
When I initiate the call, I use $.ajaxSetup error function to trap network error etc. and display with alert the error message. Used console.log() to make sure it passes this function without a error.
When the call actually happens, I receive a "Bad Request - Invalid Host Name. HTTP 400. The request hostname is invalid."
If the call would have been successful, I use breakpoints inside Visual Studio to know for certain the call has been made and see the request coming through.
Is there any other ways to test from emulator if I can access the "external" host? In this case to make sure emulator actually can find the service?
Is there any tools or other configuration settings that needs to be done?
I have even deleted my emulator and created a new one but it still fails to connect to the WCF Service.
I would really like this to work, would like to build a complete phonegap application but can’t continue if I can't make a call to a web service.
Any advise would be greatly appreciated.
PhoneGap is really just a wrapper for html/css/js webpages with a js library for accessing phone specific functionality, which can be compiled to multiple native mobile platform apps.
So this is really not a PhoneGap issue...
You say you are using JQuery to query your web service, if you can open the html file which fires of the request in your normal browser window, and everything works fine. The problem is not with the code, but with the Emulator you are using, maybe some miss configurations idk.
Okay if that still fails, you are most likely pointing to the wrong/no IIS Instance.
If you have two IIS Instances running on port 80 idk how that will behave, but i don't think that will work very well, my guess is that one of them will override the other one.
So if you are hosing your webservice on IIS 1, but IIS 2 overrides IIS 1, then you will never reach the webservice, and get the error you get.
So when you changed to point to the other IIS Instance, it started working again.

Categories

Resources