Translate

Friday, November 17, 2017

In Mac OS X, Get Network Packet Data and TCP Dump Data of Attached iOS Device.

Wireshark data and TCP Dump data collection methods:


One can get network packet data and tcp dump from iOS App using attach iOS device using USB to any mac device.

Requirement: UDID of connected iOS device.


1. Open terminal and fire below commands to add attached iOS device into rvictl list:


  • command:         rvictl -s
  • e.g.         rvictl -s xxc30xxxx6dxfe1xfb99xxx7546xxx777xxxxeax
  • result: Starting device                xxc30xxxx6dxfe1xfb99xxx7546xxx777xxxxeax [SUCCEEDED] with interface rvi0


This saves device into rvictl list and will be able to get tcp dump data for same. 


2. Now, to check if device is successfully added into list use command:


  • command:         rvictl -l
  • result: Current Active Devices:

                          [1] xxc30xxxx6dxfe1xfb99xxx7546xxx777xxxxeaxwith interface rvi0

Here, device's udid is listed with interface id (rvi0). This interface id (rvi0) is useful when getting data from wireshark.


3. To get tcp dump data on console use command:


  • command:  tcpdump -n  -i rvi0  -x tcp OR tcpdump -n -t -i rvi0 -q -A tcp
  • result:



4. Use wireshark to get network packet data:

Download and open Wireshark:

On home screen see for Capture heading. Under Capture, various interface ids will be listed. Choose interface id which was found when adding UDID into rvictl list.
For above example, it is: rvi0
Double click on "rvi0" and it opens window that started capturing network packet data.



This is it. Now you are able to get network packets and tcp dump data send/received to/from iOS device.



Ref: https://useyourloaf.com/blog/remote-packet-capture-for-ios-devices/

Download Wireshark from: https://www.wireshark.org/#download

Thursday, November 22, 2012

Generate google map api key


******************************************************************
Author:      Kartik Patel
Date:      2012-11-23
Subject:      Generate google map api key
******************************************************************


Operating Environment:

OS:         Windows 7 - 64 bit
Java:       jdk1.7.0_01, jre7

The debug.keystore contains a digitial certificate that android uses to launch applications on the emulator. The certificate is called 'androiddebugkey'.  We'll need to get some an MD5 hash for this certificate in order register for our map api key.


If you change/update/upgrade android/eclipse then you need to generate new key again in order to make your google map runs perfectly.



Step 1:

Run command prompt as administrator



Step 2:

Go to folder and then into <.android> folder
e.g: C:\Users\xxxxxx\.android>



Step 3:

Write below command on command prompt - It will generate MD5 Hash (Which is required to generate api key):
keytool -list -v -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
e.g: C:\Users\xxxxxx\.android>keytool -list -v -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android



Result:

As a result you will get MD5 Hash Certificate fingerprint as below:

Alias name: androiddebugkey
Creation date: xxx xx, xxxx
Entry type: PrivateKeyEntry
Certificate chain length: 1
Certificate[1]:
Owner: CN=Android Debug, O=Android, C=US
Issuer: CN=Android Debug, O=Android, C=US
Serial number: xxxxxxxx
Valid from: xxx xxx xx xx:xx:xx xxx xxxx until: xxx xxx xx xx:xx:xx xxx xxxx
Certificate fingerprints:
         MD5:  00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00 <=====  We need this
         SHA1: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
         SHA256: xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
         Signature algorithm name: SHA256withRSA
         Version: x

Extensions:

#1: ObjectId: x.x.xx.xx Criticality=false
SubjectKeyIdentifier [
KeyIdentifier [
xxxx: xx xx xx xx xx xx xx xx   xx xx xx xx xx xx  xx xx  .............Q..
xxxx: xx xx  xx                                        ..db
]
]


#####
Below step 3.1 must not be used in order to generate google map key - I have written below step because i have gone through this and get an error while generate online api key.


Step 3.1:

Write below command on command prompt - It will generate SHA1 Fingerprint (SHA1 is not required to generate API key we need MD5)
keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android
e.g: C:\Users\xxxxxx\.android>keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android



Result from 3.1:

As a result you will get SHA1 Certificate fingerprint as below:
androiddebugkey, Oct 30, 2012, PrivateKeyEntry,
Certificate fingerprint (SHA1): xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx



Error from Result 3.1:

The fingerprint you entered is not valid. Please press the Back button on your browser and enter a valid certificate fingerprint.



Reason for Error of 3.1:

SHA1 is not required to generate API key we need MD5.
#####



Step 4:

Now open your browser and go to the following url...
https://developers.google.com/android/maps-api-signup



Step 5:

Follow procedure to a generate api key.
Use only below MD5 Certificate fingerprint to generate api key
00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00




Result:

Now you have the api key, you can use it in the layout file of your application.

Your key is:
1xxxxxxx-xxxx-xxxxxxxxxx-xxxxxxxxxxxxx1

This key is good for all apps signed with your certificate whose fingerprint is:
00:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:00

e.g:
Here is an example xml layout to get you started on your way to mapping glory:
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="1xxxxxxx-xxxx-xxxxxxxxxx-xxxxxxxxxxxxx1"
/>





References:

http://www.remwebdevelopment.com/dev/a35/Android-How-To-Set-Up-an-API-Key-for-Google-Maps.html
http://stackoverflow.com/questions/2100158/google-map-not-displayed-in-android
http://stackoverflow.com/questions/3833108/android-google-maps-not-displaying

http://stackoverflow.com/questions/5102219/to-display-the-google-map-on-the-emmulator

Tuesday, August 17, 2010

List of windows APIs

Below site is very informative about Windows APIs and its functionality. One can take help of msdn to collect more details about these APIs. For windows programmer and specially who works with embedded product, this site is very important for them.

Link: http://www.pinvoke.net/

Entity Framework in ADO.Net

Entity Framework Overview
The Entity Framework is a set of technologies in ADO.NET that support the development of data-oriented software applications. Architects and developers of data-oriented applications have struggled with the need to achieve two very different objectives. They must model the entities, relationships, and logic of the business problems they are solving, and they must also work with the data engines used to store and retrieve the data. The data may span multiple storage systems, each with its own protocols; even applications that work with a single storage system must balance the requirements of the storage system against the requirements of writing efficient and maintainable application code. 

The Entity Framework enables developers to work with data in the form of domain-specific objects and properties, such as customers and customer addresses, without having to concern themselves with the underlying database tables and columns where this data is stored. With the Entity Framework , developers can work at a higher level of abstraction when they deal with data, and can create and maintain data-oriented applications with less code than in traditional applications. Because the Entity Framework is a component of the .NET Framework, Entity Framework applications can run on any computer on which the .NET Framework starting with version 3.5 SP1 is installed. 


The following sections in this topic provide more detail about the Entity Framework :

Friday, August 13, 2010

Silver Light Technology

Silverlight Overview
 
 
Microsoft Silverlight is a cross-browser, cross-platform implementation of the .NET Framework for building and delivering the next generation of media experiences and rich interactive applications (RIA) for the Web. Silverlight unifies the capabilities of the server, the Web, and the desktop, of managed code and dynamic languages, of declarative and traditional programming, and the power of Windows Presentation Foundation (WPF). 


Silverlight enables you to create a state-of-the-art application that has the following features:
  • It is a cross-browser, cross-platform technology. It runs in all popular Web browsers, including Microsoft Internet Explorer, Mozilla Firefox, and Apple Safari, Google Chrome, and on Microsoft Windows and Apple Mac OS X.
  • It is supported by a small download that installs in seconds.
  • It streams video and audio. It scales video quality to everything from mobile devices to desktop browsers to 720p HDTV video modes.
  • It includes compelling graphics that users can manipulate—drag, turn, and zoom—directly in the browser.
  • It reads data and updates the display, but it doesn't interrupt the user by refreshing the whole page.
  • The application can run in the Web browser or you can configure it so users can run it on their computer (out-of-browser).

Wednesday, August 4, 2010

Useful utilities for programmers

Some useful command and its functionality


MMC - Microsoft Management Console
A comment I frequently hear is users wishing there was one central location where they could go to perform the majority of the administrative tasks that are a part of life with a computer. Just remembering all the locations where these tasks can be accomplished is no small feat in itself. Microsoft must be keeping it a secret or user curiosity isn't what it once was, but such a place does exist; Microsoft Management Console. In Microsoft's own words, "Microsoft Management Console (MMC) hosts administrative tools that you can use to administer networks, computers, services, and other system components." That's all well and good, but what does it mean in real life? Basically, it means that you can create a customized set of tools and group them in a 'console' that is easily accessible without having to search through different locations to find one particular setting or group of settings.
Microsoft Management Console Basics
The first thing to understand is that a Microsoft Management Console is a host for an administrative tool called a snap-in. A snap-in is actually an Active-X module that is used to perform a specific function, but without a snap-in a console is useless. It's sole purpose is as an application to hold the snap-ins you select and provide a mechanism for them to become functional.  Each console is created from either a single snap-in or combination of snap-ins. Once a basic console has been created it's up to you to add snap-ins appropriate to the intended use of the console. To illustrate, use the Run command in Start Menu to open the Event Viewer Console (eventvwr.msc) and the Computer Management Console (compmgmt.msc). The Event Viewer Console will contain only the event viewer snap-in. The Computer Management Console also contains the same event viewer snap-in under the category System Tools. A comparison of Event Viewer in both locations will show they contain identical data. The event viewer snap-in can be used by itself to construct a single purpose console, or as a component part of a multiple purpose console such as Computer Management. Whether one snap-in or multiple snap-ins are used, once they are added to the host and saved with a .msc extension it becomes a functional Microsoft Management Console.
I mentioned the Event Viewer and Computer Management consoles. Both are pre-configured consoles that come with Windows XP. In addition there are quite a few others that are standard issue with XP. I've listed them in the table below with their everyday name and the file name that is used to launch them using the [Start] [Run] command.


Certificates certmgr.msc
Indexing Service ciadv.msc
Computer Management compmgmt.msc
Device Manager devmgmt.msc
Disk Defragmenter dfrg.msc
Disk Management diskmgmt.msc
Event Viewer eventvwr.msc
Shared Folders fsmgmt.msc
Group Policy gpedit.msc
Local Users and Groups lusrmgr.msc
Removable Storage ntmsmgr.msc
Removable Storage Operator Requests ntmsoprq.msc
Performance perfmon.msc
Resultant Set of Policy rsop.msc
Local Security Settings secpol.msc
Services services.msc
Windows Management Infrastructure (WMI) wmimgmt.msc
Component Services comexp.msc

As you can see from the table the pre-configured consoles that come with XP cover a wide array of tasks and services. Does it really make sense to create custom consoles when all of these are already available? Actually, it does. It's unlikely that any of the pre-configured consoles will precisely match the tasks you are faced with on a regular basis. Modifying the pre-configured consoles or creating new ones allows precise tailoring of the console to a specific task or group of tasks. This can eliminate having to move between different locations to accomplish tasks while helping to prevent overlooking parts of a specific task. In situations where administrative tasks are performed by multiple users, creating custom consoles related only to the specific task they perform lessens the chance of error or accessing areas that should remain unavailable. Additionally, since some consoles can be configured to administer remote as well as local computers, customizing a console can restrict access when required.

Reference Link:

Tuesday, August 3, 2010

Robotic technology in VS.Net 2008

Microsoft Robotics Developer Studio enables academic, hobbyist and commercial developers to easily create robotics applications across a wide variety of hardware.


 
Microsoft Robotics Developer Studio 2008 is a platform for developing robotics applications. The RDS 2008 R3 download is now available as a single Edition at no cost. It will also be available from MSDN, MSDNAA, DreamSpark or BizSpark. The Robotics web site has been updated with new information. For a list of the new features and changes, please see What’s New .


 
Additional code samples for RDS are available from CodePlex. This web site will allow small samples to be released outside of the normal product cycle. Users of RDS are also welcome to contribute to the code samples.

Reference Links: