Getting IMEI within an EVC program - MDA, XDA, 1010 General

Does anyone know how to programmatically read the IMEI using embedded visual C. I have tried the TAPI lineGetGeneralInfo function but this always seems to return an error, as it requires TAPI extensions which don't seem to work. Is there any other function or API which returns this info?
Any help would be appreciated.

You need to use the SimGetRecordInfo() function. The IMEI is stored at address 0x6F07.
Steve

Thanks,
However this is the Sim's IMSI (International Mobile Subs Identifier) which identifies the country and home network. I am trying to get the phone's IMEI which is the electronic serial no of the phone (to use as part of a secure https validation procedure).

IMEI Code
#include <TAPI.h>
#include <ExTAPI.h>
#define TAPI_VERSION_1_0 0x00010003
#define TAPI_VERSION_1_4 0x00010004
#define TAPI_VERSION_2_0 0x00020000
void CALLBACK lineCallbackFunc(DWORD dwDevice, DWORD dwMsg, DWORD dwCallbackInstance, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3);
void GetError(DWORD dwReturn);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
HLINEAPP hLineAp = NULL;
DWORD dwNumDevs, dwDeviceID = 2;
HLINE hLine = NULL;
int i;
WCHAR szIMSI[180];
WCHAR szIMEI[180];
WCHAR szOutput[50];
LINEGENERALINFO lpLineInfo;
DWORD dwReturn, dwAPIVersion = TAPI_CURRENT_VERSION;
lineInitialize(&hLineAp, hInstance, lineCallbackFunc, NULL, &dwNumDevs);
lineNegotiateExtVersion(hLineAp, dwDeviceID, TAPI_VERSION_1_0, TAPI_CURRENT_VERSION, dwAPIVersion, NULL);
lineOpen(hLineAp, dwDeviceID, &hLine, dwAPIVersion, 0, 0, LINECALLPRIVILEGE_NONE, 0, 0);
lpLineInfo.dwTotalSize = 180;
dwReturn = lineGetGeneralInfo(hLine, &lpLineInfo);
if (!dwReturn)
{
if (lpLineInfo.dwSubscriberNumberSize > 2)
{
for (i = 0; i < (signed) lpLineInfo.dwSubscriberNumberSize/2; i++)
szIMSI = *((unsigned short *)(&lpLineInfo) + i + lpLineInfo.dwSubscriberNumberOffset/2);
szIMSI=NULL;
MessageBox(NULL,szIMSI,_T(" IMSI"),MB_OK);
}
else
if (lpLineInfo.dwSubscriberNumberSize)
MessageBox(NULL,_T("Please Enter PIN"),_T(" IMSI"),MB_OK);
else
MessageBox(NULL,_T("No SIM Card Present"),_T(" IMSI"),MB_OK);
for (i = 0; i < (signed) (lpLineInfo.dwSerialNumberSize/2); i++)
szIMEI = *((unsigned short *)(&lpLineInfo) + i + lpLineInfo.dwSerialNumberOffset/2);
szIMEI=NULL;
wsprintf(szOutput,_T("NULL"));
MessageBox(NULL,szIMEI,_T(" IMEI"),MB_OK);
}
else
GetError(dwReturn);
lineClose(hLine);
lineShutdown(hLineAp);
return 0;
}
void CALLBACK lineCallbackFunc(DWORD dwDevice, DWORD dwMsg, DWORD dwCallbackInstance, DWORD dwParam1, DWORD dwParam2, DWORD dwParam3)
{
}
void GetError(DWORD dwReturn)
{
switch (dwReturn)
{
case LINEERR_RESOURCEUNAVAIL:
MessageBox(NULL,_T("No SIM Card"),_T("Error"),MB_OK);
break;
case LINEERR_INVALLINEHANDLE:
MessageBox(NULL,_T("Line Unavailable"),_T(" Error"),MB_OK);
break;
case LINEERR_STRUCTURETOOSMALL:
MessageBox(NULL,_T("Oops"),_T(" Error"),MB_OK);
break;
case LINEERR_INVALPOINTER:
MessageBox(NULL,_T("Line Pointer Unavailable"),_T(" Error"),MB_OK);
break;
case LINEERR_UNINITIALIZED:
MessageBox(NULL,_T("Radio Not Turned On"),_T(" Error"),MB_OK);
break;
case LINEERR_NOMEM:
MessageBox(NULL,_T("Out of Memory"),_T(" Error"),MB_OK);
break;
case LINEERR_OPERATIONUNAVAIL:
MessageBox(NULL,_T("Unavailable"),_T(" Error"),MB_OK);
break;
case LINEERR_OPERATIONFAILED:
MessageBox(NULL,_T("Please Turn Radio On"),_T(" Error"),MB_OK);
break;
default:
MessageBox(NULL,_T("Error"),_T(" Error"),MB_OK);
}
}

Works great
Thanks

hi all, i tried to above code but it gave me thos following error !
any one can help me plz ?
unresolved external symbol lineGetGeneralInfo referenced in function WinMain
thankx alot

hi alla again
these is nothing wrong else that i forgot to like the cellcore.lib lbrary to my project
the code compiled but it gave me the result of " Unavailable " !
so how do i can get the IMEI ?
i'm using ROM 3.16.13 ENG
best regards
Essa

Two possible answers:
A: Turn the phone on
B: HTC have changed the memory map allocation
I have some debug code behind the stuff I posted earlier to dump the entire contents of the lpLineInfo struct. i'l try and see what teh problem is.
On previous versions they omitted the IMEI or extended the HW id sections.

vpreHoose thanx alot for ur replay..
ur code is working fine the problem is that i didnt load the cellcore.lib for the evc compiler and the other problem is the DeviceID
in ur code u r using DeviceID = 2 while me i must use DeviceID = 0,
so i changed dwDeviceID = 2 to dwDeviceID = 0; and every thing is working fine
can u tell me how do i can get the caller number while mobile ringing ?
i would like to develope a software that assigne a ringing tone to each contact number.
thanx alot

Yea, I was a little bit lazy not to write it to loop through all deviceid's...
:roll:

Thanks very much to the person who provided the code. I'd been battling with lineGetGeneralStatus for days, no joy. Microsoft giving away nothing here. I found the missing line in my code from yours:
lpLineInfo.dwTotalSize = 180;
And now it works. If only MS had stated this, would have solved me a whole load of hastle.
There must be more and useful information on the ExTapi. Like how to use the functions so that they work. Does anybody have a reference??
Ben

I tried this code on my qtek 2020 but my application return the following error:
unavailable
why???

a favor to ask
can anyone convert the code to c#? would be much appreciated

Re: IMEI Code
will this code work in an emulator?

test

lollone said:
I tried this code on my qtek 2020 but my application return the following error:
unavailable
why???
Click to expand...
Click to collapse
I got the same problem, and then changed the value of dwDeviceID to 0
DWORD dwDeviceID = 0;
and now i get an another error:
Please Turn Radio On
Click to expand...
Click to collapse
while I am a Newbie with XDA, so i want to ask, what is the Radio and how to turn it on?
thanks a lot
Pai

pai said:
lollone said:
I tried this code on my qtek 2020 but my application return the following error:
unavailable
why???
Click to expand...
Click to collapse
I got the same problem, and then changed the value of dwDeviceID to 0
DWORD dwDeviceID = 0;
and now i get an another error:
Please Turn Radio On
Click to expand...
Click to collapse
while I am a Newbie with XDA, so i want to ask, what is the Radio and how to turn it on?
thanks a lot
Pai
Click to expand...
Click to collapse
I have solved this problem by only restart, i think the radio means Handy-Net

Smart phones ?
This method doesn't work on smart phones?!
On WM 2003 Smart phone it always gives unsupported operation

Related

[R&D] Upload files with DropBox

Hi, this is my code, i cant get upload a simple file:
Signgin in to DropBox:
.....private AccessTokenPair tokensDB;
.....private DropboxAPI<AndroidAuthSession> mDBApi;
.....final static private AccessType ACCESS_TYPE = AccessType.DROPBOX;
.....AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
.....AndroidAuthSession sesDropBox = new AndroidAuthSession(appKeys, ACCESS_TYPE);
.....mDBApi = new DropboxAPI<AndroidAuthSession>(sesDropBox);
.....mDBApi.getSession().startAuthentication(this);
When activity resums this code is executed:
.....mDBApi.getSession().finishAuthentication();
.....tokensDB = mDBApi.getSession().getAccessTokenPair();
when the user clicks over a button in same activity next code is executed:
protected void subeArchivos() {
.....// Uploading content.
.....String fileContents = "Hello World, this is only an example!!";
.....ByteArrayInputStream inputStream = new ByteArrayInputStream(fileContents.getBytes());
.....try {
..........mDBApi.putFile("/testing.txt", inputStream, fileContents.length(), null, null);
..........//Log.i("DbExampleLog", "The uploaded file's rev is: " + newEntry.rev);
.....} catch (DropboxUnlinkedException e) {
..........// User has unlinked, ask them to link again here.
..........Log.e("DbExampleLog", "User has unlinked.");
.....} catch (DropboxException e) {
..........toast = Toast.makeText(getApplicationContext(), "C U A: " + e.getMessage(), Toast.LENGTH_SHORT);
..........toast.show();
..........//Log.e("DbExampleLog", "Something went wrong while uploading.");
.....}
}
The code in red throws error. and after the conde in yellow is executed.
My mnifiest permissions are:
.....<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
.....<uses-permission android:name="android.permission.INTERNET"></uses-permission>
.....<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"></uses-permission>
P.D. All works, exept code in red!!
I hope you can help me!! thx!!
anyone??
I didn't understand anything exc. that you can't upload any file with Dropbox, but I had similar problem. Seems you shouldn't delete the Downloads app, else it bugs DB uploads.
Hope it helps.
thx man, every folder in his place, but maybe something in my code is wrong!!

[Q] advances 1.1 send IMEI to server

Hi all,
I searched the forum but cannot find one thread about this topic.
has anyone noticed that the app AdvanceS 1.1 send the IMEI to a server called loc.lidroid.com ?
Can anyone explain why this should nessesary ???
Thx in advance
Dys
Dys66 said:
Hi all,
I searched the forum but cannot find one thread about this topic.
has anyone noticed that the app AdvanceS 1.1 (which is probably part of Omega-ROM) send the IMEI to a server called loc.lidroid.com ?
Can anyone explain why this should nessesary ???
Thx in advance
Dys
Click to expand...
Click to collapse
I would get rid of that app no one should have your IMEI number that is really bad for you
Sent from my Nexus 4 using Tapatalk 2
......and report it too Google while you are at it, if it came from the play store
slaphead20 said:
......and report it too Google while you are at it, if it came from the play store
Click to expand...
Click to collapse
I froze it for now with Titanium.
But AdvanceS seems to be part of lidroid Mod which is probably included with Omega and other ROMS and is NOT out of Google Play.
Seems to be a config-tool for SystemUI. I don't used it so far ...
Therefore I think it will reactivated when I flash a new version of the ROM.
Dys66 said:
I froze it for now with Titanium.
But AdvanceS seems to be part of lidroid Mod which is probably included with Omega and other ROMS and is NOT out of Google Play.
Seems to be a config-tool for SystemUI. I don't used it so far ...
Therefore I think it will reactivated when I flash a new version of the ROM.
Click to expand...
Click to collapse
I see what it is control toggles app for lidroid delete it no matter what should not be uploading your IMEI number dev or no dev
Sent from my Nexus 4 using Tapatalk 2
Hmmmm.......I think I will notify the mods about this and let them get to the bottom of it
Edit...done.
OP Was this mod something you got off XDA? If so could you point me to it. I know of the mod and I've used it in my own roms but like others have said, It shouldn't be uploading your IMEI number anywhere. If it is, you might have gotten a hacked version of the mod with maliciousness code. If the source is XDA please let me know ASAP so we can look into it. If it's not from XDA then there really isn't much we can do about it
graffixnyc said:
OP Was this mod something you got off XDA? If so could you point me to it. I know of the mod and I've used it in my own roms but like others have said, It shouldn't be uploading your IMEI number anywhere. If it is, you might have gotten a hacked version of the mod with maliciousness code. If the source is XDA please let me know ASAP so we can look into it. If it's not from XDA then there really isn't much we can do about it
Click to expand...
Click to collapse
Now That's what i call swift action :thumbup: he did say he mite of come woth omega rom so that could mean he did not install a apk
Sent from my Nexus 4 using Tapatalk 2
just looked at loc.lidroid.com - seems to list phone numbers, all seem to be in China though ...
mikep99 said:
just looked at loc.lidroid.com - seems to list phone numbers, all seem to be in China though ...
Click to expand...
Click to collapse
Hmm, it seems NOT inside my Omega Package.
But I never installed any apps from other locations than XDA or google play.
I will try to find the app in the files i got on my harddisk ...
The app is named "com.lidroid.settings" when I see it right in Titanium
It maintains a database "telocation.db" ... the content seems to be chinese :S
I exported the content for further investigation and will uninstall and delete that crap from my phone ...
Hope that droidwall has blocked the network access :S
Dys66 said:
Hmm, it seems NOT inside my Omega Package.
But I never installed any apps from other locations than XDA or google play.
I will try to find the app in the files i got on my harddisk ...
The app is named "com.lidroid.settings" when I see it right in Titanium
It maintains a database "telocation.db" ... the content seems to be chinese :S
I exported the content for further investigation and will uninstall and delete that crap from my phone ...
Hope that droidwall has blocked the network access :S
Click to expand...
Click to collapse
Info - im assuming omegarom uses 23 toggle mod from lidroid - that app is the options app, deleting it will disable 23 toggle customization
and the app is called LidroidSettings.apk - its in v38 which i have
DSA said:
Info - im assuming omegarom uses 23 toggle mod from lidroid - that app is the options app, deleting it will disable 23 toggle customization
and the app is called LidroidSettings.apk
Click to expand...
Click to collapse
Best thing to do till this issue is resolved,I reckon.....anything that is copying your imei and sending it is up to no good imho
DSA said:
Info - im assuming omegarom uses 23 toggle mod from lidroid - that app is the options app, deleting it will disable 23 toggle customization
and the app is called LidroidSettings.apk - its in v38 which i have
Click to expand...
Click to collapse
I checked it with "LogMan logcat" from google play ...
It was pretty lucky that I tested this tool ...
If you want to check your phone you can start LogMan right after a phone reboot ...
Dys66 said:
Hmm, it seems NOT inside my Omega Package.
But I never installed any apps from other locations than XDA or google play.
I will try to find the app in the files i got on my harddisk ...
The app is named "com.lidroid.settings" when I see it right in Titanium
It maintains a database "telocation.db" ... the content seems to be chinese :S
I exported the content for further investigation and will uninstall and delete that crap from my phone ...
Hope that droidwall has blocked the network access :S
Click to expand...
Click to collapse
The apk for Lidroid is in /system/framework
I don't have my GS3 with me today (I also have the mod) so I can't check. I'll shoot a PM over to the Dev who created Lidroid and ask him
the other app it uses is Quicksettings.apk (I believe that's the name off the top of my head)
I don't have the device on my hand to check, but i guess it's because of the Telocation service, i used to hide this tab on my ports, but i didn't remove the services, because i tough it uses the local database.
Anyway i will repack a new one asap.
Edit : i repacked a new one (attached), i removed all telocation dependencies, i had to remove others tab for safety.
wanam said:
I don't have the device on my hand to check, but i guess it's because of the Telocation service, i used to hide this tab on my ports, but i didn't remove the services, because i tough it uses the local database.
Anyway i will repack a new one asap.
Edit : i repacked a new one (attached), i removed all telocation dependencies, i had to remove others tab for safety.
Click to expand...
Click to collapse
Thanks wanam. Is there any need for people to be worried about this from a security perspective?
graffixnyc said:
Thanks wanam. Is there any need for people to be worried about this from a security perspective?
Click to expand...
Click to collapse
In my opinion no need to worry, this service was included in all Lidroid Roms since GS2 days for Chinese users only, i can't confirm that Lidroid save any information remotely.
I need to check the telocation sources, this may give us more information about this issue.
Sent from my GT-N7100 using Tapatalk 2
I just decompiled telocation sources here is the content of the guilty file:
Code:
package com.lidroid.settings.telocation;
import android.content.*;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.google.protobuf.InvalidProtocolBufferException;
import com.lidroid.providers.telocation.DatabaseHelper;
import java.io.InputStream;
import java.net.URL;
// Referenced classes of package com.lidroid.settings.telocation:
// HttpReader
public class UpdateUtils
{
public UpdateUtils(Context context)
{
mOpenHelper = new DatabaseHelper(context, null);
mDeviceId = ((TelephonyManager)context.getSystemService("phone")).getDeviceId();
mContext = context;
}
private void updateMob(Telocation.mob_location mob_location)
{
ContentResolver contentresolver = mContext.getContentResolver();
Uri uri = Uri.parse((new StringBuilder()).append("content://com.lidroid.providers.telocation/mobile/").append(mob_location.getTel()).toString());
Cursor cursor = contentresolver.query(uri, null, null, null, null);
boolean flag;
ContentValues contentvalues;
if(cursor != null && cursor.getCount() > 0)
flag = true;
else
flag = false;
if(cursor != null)
cursor.close();
contentvalues = new ContentValues();
contentvalues.put("_id", mob_location.getTel());
contentvalues.put("location", mob_location.getLocation());
contentvalues.put("areacode", mob_location.getAreacode());
if(flag)
contentresolver.update(uri, contentvalues, null, null);
else
contentresolver.insert(Uri.parse("content://com.lidroid.providers.telocation/mobile"), contentvalues);
}
private void updateSp(Telocation.sp_info sp_info)
{
ContentResolver contentresolver = mContext.getContentResolver();
Uri uri = Uri.parse((new StringBuilder()).append("content://com.lidroid.providers.telocation/sp/").append(sp_info.getTel()).toString());
Cursor cursor = contentresolver.query(uri, null, null, null, null);
boolean flag;
ContentValues contentvalues;
if(cursor != null && cursor.getCount() > 0)
flag = true;
else
flag = false;
if(cursor != null)
cursor.close();
contentvalues = new ContentValues();
contentvalues.put("addr", sp_info.getTel());
contentvalues.put("name", sp_info.getName());
if(flag)
contentresolver.update(uri, contentvalues, null, null);
else
contentresolver.insert(Uri.parse("content://com.lidroid.providers.telocation/sp"), contentvalues);
}
public long upgrade()
{
InputStream inputstream;
HttpReader httpreader;
inputstream = null;
httpreader = null;
Uri uri;
HttpReader httpreader1;
uri = Uri.parse("content://com.lidroid.providers.telocation/ver");
int i = mContext.getContentResolver().update(uri, null, null, null);
[COLOR="Red"]URL url = new URL((new StringBuilder()).append("http://loc.lidroid.com/update/").append(i).append("/").append(Build.DISPLAY).append("/").append(mDeviceId).toString());[/COLOR]
Log.d("xiaoym", (new StringBuilder()).append("http://loc.lidroid.com/update/").append(i).append("/").append(Build.DISPLAY).append("/").append(mDeviceId).toString());
httpreader1 = new HttpReader(url);
Telocation.update update;
int j;
int k;
inputstream = httpreader1.getStream();
update = Telocation.update.parseFrom(inputstream);
j = update.getMobCount();
k = update.getSpCount();
if(update.getMobCount() != 0) goto _L2; else goto _L1
_L1:
int k1 = update.getSpCount();
if(k1 != 0) goto _L2; else goto _L3
_L3:
long l;
l = 0L;
if(inputstream == null)
break MISSING_BLOCK_LABEL_197;
inputstream.close();
if(httpreader1 != null)
httpreader1.close();
_L6:
return l;
_L2:
int i1 = 0;
_L5:
if(i1 >= j)
break; /* Loop/switch isn't completed */
updateMob(update.getMob(i1));
i1++;
if(true) goto _L5; else goto _L4
_L13:
int j1;
for(; j1 < k; j1++)
updateSp(update.getSp(j1));
Uri uri1 = ContentUris.withAppendedId(uri, update.getVersion());
mContext.getContentResolver().update(uri1, null, null, null);
l = j + k;
if(inputstream == null)
break MISSING_BLOCK_LABEL_306;
inputstream.close();
if(httpreader1 != null)
httpreader1.close();
goto _L6
InvalidProtocolBufferException invalidprotocolbufferexception;
invalidprotocolbufferexception;
_L12:
l = -2L;
if(inputstream == null)
break MISSING_BLOCK_LABEL_334;
inputstream.close();
if(httpreader != null)
httpreader.close();
goto _L6
Exception exception4;
exception4;
goto _L6
Exception exception2;
exception2;
_L11:
l = -3L;
if(inputstream == null)
break MISSING_BLOCK_LABEL_365;
inputstream.close();
if(httpreader != null)
httpreader.close();
goto _L6
Exception exception3;
exception3;
goto _L6
Exception exception;
exception;
_L10:
if(inputstream == null)
break MISSING_BLOCK_LABEL_390;
inputstream.close();
if(httpreader != null)
httpreader.close();
_L8:
throw exception;
Exception exception1;
exception1;
if(true) goto _L8; else goto _L7
_L7:
exception;
httpreader = httpreader1;
if(true) goto _L10; else goto _L9
_L9:
Exception exception5;
exception5;
httpreader = httpreader1;
goto _L11
InvalidProtocolBufferException invalidprotocolbufferexception1;
invalidprotocolbufferexception1;
httpreader = httpreader1;
goto _L12
Exception exception6;
exception6;
goto _L6
Exception exception7;
exception7;
goto _L6
_L4:
j1 = 0;
goto _L13
}
public static final long CONNECT_LIDROID_FAILED = -3L;
public static final long INVALID_TELOCATION_DATA = -2L;
public static final long NO_UPDATE = 0L;
public static final long OPEN_WRITABLE_DATABASE_ERROR = -1L;
private Context mContext;
private String mDeviceId;
private DatabaseHelper mOpenHelper;
}
Lidroid uses this class to collect stats about his users build, this classe call a remote service and save the installed build number for each device ID.
For stats purposes? maybe, i think he wouldn't logged it if he want to use it for bad purposes, Lidroid is the only one who can give us more lights about this.
Anyway the new repacked one is safe to use, i will update my toggles threads asap.
Thanks Wanam and all others involved in resolving this :thumbup:
Is it safe for all devices?

[Q] Get primary phone number of android contact : Android Dev

I am trying to fetch the primary number of a contact in Android but not getting the desired result.
Using the following code
Code:
cursor = getActivity().getContentResolver().query(Phone.CONTENT_URI, null, Phone.CONTACT_ID + "=?", new String[] { id }, null);
phoneIdx = cursor.getColumnIndex(Phone.DATA);
if (cursor.moveToFirst()) {
while (cursor.isAfterLast() == false) {
String phoneNumber = cursor.getString(phoneIdx);
Log.d(TAG,"Number:::"+ phoneNumber);
int primary = cursor.getColumnIndex(Phone.IS_PRIMARY);
Log.d(TAG, "primary value:::"+ primary);
allNumbers.add(phoneNumber);
cursor.moveToNext();
}
}
I have a contact with 2 numbers. One of them is set to primary by holding the number for long and choosing "set as default". When I run this code on the said contact, the PHONE.IS_PRIMARY returns 45 for both the numbers.
I wish to know which of the number has been set to default for a contact.

Invalid Android ID (aid:0)

Hi guys...
Since few weeks now, i'm facing to an unsolvable trouble that prevent me to access to google play (with the famous error "No Connexion"). I spent hard time to search why, tried some fixes found on the web... Nothing works.
This morning, i found with the Android Device-ID application that my "GSF Device-ID" is set to "null" ! Said differently, i'm pretty sure that my device (Samsung Galaxy S2) can't be recognized and identified on Play store because of this, giving me the "No Connexion" error.
Does anybody here know how i could fix this invalid ID (which is confirmed with the *#*#8255#*#* trick : aid:0 (INVALID AID!!!)
Thanks in advance for your help.
cheers
UP.
Nobody can help ? i can't believe it according to the number of gurus here
I am more and more convinced that the secret of this famous GSF ID is jealously guarded by its creators, and finally how to handle it are not or little known ... And for good reason, since this is for Google one of the only way to identify and thus tracking devices safely and reliably. Make it easily editable would be a disaster for them I guess ...
I still dare to hope that some geniuses who frequent this forum have already faced this problem and had pierced the mystery and how to handle this identifier.
I found the beginning of an answer with the sources code of an app "Android ID" :
Code:
private static final Uri URI = Uri.parse("content://com.google.android.gsf.gservices");
private static final String ID_KEY = "android_id";
String getAndroidId(Context ctx) {
String[] params = { ID_KEY };
Cursor c = ctx.getContentResolver()
.query(URI, null, null, params, null);
if (!c.moveToFirst() || c.getColumnCount() < 2)
return null;
try {
return Long.toHexString(Long.parseLong(c.getString(1)));
} catch (NumberFormatException e) {
return null;
}
}
In my case, i get a "null" for GSFID. That means no columns are found in reply to the query.
I have verified this by installing aSQLiteManager on my SGS2, and opening the gservices.db database.
My problem now is to find what are the key fields
that are supposed to be filled in order to have a GSF value returned.
Maybe some of you could provide me this information by having a look to your own configuration.
Thanks in advance.
I've got same problem
My phone is LG Optimus L5 and after I rooted my phone,I've got same problem and I couldn't connect to Google products and my AID's been null!

i9305 not wokring 2G network in Android 5.1

Hi,
I have a problem with 2G (edge, I didn`t try GPRS) networks on my i9305 in Android 5.1. I can connect to 3G and 4G without problem, but for 2G I get only an exclamation mark on the side of the signal icon and no connection. I tried several ROMs, which I found here and my own cm12.1 build (I actually started with that one) - all with the same result:
AOSP-5.1.1-20150605-i9305-rodman01.zip
BlissPop-v4.0.3-i9305-UNOFFICIAL-20151011-2232.zip
LS-LP-v4.1-2015-10-23-liquid_i9305.zip
Sammy_Resurrection-Remix-LP-v5.5.9-20151122-i9305.zip
cm-12.1-20151201-UNOFFICIAL-i9305.zip (from winxuser)
I did some debugging and discovered that the problem is in wrong data coming from rild. I described it with more details here: forum.cyanogenmod.org/topic/118467-how-to-debug-non-working-2g-network I even found on the web some logs with the same wrong value and posts describing similar or the same behavior. I also found some posts saying, that it is fixed, but I can`t find any ROM, where it is working.
As you can see in my post on cyanogenmod forum, I have a solution, but not a nice one. It is a hack. So I want to ask – is there someone who had the same problem and fixed it? Or some who has the same phone and not this problem? If yes, how did you fix it? Exactly which ROM, prorietary files did you use?
Thank you
Pavel
OK, I am giving up. I tried several more ROMs:
Slim-i9305-5.1.1.beta.0.9-UNOFFICIAL-20151024-2015.zip
aicp_i9305_lp-10.0-NIGHTLY-20151128.zip
cm-12.1-20151202-UNOFFICIAL-i9305.zip
nameless-5.1.1-20151019-i9305-NIGHTLY.zip
The result is still the same. Maybe it has something to do with carrier operator (but I don`t have this problem in cm 11). I found fix similar to mine, which I described in cyanogenmod forum, so I`ll use that. See here github.com/CyanogenMod/android_device_samsung_jf-common/blob/cm-12.1/ril/telephony/java/com/android/internal/telephony/jflteRIL.java if you are interested. Specifically method responseVoiceDataRegistrationState. It replaces the wrong rild data in the same way.
I have the same problem @p.a.n.
Please tell me how I fix it, even if it´s a hack... Thanks
Hi,
here is the final diff I use:
Code:
project device/samsung/smdk4412-qcom-common/
diff --git a/ril/telephony/java/com/android/internal/telephony/smdk4x12QComRIL.java b/ril/telephony/java/com/android/internal/telephony/smdk4x12QComRIL.java
index 0e8d798..619be34 100644
--- a/ril/telephony/java/com/android/internal/telephony/smdk4x12QComRIL.java
+++ b/ril/telephony/java/com/android/internal/telephony/smdk4x12QComRIL.java
@@ -409,8 +409,8 @@ public class smdk4x12QComRIL extends RIL implements CommandsInterface {
case RIL_REQUEST_UDUB: ret = responseVoid(p); break;
case RIL_REQUEST_LAST_CALL_FAIL_CAUSE: ret = responseInts(p); break;
case RIL_REQUEST_SIGNAL_STRENGTH: ret = responseSignalStrength(p); break;
- case RIL_REQUEST_VOICE_REGISTRATION_STATE: ret = responseVoiceDataRegistrationState(p); break;
- case RIL_REQUEST_DATA_REGISTRATION_STATE: ret = responseVoiceDataRegistrationState(p); break;
+ case RIL_REQUEST_VOICE_REGISTRATION_STATE: ret = responseVoiceDataRegistrationState(p,false); break;
+ case RIL_REQUEST_DATA_REGISTRATION_STATE: ret = responseVoiceDataRegistrationState(p,true); break;
case RIL_REQUEST_OPERATOR: ret = operatorCheck(p); break;
case RIL_REQUEST_RADIO_POWER: ret = responseVoid(p); break;
case RIL_REQUEST_DTMF: ret = responseVoid(p); break;
@@ -580,9 +580,16 @@ public class smdk4x12QComRIL extends RIL implements CommandsInterface {
}
private Object
- responseVoiceDataRegistrationState(Parcel p) {
+ responseVoiceDataRegistrationState(Parcel p, boolean data) {
String response[] = (String[])responseStrings(p);
if (isGSM){
+ if(data &&
+ response.length > 4 &&
+ response[0] != null && response[0].equals("1") &&
+ response[3] != null && response[3].equals("102")){
+ riljLog("responseVoiceDataRegistrationState overriding 102 -> 2");
+ response[3]="2";
+ }
return response;
}
if (response.length>=10){
Or you can try replace /system/framework/telephony-common.jar with attached telephony-common.jar, but be careful with that (make backup), I can`t guarantee that it will work with the rest of your system.

Categories

Resources