Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Browser sending "Dalvik" as user agent

Android Browsers is sending Dalvik as the user agents in the request headers.

I am currently working on a mobile site having a simple login page that validates username and password then authorizes users profile.

But when i checked the request headers i saw something unusual, there were two user agents from the same device.

Following are the user-agents from the same device:

"Mozilla/5.0 (Linux; Android 4.1.2; C5303 Build/12.0.A.1.257) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/34.0.1847.114 Mobile Safari/537.36"

"Dalvik/1.6.0 (Linux; U; Android 4.2.2; C2004 Build/15.2.A.2.5)"

Even something strange the cookies that were initialed we either reset or dropped.

Is there any way i can debug this further for more information and get a better view on this issue??

This issue is not seen in old android phones or ios or windows phones.

**Issue noticed in high end android mobile handsets having KitKat/JellyBean OS

like image 917
Austin N Avatar asked May 22 '14 10:05

Austin N


People also ask

What is Dalvik in user agent?

Dalvik is the Android VM in which individual apps run.

What is browser user agent?

A user agent is a computer program representing a person, for example, a browser in a Web context. Besides a browser, a user agent could be a bot scraping webpages, a download manager, or another app accessing the Web.

What is a mobile user agent?

Published: 15 May 2022. The User-Agent (UA) string is contained in the HTTP headers and is intended to identify devices requesting online content. The User-Agent tells the server what the visiting device is (among many other things) and this information can be used to determine what content to return.

What is Useragent data?

The user agent is an HTTP header that web browsers and other web applications use to identify themselves and their capabilities. Your web security software captures and logs user agent data when users browse the Internet.


2 Answers

I just noticed a similar pattern of User-agents for back to back requests. In my case, the first request (with the Mozilla User agent) was from an embedded webview. The requested URL was to download a PDF file. What I've found is that the Android webview cannot handle the PDF content type, so it launches a PDF viewer through an intent. However, before this viewer is launched Android makes a second request for the same URL. In the second request, the Dalvik user agent is presented.

The two request strangeness has been discuss before, see Is setDownloadListener onDownloadStart called after the webview already Gets the file? and WebView - can't download file without requesting it twice?.

In my first request, from the webview, I see the user agent:

Mozilla/5.0 (Linux; U; Android 4.2.2; en-us; Galaxy Nexus Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

The second request (which I assume is from the Android OS, and not the webview) shows the user agent:

Dalvik/1.6.0 (Linux; U; Android 4.2.2; Galaxy Nexus Build/JDQ39)

like image 180
Michael Levy Avatar answered Sep 17 '22 14:09

Michael Levy


  • Dalvik is the Android VM in which individual apps run.
  • What you're seeing is the request header from a browser running in Android (which runs within Dalvik).
  • Hence the two UA (User Agent) strings, one for the browser, one for the VM in which it's running.
like image 34
Chris Halcrow Avatar answered Sep 20 '22 14:09

Chris Halcrow