小编Piy*_*pta的帖子

android.security.KeyChainException:java.lang.IllegalStateException:uid

错误:

android.security.KeyChainException: java.lang.IllegalStateException: uid 10111 doesn't have permission to access the requested alias
Run Code Online (Sandbox Code Playgroud)

码:

new Thread(new Runnable() {

        public void run() {
            try {
                X509Certificate[] myCertificates=KeyChain.getCertificateChain(MainActivity.this, "ServerCertificate");
                if(myCertificates!=null)
                {
                    System.out.println("myCertificates size "+myCertificates.length);

                    for(int i=0;i<myCertificates.length;i++)
                    {
                        System.out.println("myCertificates i= "+i+"    "+myCertificates[i]);
                    }
                }
            } catch (KeyChainException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
            catch (Exception e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }
    }).start();
Run Code Online (Sandbox Code Playgroud)

android keychain

1
推荐指数
1
解决办法
2871
查看次数

标签 统计

android ×1

keychain ×1