Showing posts with label android. Show all posts
Showing posts with label android. Show all posts

Sunday, September 14, 2014

Capture android HTTP traffic on Fiddler

Fiddler is windows application for debugging HTTP traffic. It can also be used to capture HTTP traffic from a android device to analyse or debug any android HTTP application. To capture HTTP traffic Fiddler setup a web proxy server and monitor any traffic flowing through the proxy. By default  fiddler proxy service listens on the loopback adapter only due to which this proxy cannot be used by other application. Follow these steps to enable remote connections to Fiddler proxy and steps to define this proxy in android.

Step 1: To enable fiddler to accept remote connection goto Tools->Fiddler Options->Connections in Fiddler and Enable "Allow remote computers to connect". Also not the port number on which fiddler proxy listens default port is 8888.



Step 2: Using ipconfig find out IP address of fiddler's machine,

Step 3: Disable Firewall or add exception in firewall to allow fiddler for incoming connection.

Step 4: Now connect your android device to the same wifi network and goto wifi settings, long tap the connected wifi name and Now selet Modify Network option.

Step 5: Enable "Show advance options", set Proxy Settings to Manual then put ip address and port of fiddler proxy server. Now start your application in android and debug the HTTP traffic in fiddler. Remember to remove proxy once your done with debugging.




Friday, July 25, 2014

Camera not working in Micromax A250

In Micromax Canvas turbo i.e. A250 camera often failed to start and camera app only display a black screen the root cause for the issue is that mediaserver process is having open handles to camera device (see screenshot below). To make the camera work again either restart phone or kill mediaserver process if device is rooted using below script.

su -c "kill `pidof mediaserver`"

Sunday, August 11, 2013

Solved: Ployer momo9c keep on resets to factory defaults on every restart or shutdown

Ployer momo9c and other A10 devices running android ICS or CM10 sometimes resets to factory defaults after every reboot. This usually occurs after the update of busybox. To correct the issue go to the Terminal (using adb, Terminal Emulator or any other approach) and copy the busybox binary from /system/sbin or /system/xbin to /system/bin. Below are the command sequence to run

su
mount -o rw remount /system
cp /system/sbin/busybox /system/bin/busybox

If you are not able to find the busybox binary at the path mentioned above then use which command to locate the busybox.

which busybox

Sunday, May 12, 2013

Connect Joystick to play games on android


All most all of the android v4.0 and higher tablets are USB host enabled and comes with kernel modules of  ps3/xbox joystick etc but i had a cheap chinese made USB joystick (DragonRise gamepad) which i wanted to connect and play games with on my momo9 tablet with CM10 and there was no kernel module available for my requirement so here is my story how i compiled kernel module.

Prerequisites
  1. Requires a root access.
  2. Joystick and micro USB OTG cable.
  3. Android Terminal emulator and busybox.
First i verified that the joystick is being detected as a USB device using the lsusb command. I connected the joystick to the tablet using a micro USB OTG cable and run lsusb.

Then i started searching for the kernel module of my joystick and found many versions of generic joydev.ko but none of them were compatible for my device. When i used dmesg command to determine the cause for one of such module i found that the mismatch of vermagic which means that an android (linux) kernel module can be loaded only if it is compiled for the same linux version and if it is compiled for the CPU. Using uname -a command i found the linux kernel version and CPU which powers my android.


Once the kernel version is determined i again google for kernel module of my joystick which are build for my kernel and CPU but i was not able to find joystick kernel module for my momo9c with CM10 so i downloaded allwinner kernel source from https://github.com/christiantroy/linux-allwinner and the Sourcery CodeBench Lite edition from http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ and then compiled the kernel module. I compiled the kernel module on Backtrack5 virtual machine using following commands

make ARCH=arm sun4i_crane_defconfig
make menuconfig ARCH=arm 
make modules ARCH=arm CROSS_COMPILE=/sourcery-arm-toolchain/bin/arm-none-eabi




Then i moved the compiled module hid-dr.ko to the tablet to /system/modules/lib and loaded the module using insmod command and verified the new input joystick device using ls -l /dev/js? command. At last i downloaded a generic USB joystick android keylayout file for the joystick and moved it into the /system/usr/keylayout directoy.


Then i configured input devices and key mappings in nesoid emulator and started playing my favorite game on tablet with joystick. Though i have not tested but i am sure that if two joysticks are connected using USB OTG cable and USB Hub then multi-player games can also be played.

 

My compiled hid-dr.ko kernel module for Linux 3.0.6.36+ and the keylayout file can be downloaded from
https://dl.dropboxusercontent.com/u/48560079/joystick_hid_dr.zip contains hid-dr.ko and Vendor_0079_Product_0006.kl files.

Happy gaming!!! and enjoy :)

Saturday, April 27, 2013

Peformance improvement tweaks for CM10


On my momo9c i have CM10 but there were few performance issue. After some analysis i found that there were certain kernel modules which were not relevant to my needs or my device so i decided to remove them using following commands

#Remove ethernet modules
rmmod asix
rmmod mcs7830
rmmod qf9700
rmmod rtl8150
rmmod usbnet
rmmod gt2005

Also there minfree parameter were inappropriate for 512 MB which were making background application/services get kill by the lowmemorykiller module and making user experiance worst. I adjusted the minfree parameters of lowmemorykiller module using

#Adjust OOM minfree parameters
echo "1024,2048,4096,8192,10240,51200" > /sys/module/lowmemorykiller/parameters/minfree

Currently I have consolidated these commands into a scripts (download myinit.sh) and i run the script after every boot but in future i will add a post to move them into /system/etc/init.local.rc or modify the init.rc and init.sun4i.rc.

Wednesday, April 24, 2013

Android Auto Hathway Authentication

UPDATED ON 06 OCT 2013

AHA is now AVAILABLE ON PLAY STORE. I will still keep this post and older version on dropbox but it is highly recommended to download AHA from PlayStore.Please read my the updated Post
http://anilsoni85.blogspot.in/2013/10/auto-hathway-authentication-is-now.html


ORIGINAL POST

Here it is, my first android app and the first version of AHA. The application is not yet published on android Play Store but will be added in future. As of now it can be downloaded from my dropbox

https://dl.dropboxusercontent.com/u/48560079/AHA_Driod/AHA_Test_Signed_Aligned.apk

Here are the few screen shots

When wifi is enabled and if hathway modem is detected by the AHA then AHA will automatically authenticates you into the hathway network whenever required.


Use the setting screen to define your hathway user id and password.


Sunday, July 31, 2011

Why,how and what is rooting android?

What is rooting?
In android each process runs under a seprate user identity and the privilege of root user has been restricted by platform but there are certain hacks using which one can achieve root access and process of gaining the root access is known as rooting. The basic process of rooting includes following steps
  1. Remounting of /system with read/write access.
  2. Copying the patched binary of su into /system/bin/.
  3. Installation of superuser application (Available in market)
How to root my android?
There are many application using which you can root android but i prefer SuperClick utlitiy which is pretty simple and lets you root/unroot android. You can read more or download super click from http://forum.xda-developers.com/showthread.php?t=803682

Why do i require the to root access?
Root access is mostly require to do hacks like inserting module any external kernal module using insmod, accessing/modifcation of system files etc. A normal user never requires root access for performing basic operations.

Mounting windows share on android Froyo

Recently i bought my first android based mobile (Samsung Galaxy Pro) and since then i was looking for something to access my windows shared folder via wifi. So i started exploring and found that on a rooted device it is possible to mount a window share using using cifs (Common Internet File Sharing Protocol) kernel module (cifs.ko) and mount command. I looked over net and found many builds of cifs.ko but didn't found a build for my kernel version 2.6.23.9-perf PREEMPT so i decided to build my own cifs. To make the kernel module i downloaded firmware source code from samsung's open source code distribution website https://opensource.samsung.com/. During the build i found that cifs module depends on slow-work and for that i build another module slow-work.ko and then i used terminal emulator to exeute mount command for inserting kernel modules and mounting the share.

         insmod /mnt/system/lib/slow-work.ko
         insmod /mnt/system/lib/cifs.ko
         mount -o username=,password= -t cifs anil-pc/d$ /mnt/cifs/d

and wollla now i can access any shared file from laptop on mobile via wifi like any other local file on mobile.

If you are not good at linux commands then you can download Cifs manager https://market.android.com/details?id=ws.plattner.cifsmanager&hl=en to do the same for you.

You can download my build of kernel modules here http://dl.dropbox.com/u/48560079/cifs_and_slow_work_modules_2.6.32.9-perf_PREEMPT.zip (Specific to kernel version: 2.6.23.9-perf PREEMPT, use uname -a command to find your kernel version or goto Settings>About phone>Kernel Version)