Projects

Some Projects on XDA

After getting known Android well it was time to dig some deeper into these phones I had with Android on it.

Use your daily phone as a webcam

See my thread here on xda. You dont need an USB cable perse. It can also be done via Wifi if you:

You can use adb over wifi too. Here is how.

  • adb shell

  • su

  • setprop service.adb.tcp.port 5555

  • stop adbd

  • in Developer Options untick and tick USB debugging, that will start adb daemon again

On your pc now type: adb connect <ip of your device>

Carrier Network Unlocking on Samsung Android

Although not directly related to Android it was fun and sometimes frustrating to do since so little was known about the dungeons of those smartphones.

First I decided to find some way to network unlock my then precious Samsung i5500. It soon became clear this data is "hidden" in the phone by the provider. Unlike the other Samsung phones there was no /efs partition visible to work with. More can be read here.

Providers/Carriers use the CSC mechanism on Samsung phones to lock the Phone to their network. CSC stands for Customer Sales Code. It work like this.

While flashing your phone with an official Samsung ROM there will be a ROM part called CSC that will be flashed at /system/csc.

This part contains Country, Region or Telecom/Carrier provider folders abbreviated with 3 letter sales codes. (NEE, XEN, FOP etc)

The current CSC has 4 files in /system/csc: contents.db customer.xml, others.xlm and sales_code.dat

These are processed at a factory reset (or with specific *# Dial Code)

You can get your current CSC with this command: adb shell getprop ril.sales_code

The customer.xml can contain: APN settings, Country info,

<Settings>

<Main>

<Security>

<NbNetworkLock>1</NbNetworkLock>

<NetworkLock>26801</NetworkLock>

</Security>

If you have NbNetworkLock in it your phone is carrier locked. If you leave the NbNetworkLock at value 1 it will relock at a factory reset.

Better root your phone (this is why rooting is a pain in the ass for Carriers :) ) and edit this xml file.

Remount /system as writeable with mount -o remount,rw rfs /system

Edit /system/csc/customer.xml and change NbNetworkLock to 0. If this section is not present in /system/csc/customer.xml you can always enter it with a NbNetworkLock value of 0.

Reapply CSC settings

There are a few ways you can reapply the CSC settings.

  • Factory reset your phone with dialing: *2767*3855#

  • Run Preconfig with adb: am start -a android.intent.action.MAIN -n com.android.Preconfig/.Preconfig

  • Run Preconfig with dialing: *#272*<IMEI>#

If you have a Home launcher that can add Custom Activities you can add Preconfig.Preconfig as an icon to your Home screen too.

Find proper Preconfig activity:

  • pm list packages|grep -i config

  • for example com.sec.android.Preconfig

  • dumpsys package com.sec.android.Preconfig

  • gives output like below

Activity Resolver Table:

Non-Data Actions:

android.intent.action.MAIN:

428ecae8 com.sec.android.Preconfig/.Preconfig filter 428ecde8

428ed100 com.sec.android.Preconfig/.PreconfigCanada filter 428ed320

428ed470 com.sec.android.Preconfig/.PreconfigRegionalDevice filter 428ed6b0

Command will be: am start -n com.sec.android.Preconfig/.Preconfig

Data monitor in GingerBread (Android 2.3)

While playing with Android, you know decompiling stuff etc, I noticed a hidden data usage monitor connected to a data throttling function. Probably provided by Google to offer providers a means to limit the data flow after a certain amount of data was consumed by that phone. Now in ICS a data monitor is standard. But in the 2.3 days of Android you had to do this.