how to decode android.os.Build.SERIAL?

前端 未结 4 2014
攒了一身酷
攒了一身酷 2020-12-11 07:28

I\'m working on the recurring serial number topic to provide a unique id.

I try this :

       String serial = null; 

        try {
            Clas         


        
4条回答
  •  鱼传尺愫
    2020-12-11 07:57

    Have you tried this?

    String serial = null; 
    
    try {
         Class c = Class.forName("android.os.SystemProperties");
         Method get = c.getMethod("get", String.class);
         serial = (String) get.invoke(c, "ril.serialnumber");
     } catch (Exception ignored) {
     }
    

提交回复
热议问题