草庐IT

sha1_context

全部标签

android - Context.startService(intent) 或 startService(intent)

Context.startService(intent)和startService(intent)有什么区别,使用哪个有关系吗? 最佳答案 只有一个startService()方法。startService()是Context类的一个方法,可用于Context的所有子类,如Activity或服务。 关于android-Context.startService(intent)或startService(intent),我们在StackOverflow上找到一个类似的问题:

android - ApplicationContext 或 Activity Context 适合 Adapter 吗?

我在我的项目中使用ListView/RecycleView的适配器。但我想知道应该将哪种Context传递给适配器?ApplicationContext或ActivityContext(在Activity上是这个意思)?据我所知,即使Activity被终止,系统也不会终止适配器。所以我在这里有一些困惑:如果我将ActivityContext传递给适配器,那么适配器就会隐式引用该Activity。Activity可以被杀死吗?另一方面,我传递ApplicationContext。适配器还能使用多长时间?Activity被杀死后是否由GC回收?在特定情况下我应该传递哪种上下文?谢谢,

android - "Connection closed by peer"Android 7.0 Nougat 在通过 HTTPS 连接到 SHA256 CA 安装的 Windows 2003 Server SP2 时发生错误

我的应用程序通过HTTPS与服务器接口(interface)(经典ASP)通信。它在Android7.0Nougat的早期版本中运行良好。(直到6.0)但是,ConnectionclosedbypeerError出现在Android7.0手机和AVD(Androidvirtualdevice)中。服务器为Windows2003ServerSP2(SSL证书于2016年7月23日从SHA1更新为SHA256)、HTTPS、ClassicASP服务器的GeoTrust的SSL证书安装检查状态如下(cryptoreport.geotrust.com/checker/views/certChe

android - 使用私钥、RSA-SHA1 签名和 Android 中的 md5 签名字符串

我需要使用RSA-SHA1签名和来自.PFX证书的私钥来签署一个字符串。这是我的代码:StringrawString="1234567890";byte[]signed=null;FileInputStreamcert=newFileInputStream("/sdcard/cert.pfx");KeyStorekeyStore=KeyStore.getInstance("pkcs12");keyStore.load(cert,"cert_password".toCharArray());Stringalias=keyStore.aliases().nextElement();Priv

php - SHA1 校验和在 php 和 android 中对于同一个文件变得不同

我正在PHP和Android中生成SHA1key来验证文件。但是我得到了PHP和Android的不同key。安卓:try{MessageDigestdigest=MessageDigest.getInstance("SHA-1");byte[]buffer=newbyte[65536];InputStreamfis=newFileInputStream(downloadFile.getPath());intn=0;while(n!=-1){n=fis.read(buffer);if(n>0){digest.update(buffer,0,n);}}fis.close();byte[]d

android - Settings.canDrawOverlays(context) 在 Android Oreo 上返回 false

list:代码activity.onCreate():if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.M&&BuildConfig.DEBUG){if(!Settings.canDrawOverlays(this)){Intentintent=newIntent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION,Uri.parse("package:"+getPackageName()));startActivityForResult(intent,OVERLAY_PERMISSION_REQ_CODE);}

java - 使用 phpseclib 验证在 Java (Android) 中生成的 SHA1withRSA 签名

这就是我想要做的:在Java/Android中生成一个512位RSAkey对用Java为一些消息生成SHA1withRSA签名向PHP发送消息、签名和公钥(同时进行测试)使用phpseclib在PHP中验证消息到目前为止我得到了什么:在Java方面:Stringmsg="Testmessage";//generatekeypairKeyPairGeneratorkeyGen=KeyPairGenerator.getInstance("RSA");keyGen.initialize(512);KeyPairkeyPair=keyGen.generateKeyPair();//genera

android - 使用 Locale.getDefault() 和 context.getResources().getConfiguration().locale 的语言环境有什么区别?

返回的字符串有什么区别吗:Locale.getDefault().toString()和context.getResources().getConfiguration().locale.toString()询问是因为我怀疑这会导致应用程序中出现错误,在使用Locale.getDefault().toString()之前有效的功能不再适用于context.getResources()。getConfiguration().locale.toString(),在某些美国设备上。但不确定是否是这个原因。谢谢! 最佳答案 Locale.ge

android - 使用 SHA256withRSA 而不是 SHA1withRSA 生成签名

我一直在尝试生成sha1key以便在windows7上使用googlemapsv2。根据运行以下命令后的谷歌文档:keytool-list-v-keystore"C:\Users\your_user_name\.android\debug.keystore"-aliasandroiddebugkey-storepassandroid-keypassandroid输出应该类似于此(https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2)Ali

java - 尝试在空对象引用上调用虚拟方法 'android.os.Looper android.content.Context.getMainLooper()'

这个问题在这里已经有了答案:WhatisaNullPointerException,andhowdoIfixit?(12个答案)关闭5年前。每当我尝试在我的手机或模拟器上打开该应用程序时,我的Logcat中都会出现此错误。为了让您大致了解我目前正在做的项目,它是一个记录连接到手机接入点的设备数据的系统,可以通过屏幕上的按钮打开和关闭。我想归功于:Android2.3wifihotspotAPI和https://www.whitebyte.info/android/android-wifi-hotspot-manager-classLogcat文件的图像是:https://i.gyazo