Android 如何跟踪从并行空间应用程序访问我的应用程序的用户?
我的应用程序中有一项功能,将每台设备的购买限制为1次。 我正在使用下面的代码为每个设备生成一个唯一的ID。当用户从Parallel Space应用程序安装应用程序时,会生成多少不同的代码。我还能追踪到它吗 生成唯一id的我的代码:Android 如何跟踪从并行空间应用程序访问我的应用程序的用户?,android,uniqueidentifier,Android,Uniqueidentifier,我的应用程序中有一项功能,将每台设备的购买限制为1次。 我正在使用下面的代码为每个设备生成一个唯一的ID。当用户从Parallel Space应用程序安装应用程序时,会生成多少不同的代码。我还能追踪到它吗 生成唯一id的我的代码: public String getUniqueDeviceId() { String deviceID = null; String androidID = sessionManager.getUniqueID().get("un
public String getUniqueDeviceId() {
String deviceID = null;
String androidID = sessionManager.getUniqueID().get("uniqueid");
if(androidID!=null)
{
if(androidID.length()>0)
{
return androidID;
}
else
{
String uniqueId = "";
//TelephonyManager TelephonyMgr = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE);
//uniqueId = uniqueId.concat(TelephonyMgr.getDeviceId());
String buildParams = "99" +
Build.BOARD.length() % 10 + Build.BRAND.length() % 10 +
Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 +
Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 +
Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 +
Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 +
Build.TAGS.length() % 10 + Build.TYPE.length() % 10 +
Build.USER.length() % 10;
uniqueId = uniqueId.concat(buildParams);
uniqueId = uniqueId.concat(Settings.Secure.getString(getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID));
WifiManager wm = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
uniqueId = uniqueId.concat(wm.getConnectionInfo().getMacAddress());
// BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// uniqueId = uniqueId.concat(mBluetoothAdapter.getAddress());
// Initiate digest with MD5
MessageDigest mDigest = null;
try {
mDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
mDigest.update(uniqueId.getBytes(), 0, uniqueId.length());
byte[] digestedBytes = mDigest.digest();
String deviceId = "";
for (int i = 0; i < digestedBytes.length; i++) {
int b = (0xFF & digestedBytes[i]);
// Additional Padding
if (b <= 0xF) {
deviceId += "0";
}
// concat at the end
deviceId = deviceId.concat(Integer.toHexString(b));
}
deviceID = deviceId.substring(0, 24);
sessionManager.createUniqueID(deviceID);
return deviceID;
}
}
else
{
String uniqueId = "";
//TelephonyManager TelephonyMgr = (TelephonyManager) context.getSystemService(context.TELEPHONY_SERVICE);
//uniqueId = uniqueId.concat(TelephonyMgr.getDeviceId());
String buildParams = "99" +
Build.BOARD.length() % 10 + Build.BRAND.length() % 10 +
Build.CPU_ABI.length() % 10 + Build.DEVICE.length() % 10 +
Build.DISPLAY.length() % 10 + Build.HOST.length() % 10 +
Build.ID.length() % 10 + Build.MANUFACTURER.length() % 10 +
Build.MODEL.length() % 10 + Build.PRODUCT.length() % 10 +
Build.TAGS.length() % 10 + Build.TYPE.length() % 10 +
Build.USER.length() % 10;
uniqueId = uniqueId.concat(buildParams);
uniqueId = uniqueId.concat(Settings.Secure.getString(getApplicationContext().getContentResolver(), Settings.Secure.ANDROID_ID));
WifiManager wm = (WifiManager) getApplicationContext().getSystemService(Context.WIFI_SERVICE);
uniqueId = uniqueId.concat(wm.getConnectionInfo().getMacAddress());
// BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
// uniqueId = uniqueId.concat(mBluetoothAdapter.getAddress());
// Initiate digest with MD5
MessageDigest mDigest = null;
try {
mDigest = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
mDigest.update(uniqueId.getBytes(), 0, uniqueId.length());
byte[] digestedBytes = mDigest.digest();
String deviceId = "";
for (int i = 0; i < digestedBytes.length; i++) {
int b = (0xFF & digestedBytes[i]);
// Additional Padding
if (b <= 0xF) {
deviceId += "0";
}
// concat at the end
deviceId = deviceId.concat(Integer.toHexString(b));
}
deviceID = deviceId.substring(0, 24);
sessionManager.createUniqueID(deviceID);
return deviceID;
}
}
公共字符串getUniqueDeviceId(){
字符串deviceID=null;
字符串androidID=sessionManager.getUniqueID().get(“uniqueid”);
if(android!=null)
{
if(android.length()>0)
{
返回Android;
}
其他的
{
字符串uniqueId=“”;
//TelephonyManager TelephonyMgr=(TelephonyManager)context.getSystemService(context.TELEPHONY_服务);
//uniqueId=uniqueId.concat(TelephonyMgr.getDeviceId());
字符串buildParams=“99”+
Build.BOARD.length()%10+Build.BRAND.length()%10+
Build.CPU_ABI.length()%10+Build.DEVICE.length()%10+
Build.DISPLAY.length()%10+Build.HOST.length()%10+
Build.ID.length()%10+Build.MANUFACTURER.length()%10+
Build.MODEL.length()%10+Build.PRODUCT.length()%10+
Build.TAGS.length()%10+Build.TYPE.length()%10+
Build.USER.length()%10;
uniqueId=uniqueId.concat(buildParams);
uniqueId=uniqueId.concat(Settings.Secure.getString(getApplicationContext().getContentResolver(),Settings.Secure.ANDROID));
WifiManager wm=(WifiManager)getApplicationContext().getSystemService(Context.WIFI_服务);
uniqueId=uniqueId.concat(wm.getConnectionInfo().getMacAddress());
//BluetoothAdapter mBluetoothAdapter=BluetoothAdapter.getDefaultAdapter();
//uniqueId=uniqueId.concat(mBluetoothAdapter.getAddress());
//使用MD5启动摘要
MessageDigest mDigest=null;
试一试{
mDigest=MessageDigest.getInstance(“MD5”);
}捕获(无算法异常){
e、 printStackTrace();
}
mDigest.update(uniqueId.getBytes(),0,uniqueId.length());
byte[]digestedBytes=mDigest.digest();
字符串设备ID=“”;
for(int i=0;i 如果(b)你找到了这个解决方案,我也在寻找同样的@Anirudh@AnkitKumarSingh不,我还没有找到解决方案。你的应用程序有登录吗?你找到这个解决方案了吗,我也在寻找相同的@Anirudh@AnkitKumarSingh不,我没有找到解决方案。你的应用程序是否有登录名?