RxReader / alipay_kit

Flutter版支付宝登录/支付
MIT License
313 stars 60 forks source link

支付遇到的问题..Unsupported operation: PEMKey( #5

Closed lupming closed 5 years ago

lupming commented 5 years ago

image. image

上图中,我用支付的RSA工具生成2048的商户私钥,但实际密码长度就1059...我修改了_PRIVATEKEY_RSA2_MIN_LENGTH的长度后...出现Unsupported operation: PEMKey(....的问题..

lupming commented 5 years ago

请问是我哪里设置的问题吗?请老大指点下.

droplet-js commented 5 years ago

认真看Demo /// pkcs1 -> '-----BEGIN RSA PRIVATE KEY-----\n${支付宝RSA签名工具生产的私钥}\n-----END RSA PRIVATE KEY-----' /// pkcs8 -> '-----BEGIN PRIVATE KEY-----\n${支付宝RSA签名工具生产的私钥}\n-----END PRIVATE KEY-----'

lupming commented 5 years ago

感谢老大,但我测试长度问题好像还是存在的,还是不够2048,这句判断好像就是过不去,是不是我设置还有啥问题??? image

现在目前又有个新问题,用demo测试也是一样.登录或者支付后,无法从支付宝返回到原程序,而且原程序直接就退出了..

W/System.err(10252): java.lang.SecurityException: getDeviceId W/System.err(10252): at android.os.Parcel.createException(Parcel.java:1950) W/System.err(10252): at android.os.Parcel.readException(Parcel.java:1918) W/System.err(10252): at android.os.Parcel.readException(Parcel.java:1868) W/System.err(10252): at com.android.internal.telephony.ITelephony$Stub$Proxy.getDeviceId(ITelephony.java:5427) W/System.err(10252): at android.telephony.TelephonyManager.getDeviceId(TelephonyManager.java:1236) W/System.err(10252): at com.alipay.sdk.util.a.(SourceFile:38) W/System.err(10252): at com.alipay.sdk.util.a.a(SourceFile:27) W/System.err(10252): at com.alipay.sdk.tid.b.a(SourceFile:79) W/System.err(10252): at com.alipay.sdk.app.statistic.c.(SourceFile:1229) W/System.err(10252): at com.alipay.sdk.app.statistic.a.a(SourceFile:21) W/System.err(10252): at com.alipay.sdk.app.AuthTask.(SourceFile:55) W/System.err(10252): at io.github.v7lin.fakealipay.FakeAlipayPlugin$2.run(FakeAlipayPlugin.java:79) W/System.err(10252): at java.lang.Thread.run(Thread.java:764) W/kealipayexampl(10252): Accessing hidden method Landroid/os/SystemProperties;->()V (light greylist, reflection) I/Timeline(10252): Timeline: Activity_launch_request time:218657948 I/Timeline(10252): Timeline: Activity_launch_request time:218658182 E/AndroidRuntime(10252): FATAL EXCEPTION: Thread-3 E/AndroidRuntime(10252): Process: io.github.v7lin.fakealipayexample, PID: 10252 E/AndroidRuntime(10252): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Thread-3 E/AndroidRuntime(10252): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605) E/AndroidRuntime(10252): at io.flutter.embedding.engine.FlutterJNI.dispatchPlatformMessage(FlutterJNI.java:515) E/AndroidRuntime(10252): at io.flutter.embedding.engine.dart.DartMessenger.send(DartMessenger.java:76) E/AndroidRuntime(10252): at io.flutter.embedding.engine.dart.DartExecutor.send(DartExecutor.java:166) E/AndroidRuntime(10252): at io.flutter.view.FlutterNativeView.send(FlutterNativeView.java:155) E/AndroidRuntime(10252): at io.flutter.plugin.common.MethodChannel.invokeMethod(MethodChannel.java:98) E/AndroidRuntime(10252): at io.flutter.plugin.common.MethodChannel.invokeMethod(MethodChannel.java:84) E/AndroidRuntime(10252): at io.github.v7lin.fakealipay.FakeAlipayPlugin$2.run(FakeAlipayPlugin.java:81) E/AndroidRuntime(10252): at java.lang.Thread.run(Thread.java:764) W/Thread-4(10252): type=1400 audit(0.0:147012): avc: denied { read } for name="version" dev="proc" ino=4026532113 scontext=u:r:untrusted_app:s0:c90,c257,c512,c768 tcontext=u:object_r:proc_version:s0 tclass=file permissive=0 I/Process (10252): Sending signal. PID: 10252 SIG: 9 Lost connection to device.

droplet-js commented 5 years ago

flutter版本升级后有线程做了限制,明天我抽个时间改一下,至于privatekey的问题,你再仔细阅读一下相关文档吧,我已经很久没看这些东西了

droplet-js commented 5 years ago

线程安全已解决 … 0.2.1 …

lupming commented 5 years ago

已调试通过,谢谢.

lantongxue commented 4 years ago

已调试通过,谢谢.

请问您是怎么解决privatekey长度的问题的?

lupming commented 4 years ago

已调试通过,谢谢.

请问您是怎么解决privatekey长度的问题的?

把包里判断秘钥长度部分那代码条件改一下就行。