1.UUID标识什么?设备么?为何不用MAC地址?与MAC地址有什么区别?MAC地址是什么?为何不用IMEI?算法
Installtion ID : UUID 以上四种方式都有或多或少存在的必定的局限性或者bug,在这里,有另一种方式解决,就是使用UUID,该方法无需访问设备的资源,也跟设备类型无关。 这 种方式是经过在程序安装后第一次运行后生成一个ID实现的,但该方式跟设备惟一标识不同,它会由于不一样的应用程序而产生不一样的ID,而不是设备惟一ID。所以常常用来标识在某个应用中的惟一ID(即Installtion ID),或者跟踪应用的安装数量。dom
2.UUID是指在一台机器上生成的数字google
3..UUID的生成规范定义的算法主要目的就是要保证其惟一性spa
4.Installtion ID : UUID 统计应用安装数量量,google的官方作法是经过程序中生成UUID来完成需求。代码以下: public class Installation { private static String sID = null; private static final String INSTALLATION = "INSTALLATION"; public synchronized static String id(Context context) { if (sID == null) { File installation = new File(context.getFilesDir(), INSTALLATION); try { if (!installation.exists()) writeInstallationFile(installation); sID = readInstallationFile(installation); } catch (Exception e) { throw new RuntimeException(e); } } return sID; } private static String readInstallationFile(File installation) throws IOException { RandomAccessFile f = new RandomAccessFile(installation, "r"); byte[] bytes = new byte[(int) f.length()]; f.readFully(bytes); f.close(); return new String(bytes); } private static void writeInstallationFile(File installation) throws IOException { FileOutputStream out = new FileOutputStream(installation); String id = UUID.randomUUID().toString(); out.write(id.getBytes()); out.close(); } }资源
5.目前工做中采起的文件受权方式,以下图get
子证书就是最终证书的意思。it