草庐IT

sha1_context

全部标签

android - 如何避免 context.getSystemService(Context.CAMERA_SERVICE) 中的内存泄漏?

我在Android5.xCamera2API中发现了内存泄漏,我也是reported.问题是当您使用在LEGACY模式下实现Camera2API的AndroidLollipop设备时。在此类设备上,调用context.getSystemService(Context.CAMERA_SERVICE)会导致context被保留,这样它就不会被垃圾回收。如果此context是您多次启动的Activity,您最终可能会挂起对数十个从未被垃圾回收的Activity实例的引用。该问题似乎只发生在以LEGACY模式实现Camera2API的Lollipop设备上(例如HTCOneM8、Samsung

android - Keystore SHA1 不同于来自 APK 的 cert.rsa SHA1

我有一个首先使用Adob​​eAir创建的Android应用程序(及其生产keystore)。很久以前,公司转而使用常规的AndroidSDK来开发该应用程序,但由于该应用程序已经投入生产,我们使用的keystore仍然是同一个(当时由Adob​​eAir创建)。我使用keytool为GooglePlacesAPI提取了SHA1,我得到了一些类似的信息:Aliasname:Creationdate:Jan11,2015Entrytype:PrivateKeyEntryCertificatechainlength:1Certificate[1]:Owner:CN=,OU=,O=,C=US

android - context.registerReceiver 在尝试检查电源是否已连接时返回 null Intent

我正在尝试检查Android设备是否已连接电源。以下是逻辑(基于Commonsware的stackoverflow帖子),Intentintent=context.registerReceiver(null,newIntentFilter(Intent.ACTION_BATTERY_CHANGED));plugged=intent.getIntExtra(BatteryManager.EXTRA_PLUGGED,-1);它大部分工作正常。然而,根据Crashlytics报告,在某些情况下,返回的Intent为空,导致应用程序崩溃。我从来没有能够在我的手机上重现它。只是想知道在什么情况下

java - 如何修复 api 21 的 context.getSystemService(class)?

我正在关注JobScheduler的视频:https://www.youtube.com/watch?v=XFN3MrnNhZA但是lint告诉我context.getSystemService(class)是api23。那么我是不是遗漏了什么或者android是否用那里的api改变了什么?注意:主要想知道JobScheduler是否在api21中引入如果没有getSystemService(Class)它会如何工作谢谢。 最佳答案 感谢Reghunandan,我使用以下方法找到了更好的解决方案:github.com/firebas

android - 为什么我得到 "call to OpenGL ES API with no current context"?

我是openGL和android开发的新手,所以如果我的问题很琐碎,请原谅我。我正在尝试构建一个简单的小应用程序,该应用程序在三个EditText中接受用户的输入,这些EditText表示要在GLSurfaceView中显示的RGB颜色的每个组件的0-100%值。要注意的是,我需要它来使用openGLES2.0,并且我需要使用统一值将数据传递到着色程序,这样一旦我让它工作,我就可以继续我真正想要完成的事情。运行我编写的内容后,我可以让GLSurfaceView正确显示第一个纯色,但是每当我更改任何值并调用重建着色程序中的统一插槽时,我都会在LogCat中收到此错误:错误/libEGL(

android - MD5withRSA 和 SHA1withRSA 有什么区别?

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。要求提供代码的问题必须表现出对所解决问题的最低限度理解。包括尝试过的解决方案、为什么它们不起作用,以及预期结果。另请参阅:StackOverflowquestionchecklist关闭9年前。Improvethisquestion在googledocumentation对于Android应用程序...它说我应该使用SHA1withRSA但我想知道SHA1withRSA和MD5withRSA之间有什么区别?无论如何,这将如何影响我的应用程序?GooglePlay会根据SHA1withRSA/MD5wi

如何使用PKCS 7和SHA算法创建数字签名并在C#中验证它

我正在尝试通过数字签名XML文档,并使用公共密钥和签名文档的原始XML文件验证签名。我有一个Java代码供参考。我需要将java代码转换为c#,其中我有这样的Java代码:certList=newArrayList();certList.add(signerCert);certStore=newJcaCertStore(certList);signedDataGenerator=newCMSSignedDataGenerator();ContentSignersha2Signer=newJcaContentSignerBuilder("SHA512with"+privateKey.getAlg

android - 为什么我不能在 Service 的构造函数中使用 Context.getPackageManager

如果我尝试使用它,我会得到NullPointerException。如果移出构造函数,它工作正常。所以,我很好奇发生了什么。代码如下:packagecom.example.nullptrservice;importandroid.app.Service;importandroid.content.Intent;importandroid.content.pm.PackageManager;importandroid.os.IBinder;importandroid.util.Log;publicclassMyServiceextendsService{publicMyService()

android - 尝试理解 "Calling startActivity from outside of an Activity context"

需要帮助来理解这个异常:system_log_all11-1411:52:28.540E/AndroidRuntime(31615):FATALEXCEPTION:mainsystem_log_all11-1411:52:28.540E/AndroidRuntime(31615):android.util.AndroidRuntimeException:CallingstartActivity()fromoutsideofanActivitycontextrequirestheFLAG_ACTIVITY_NEW_TASKflag.Isthisreallywhatyouwant?syst

android - 调用 getSystemService(Context.LOCATION_SERVICE) 和 onLocationChanged 时未调用 NullpointerException

我正在尝试创建更新当前GPS位置的后台服务。我在LocationManagerlm=(LocationManager)getSystemService(Context.LOCATION_SERVICE);行收到一个NullPointerExceptionHomeActivity启动服务startService(newIntent(getApplicationContext(),ForHire.class));Service(ForHire)创建一个TimerTaskUpdatespublicclassForHireextendsService{...privateTimergetUpd