Hi,
Is there anyone who can tell me how to fix the error?
Here is my code:
Is there anyone who can tell me how to fix the error?
B4X:
Logger connected to: asus Nexus 7
--------- beginning of main
Copying updated assets files (2)
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
Error occurred on line: 108 (Main)
java.lang.IllegalArgumentException: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0c074079:ASN.1 encoding routines:ASN1_get_object:HEADER_TOO_LONG
at com.android.vending.licensing.LicenseChecker.generatePublicKey(LicenseChecker.java:121)
at com.android.vending.licensing.LicenseChecker.<init>(LicenseChecker.java:92)
at anywheresoftware.b4a.objects.LicenseCheckerWrapper.Initialize(LicenseCheckerWrapper.java:42)
at net.wineos.android.counsellor.main._activity_create(main.java:428)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:351)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:144)
at net.wineos.android.counsellor.main.afterFirstLayout(main.java:105)
at net.wineos.android.counsellor.main.access$000(main.java:17)
at net.wineos.android.counsellor.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.security.spec.InvalidKeySpecException: java.lang.RuntimeException: error:0c074079:ASN.1 encoding routines:ASN1_get_object:HEADER_TOO_LONG
at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:250)
at com.android.org.conscrypt.OpenSSLRSAKeyFactory.engineGeneratePublic(OpenSSLRSAKeyFactory.java:47)
at java.security.KeyFactory.generatePublic(KeyFactory.java:172)
at com.android.vending.licensing.LicenseChecker.generatePublicKey(LicenseChecker.java:112)
... 19 more
Caused by: java.lang.RuntimeException: error:0c074079:ASN.1 encoding routines:ASN1_get_object:HEADER_TOO_LONG
at com.android.org.conscrypt.NativeCrypto.d2i_PUBKEY(Native Method)
at com.android.org.conscrypt.OpenSSLKey.getPublicKey(OpenSSLKey.java:248)
... 22 more
** Activity (main) Resume **
Here is my code:
B4X:
Private Sub GetDeviceId() As String
Dim r As Reflector
Dim Api As Int
Api = r.GetStaticField("android.os.Build$VERSION", "SDK_INT")
If Api < 9 Then
'Old device
If File.Exists(File.DirInternal, "__id") Then
Return File.ReadString(File.DirInternal, "__id")
Else
Dim id As Int
id = Rnd(0x10000000, 0x7FFFFFFF)
File.WriteString(File.DirInternal, "__id", id)
Return id
End If
Else
'New device
Return r.GetStaticField("android.os.Build", "SERIAL")
End If
End Sub