[Q] ROM developers: How to increase concurrent HTTP connections? - Android Q&A, Help & Troubleshooting

Hi Folks,
My company is importing some Android-based TV boxes from China, and we're experiencing a strange bug with some apps we are developing to run on them. I'm trying to find a specific solution that I can tell them to implement in a firmware upgrade, but I am not sure where to look, so I hope someone here can help!
Anyway here is the problem. In some apps (especially Adobe AIR-based ones), there seems to be a limit to concurrent HTTP requests to a web server. On an earlier ICS 4.0.4 firmware for these devices, this did not cause any problems. But they recently released a JB 4.1.1 firmware, and this problem occurs.
Let's say an app requests 20 items by HTTP from a web server (XML files, PNG or JPG images). What will happen is about 2/3 of these will be sent back, and the rest just remains blank, as if in a perpetual waiting status.
Looking at the web server's logs, there is no requests at all for these missing items.
And, it's totally random. If you re-launch the app, the missing items will be different ones.
So, I am guessing the app can only request so many things at the same time.
No, does anyone know of a system property that could be adjusted to solve this?
BTW I am unable to replicate this bug on any other device. The TV boxes in question are based on Rockchip 3066 SoC's

Using modern HTTP (i.e. HTTP/1.1), you should never open an excessive amount of sessions. Never more than four simultaneous. Using HTTP/1.1 keep-alive, all requests are sent using those four sessions interleaved. If opening one session per object, and doing this in parallel, you'd most certainly lose things due to resource starvation, e.g. the server gets out of worker forks.

That's the weird thing, on the web server, keepalive is on (I also tested with it off, it was worse)
So maybe it's the opposite, AIR or the firmware or something is trying to send more requests than it should, so some are blocked indefinitely?

eTiMaGo said:
That's the weird thing, on the web server, keepalive is on (I also tested with it off, it was worse)
So maybe it's the opposite, AIR or the firmware or something is trying to send more requests than it should, so some are blocked indefinitely?
Click to expand...
Click to collapse
Not blocked, but replied with a TCP reset. Run tcpdump to see what's going on.

Thanks for the tip, I managed to root the box and run tcpdump on it, but I'm a bit lost now... I tried to filter RST packets on port 80 but can't seem to find any.
Any hints on what I should look for/command syntax to use?

eTiMaGo said:
Thanks for the tip, I managed to root the box and run tcpdump on it, but I'm a bit lost now... I tried to filter RST packets on port 80 but can't seem to find any.
Any hints on what I should look for/command syntax to use?
Click to expand...
Click to collapse
Dump all packets between the hosts: tcpdump -i ethx -s1500 -w packets.pcap host host.nr.one and host host.nr.two
Run the app, then analyze the packets.pcap file for any anomalies (tcpdump -r packets.pcap).

Related

Problem with VNC server software

Hi -
I need to be able to control my Transformer Prime. I have tried
VNC servers (multiple ones). I've tried every remote control daemon in the store, and a few paid ones.
Problem is as follows - they all allow me to connect, however the screen (even after changing and trying every possible setting on my client, including embedded Java software). EVERYTHING yields the below image. I tried turning off and on every single option in the server and client, and tried various other software. All of it seems to be reading the wrong screen pointer...
The 2nd screen shot is from an expensive Smartdog product. I tried the relay mode but results were identical.
I submitted logs to the developers, but maybe someone here can write a simple, working vnc daemon for us Prime 4.0.3 x.x.x.21 folks.
Has anyone ran into this problem and how does one solve it? I literally tried everything, including making sure the screen never turns off, etc. I get the same results, a green version of the boot screen twice across my VNC viewer. I killed a day trying to figure it out no closer than I began.
Any ideas from people?
Much obliged in advance - You guys have saved my arse several times already!
.21 I made sure the root was kept.
Hope someone can help
--
Dave
Posted with XDA App
This is obvious because the app capture images from screen buffer, however, some models, such as yours, no longer user frame buffer device for rendering.
There are several servers, including at least one in the market, and one I helped develop that will work with rooted transformers (I have a TF201).
Here is a link to the one I work on:
http://forum.xda-developers.com/showthread.php?t=1476648
Near the end of that thread is a link to one of the servers in the market that seems to also work, but I have not personally tried it.
huisinro said:
This is obvious because the app capture images from screen buffer, however, some models, such as yours, no longer user frame buffer device for rendering.
Click to expand...
Click to collapse

[Q] Whisperpush by Cyanogenmod

The latest update to CM10.2 on Xperia U today, brought the whisperpush. I googled it. basically there is no clear instruction or no elaboration on how to set this feature up or what this feature actually does. Someone knows anything about it?
mukul1233 said:
The latest update to CM10.2 on Xperia U today, brought the whisperpush. I googled it. basically there is no clear instruction or no elaboration on how to set this feature up or what this feature actually does. Someone knows anything about it?
Click to expand...
Click to collapse
I got this from CM11 and Gapps are needed to get it work, so I didn't got it working.
Got this from the CM site, too clear for me.
In July, Koush announced that CyanogenMod would be seeing integrated, system-wide secure messaging integration with compatibility with TextSecure. For those unfamiliar, TextSecure is an open-source cross-platform (iOS and Android) client that encrypts your SMS messages both locally, and over the air when sending to other TextSecure users. The application is maintained by Open WhisperSystems, and lead engineer Moxie Marlinspike.
Click to expand...
Click to collapse
When I use a vanilla Android 4.3 together with Textsecure and send a text message to a registered Whisperpush system (Cgm Kitkat) with gapps. Nothing seems to happen. It should be compatible right?
Via Android & Tapatalk 2.
rigelq said:
When I use a vanilla Android 4.3 together with Textsecure and send a text message to a registered Whisperpush system (Cgm Kitkat) with gapps. Nothing seems to happen. It should be compatible right?
Via Android & Tapatalk 2.
Click to expand...
Click to collapse
Did you get it working? According to what I found in my searches it should be compatible. But up to now, all my tries sending encrypted messages between CM10.2 with Whisperpush and a non-rooted mobile with TextSecure fail. Any hints?
There doesn't appear to be any documentation other than the API description and one blog post about it. I had no luck making it work. The TextSecure app itself works fine for me - it works, as far as I can tell, by becoming the default SMS app and thus getting all incoming SMSes and sending all outgoing SMSes, so that it's able to negotiate keying with the partner.
The integration of WhisperPush in CM11 appears to be designed to make it so you don't need to use a specific SMS app, instead intercepting SMS messages at a lower layer and doing keying negotiation there, so that the user-facing app doesn't need to deal with the specifics. I also read somewhere that CM runs their own WhisperPush server distinct from the one used by the TextSecure app, but that the servers are federated so that clients of one should be able to interact with clients of the other.
However, when trying to exchange messages between a TextSecure phone and a CM11 phone, they clearly don't negotiate anything. When sending a message from the CM11 phone, the TextSecure phone receives the plaintext SMS message immediately; it never receives a negotiation message nor is there a way to ask the CM11 phone to initiate a secure session. In theory the middleware layer could discover that the destination phone number has registered itself with the server(s) and automatically try to initiate a secure session without being asked to, but it never did this while I was experimenting with it.
When sending a message from the TextSecure phone to the CM11 phone using the TextSecure app, there is a "Initiate" button by which you can explicitly ask it to initiate a secure session. When you do this, it sends a negotiation message to the CM11 phone in order to set up the session. However, on the CM11 phone, this message is received as a plain text SMS and just displayed - it isn't intercepted by the middleware and thus the session does not get set up and CM11 never adds the other contact's key to its contact key list.
So I'm guessing part of it just hasn't been written yet. I struck out completely on trying to even find a place to discuss or ask questions about this, so I'm posting it on this thread in the hopes someone will find it while searching for the same problem and have some ideas. I don't get the impression the authors, either on the CM or WhisperSystems sides, want to hear from end users who just can't figure out how to make it work. Unfortunately I have only a very rudimentary grasp of java and android app development, and quickly got lost trying to understand the source code, though I do think it's great that it's there.
I think it would be awesome if there were some software similar to this but that "just worked" to the extent that naive end users could be using it by default without having to do much of anything to get it working - maybe some day.
epv.
I made the same observation. I could not successfully establish an encrypted connection between a whisperpush-enabled CM-device and a non CM-device with text secure. Nor did I find any information on the web regarding this.
A shame, I think this would be a really interesting feature of CM. At least, I'm not the only one who doesn't get it working...
The worst part is apparently there is no way to unregister from cm's Whisperpush servers which entails that you cannot register onto textsecures whispersystem servers. Therefore if you are running cm and want the push services from the textsecure app well then you are **** ouf of luck apparently for the moment. The whole process is supposed to be seamlessly and transparent but it seems to be becoming more of a burden which is sad because i love the concept they are trying to pitch. I guess cm kinda ruined it when when their servers were distinct from and textsecures whispersystems and failed a devlivering a notifaction when you are actually in a encrypted enviremoent. All my searches for a solution to my dilemma led me here hence why i am posting my thoughts where i guess more willing users should be able to act upon this problem.
I used the last days TextSecure on top of CM, which worked for me via SMS. Before the latest update, I did not get any registration from TextSecure. My hope was now, that after the update it might work, but I did not yet have time to try. I'll test it this evening, but you're not putting my hopes high.
I am facing the same problem. Does anybody have a solution yet? :crying:
How to contact Cyanogenmod, so my number can be deleted?
kyuubie said:
The worst part is apparently there is no way to unregister from cm's Whisperpush servers which entails that you cannot register onto textsecures whispersystem servers. Therefore if you are running cm and want the push services from the textsecure app well then you are **** ouf of luck apparently for the moment. The whole process is supposed to be seamlessly and transparent but it seems to be becoming more of a burden which is sad because i love the concept they are trying to pitch. I guess cm kinda ruined it when when their servers were distinct from and textsecures whispersystems and failed a devlivering a notifaction when you are actually in a encrypted enviremoent. All my searches for a solution to my dilemma led me here hence why i am posting my thoughts where i guess more willing users should be able to act upon this problem.
Click to expand...
Click to collapse
Same problem here... any solutions now?
IceTi said:
Same problem here... any solutions now?
Click to expand...
Click to collapse
I haven't tried it yet but this workaround seems to be successful for a few users. http://forum.cyanogenmod.com/topic/87482-critical-flaw-in-whisperpush/ .This discussion seems to be relevant to a bug report that's been going on with cm and someone seems to have come up with a smal hack that requires adb and cURL.
"I just unregistered using adb. For completeness, this is the complete sequence of what I did:
Phone:
- Developer options
- Root access -> Apps and ADB
- ADB over network -> check
PC:
$./adb connect <device ip>
$./adb shell
Phone:
$ su
# cat /data/user/0/org.whispersystems.whisperpush/shared_prefs/org.whispersystems.whisperpush_preferences.xml
# exit
$ exit
At some point the phone will ask if you want to give permission. Remember to reset the Developer options settings when done.
The printed contents from fields "pref_registered_number" and "pref_push_password" must be copied in the curl line below:
PC:
$ ./adb disconnect
$ curl -v -k -X DELETE --basic --user $pref_registered_number:$pref_push_password https://whisperpush....1/accounts/gcm/
Relevant response from curl:
[...]
* Server auth using Basic with user '<phone number>'
> DELETE /v1/accounts/gcm/ HTTP/1.1
> Authorization: Basic <some key>
> User-Agent: curl/7.33.0
> Host: whisperpush.cyanogenmod.org
> Accept: */*
>
< HTTP/1.1 204 No Content
Now wait for, say, 30 minutes and try registering TextSecure. For me this worked." by storm49152
EDIT: I can confirm that this method worked for me, currently unregistered from cm's whisperpush systems and registered now with texsecure's Open whipser systems.
Confirmed working.
ADB isnt needed, only this file. Can be opened in Root Explorer too.
I had to use curl on my linux machine, as curl on Win 7 was not supporting https.
Yeah, worked for me too!
Just tried with cm's WhipserPush and non-cm TextSecure. I had to reregister on my cm device and now it works :laugh:
But I don't get delivery reports, I don't have group chat and picture was not received...
I'm still on CM10.2.1 Does anybody know if this is solved in CM11?
Now I also use TextSecur App, as I want to have group chat and possibility to send pictures. First had to disable privacy guard. It stopped TextSecure from catching the verification SMS. Deregistered like described above.
For those who need a fix for this and aren't on the phone they registered with, I've written a Ruby script to fake a registration and use that registration to unregister all devices associated with the number. You'll need to be able to receive a text message to the number you want to unregister, but for legitimate use that shouldn't be a problem.
https://github.com/daveio/whisperpush-unregister
Hello I own a Nexus 4 and I can't unregister from CyanogenMod Whisperpush. I tried everything : the Ruby script, the official way from Cyanogen's privacy settings, the adb way;I also tried to flash the last nightly but every time I try to register within the TextSecure app it shows the same error message. Can you please help me in this?
Thank you
Inviato dal mio Nexus 4 utilizzando Tapatalk

Torque Pro OBD app and data logging

So i got myself an OBD bluetooth scanner and the Torque app...bloody brilliant.
So much information!
anyway, i cant seem to get it to upload data logs to the web viewer?
i have my account created and setup correctly but nothing in the web viewer when i log in.
Does anyone use the app and have any ideas on how to get this to work?
Secondary i have e-mailed myself some data logs and cant get them to open properly?
I cant seem to get Track Recorder to work with Torque Sync software, it stucks at Searching for Torque
Valiceemo said:
So i got myself an OBD bluetooth scanner and the Torque app...bloody brilliant.
So much information!
anyway, i cant seem to get it to upload data logs to the web viewer?
i have my account created and setup correctly but nothing in the web viewer when i log in.
Does anyone use the app and have any ideas on how to get this to work?
Secondary i have e-mailed myself some data logs and cant get them to open properly?
Click to expand...
Click to collapse
I imagine the particular posters have found answers to their problems seeing as this thread
dates from 2014 but I thought it might be worthwhile answering all the same as I ran in to the same niggles when I began using this app so if anyone searching these issues subsequently may find some worth from my reply.
First of all as a far as experience and knowledge is concerned. Firstly with cars;fixing,modifying, engine management tuning, obd2, diagnostics. Basically my auto knowledge is extremely wide and extensive from approx 35 years of obsession and getting stuck in an the deep end whereas my knowledge and experience of computers and smart phone tech is on much, much shakier ground
In fact, for those of my vintage. i.e late 30s,early 40s remember when we were kids. and programmable VCRs were the height of cutting edga technology. Well I'm like the way our parents and grand parents were then. i.e pretty much baffled by it and even following the instructions it was hit and miss whether you actually managed to record that film rhat was on at 4am lol.
So for the second issue brought up by the OP it doesn't matter whether you email yourself the log file or not (I found the few times i tried it that the file wouldn't attach and when it did the problem was the same anyway) you need Microsoft Office or any other type of office suite to view the files. On the pc i have Microsoft office but had to download an app to my phone to view. csv files. Again an office suite that not only displays. csv files but puts them into a spreadsheet format is required.
As for the first issue it's preferable in every way to view the site. on a pc because on the phone display the actual box to sign into is off screen and takes a little bit of zooming out and seaching to find, the same goes after you have signed in when another box appears with a list of the logs files recorded and the tab to choose it. This is where my lack of fundamental computer/web knowledge comes in. I can't tell you why it doesn't sit nicely inti an easily accessible mobile format but it doesn't. Once you've found the first sign in box/pop up it becomes simple, annoying but simple.
As for there being nothing after signing into the webview site successfully all I can assume is either you've no log files to view which you should have if it's all been set up correctly, including choosing which PIDs to send to logfile or the pop up/window where you click on your logfiles is right off screen and has to be looked for. Of course you don't get that problem if accessed using your desktop.

Finding packets and IP from decompiled APK?

So I'm working on a project on making an online android game work on PC from packet sending / receiving. Limited graphics.
Basically all packets are sent in a very unencrypted way, using very easy text and integers.
Easily picked up from packet sniffing, IP, Data etc. However, return results seems to be encrypted according to some packetscanning application for android. Unsure as packetscanning for android seems a bit meh. As I cannot get the game to launch thru bluestacks as hardware is listed as "Unsupported", I cannot find out for sure. Else I could have gotten more data and from that and could just have made the entire game based on the scanned sent/recieved packets coming from bluestacks. However the game also sends login info with each packet similar to
SendPacket(RetrieveResources,xxx,yyy,date,time,username,authid)
Username and authid is based of android hardware ID, which could easily be recoded into the java application.
But then I cannot find how it bases the authid and username of hardare id. Or how the application tells the server to create a new user.
Now, Myself I am an Java developer, however as I've never worked on Android applications previously this stuff is zzzz compared to real Java. I've managed to get about 99% source code from decompiling, deobfuscating and extracting the .dex file inside the application.
However, here's where things just go into full wtf-mode. I've extracted over 200 .class files into their correct folders and such, however, as confusing as this is. I simply cannot find how the game functions, or where it stores the IP and such, is it stored in an offsite .xml file? Storage file? Database? Resource file? Browsing through unlimited lines of scrap code, that seems irrelevant to the game, Facebook connections, Amazon, Google play purchase, Crittercism, GooglePlay classes etc. But noone of them actually seem to hold any useful data and alot of stuff actually just seems to be "Drag and Drop this into your application then call functions from it" like, "Authenticate to Facebook". I've managed to find alot of things loading .obb files, that doesnt seem to exist at all, tho the game pretty much goes "!blabla.obb" "CreateObb();" The game does not exist on facebook at all, just uses it to recieve ProfilID as an Login ID.
The game also uses UnityPlayer which seems to be the "Launch" class, which I've browsed thru but found nothing relevant. I found alot of .classes that seems similar to each other aswell containing the same stuff. I've also found alot of stuff that actually seems to be packet sends and connections, however, there is nothing that points that it is towards the game, but rather connections for i.e google play services.
Biggest .class>.java file is about ~40kb. Which for mee seems small, as projects I usually work with is well about 10mb inside the main.class then calls for unnecessary stuff from side classes.
Anyone mind pointing out on how android applications handles connections?
Is the files really no bigger than 40kb and just scrambled into tons of subclasses?
Feels like I'm missing obvious stuff that should be right there declared as a variable, but I can't find it.

Unknown outgoing connections

Hi Folk,
on my a5y17lte, with Lineageos 16, I saw a lot outgoing ntp connections! The list of servers start slowly and grows over the time up to 77, or more! Depends on how long the phone is up. After a reboot starts from begining.
Ok, it's a cool feature to sync the time over network, but 77 time!?! It makes no sense to ask 77 times about what time it is.
Additionaly the server don't look serious. The most of my apps are from F-Droid store and I've got only a handfull of Playstore apps.
Who can help me find out where the connections comes from? Is that normal on android and does somebody have the same effect?
Netstat -p wont tell me an app.
Here're some example of the connections:
176.9.81.252,bar.bandie.org,123,37.83.151.177,60284,UDP4,ESTABLISHED,
185.16.60.96,tick.infra.9rc.de,123,37.84.159.221,43991,UDP4,ESTABLISHED,
51.15.91.217,217-91-15-51.rev.cloud.scaleway.com,123,37.84.142.93,52192,UDP4,ESTABLISHED,
144.76.100.49,wtfstfu.org,123,37.82.183.166,46064,UDP4,ESTABLISHED,
144.76.59.37,funky.f5s.de,123,37.80.147.21,40166,UDP4,ESTABLISHED,
193.30.35.49,impartial-slip.squareflow.cc,123,37.81.165.4,48366,UDP4,ESTABLISHED,
78.46.253.198,maggo.info,123,37.84.181.143,60798,UDP4,ESTABLISHED,
51.15.182.163,par.cyberbits.eu,123,10.8.0.1,40432,UDP4,ESTABLISHED,
129.70.132.33,stratum2-4.NTP.TechFak.Uni-Bielefeld.DE,123,37.85.239.111,44575,UDP4,ESTABLISHED,
116.202.64.148,dns02.xstream-labs.com,123,37.84.87.87,40932,UDP4,ESTABLISHED,
144.76.96.7,golf.zq1.de,123,37.81.174.215,45239,UDP4,ESTABLISHED,
157.230.114.16,ntp2l.versadns.com,123,37.84.159.91,49424,UDP4,ESTABLISHED,
212.18.3.18,ntp1.m-online.net,123,37.85.191.13,33081,UDP4,ESTABLISHED,
80.237.128.148,ntp1.hosteurope.de,123,37.85.33.74,51562,UDP4,ESTABLISHED,
193.30.35.11,mortified-chicken.squareflow.cc,123,37.85.38.3,37230,UDP4,ESTABLISHED,
37.221.195.24,ares.cativa.net,123,37.82.75.176,43560,UDP4,ESTABLISHED,
5.199.135.170,ve1124.venus.servdiscount-customer.com,123,37.81.150.92,33354,UDP4,ESTABLISHED,
188.68.54.217,finkenzeller.eu,123,37.82.239.225,45818,UDP4,ESTABLISHED,
Thanks a lot
Nowbody have an idea, or can check if its normal?
It takes only a small "netstat" comand at the terminal.
I did a fresh new test installation on a second device. After installed my common apps the ntp connections grows again!
@schlombie
The connections you listed in post #1 show their related domain name in readable fashion. So what's your problem?
To prevent all or some edit your device's host file.
jwoegerbauer said:
@schlombie
The connections you listed in post #1 show their related domain name in readable fashion. So what's your problem?
To prevent all or some edit your device's host file.
Click to expand...
Click to collapse
I want to know which app initiates these connections?
After 3-4 day without a reboot, I've got more than 50 open connections who uses my battery and my data!

Categories

Resources