B4A Library Library Check Signature

Hi all
This is simple library to check signature APK.

CheckSignature
Author:
Devil-App
Version: 1
  • CheckSignature
    Methods:
    • CertificateGetSerialNumber As String
      Get CartificatGetSerialNumber example Serial Number: 15434885569865480918
      Example:<code>
      Dim check As CheckSignature
      Log("Certificate Vendor: " & check.CertificateGetSerialNumber)</code>
    • CertificateIssuer As String
      Get CartificatIssuer example OID.1.2.840.113549.1.9.1=#1616652E4564526F69642E6F734073616D73756E672E636F6D,
      CN=Samsung Cert, OU=DMC, O=Samsung Corporation, L=Suwon City, ST=South Korea, C=KR
      Example:<code>
      Dim check As CheckSignature
      Log("Certificate Vendor: " & check.CertificateIssuer)</code>
    • CertificateName As String
      Get CartificatName example ELM Agent
      Example:<code>
      Dim check As CheckSignature
      Log("Certificate Name: " & check.CertificateName)</code>
    • CertificateSubject As String
      Get CartificatSubject example OID.1.2.840.113549.1.9.1=#1616524E64895F69642E6F734073616D73756E672E636F6D
      CN=Samsung Cert, OU=DMC, O=Samsung Corporation, L=Suwon City, ST=South Korea, C=KR
      Example:<code>
      Dim check As CheckSignature
      Log("Certificate Vendor: " & check.CertificateSubject)</code>
    • CertificateVendor As String
      Get CartificatVendor example com.sec.esdk.elm
      Example:<code>
      Dim check As CheckSignature
      Log("Certificate Vendor: " & check.CertificateVendor)</code>
    • KeyHash As String
      Get Signature KeyHash example ggw+21Mf6Fedr0lwKTx36lquaYk=
      Example:<code>
      Dim check As CheckSignature
      Log("Signature KeyHASH: " & check.KeyHash)</code>
    • getPackageName As String
      GetPackageName example get com.devil.app.test
      Example:<code>
      Dim check As CheckSignature
      Log("Name APK: " & check.getPackageName)</code>
    • getPackageVersionCode As Int
      GetPackageVersionCode example get #VersionCode: 1
      Example:<code>
      Dim check As CheckSignature
      Log("VersionCode APK: " & check.getPackageVersionCode)</code>
    • getPackageVersionName As String
      GetPackageVersionName example get #VersionName: 1.0
      Example:<code>
      Dim check As CheckSignature
      Log("VersionName APK: " & check.getPackageVersionName)</code>
    • md5 As String
      Get Signature md5 fingerprint example ce916325b369d91049d9oo36323890a3
      Example:<code>
      Dim check As CheckSignature
      Log("Signature md5 fingerprint: " & check.md5 )</code>
    • sha1 As String
      Get Signature sha1 fingerprint example 826afdgb521ee8569daf4870293c77ea5aae6989
      Example:<code>
      Dim check As CheckSignature
      Log("Signature sha1 fingerprint: " & check.sha1 )</code>

B4X:
Log("Name APK: " & check.getPackageName)
    Log("VersionName APK: " & check.getPackageVersionName) 
    Log("VersionCode APK: " & check.getPackageVersionCode)
    Log("Signature md5 fingerprint: " & check.md5 )
    Log("Signature KeyHASH: " & check.KeyHash) 
    Log("Signature sha1 fingerprint: " & check.sha1 )
    Log("Certificate Name: " & check.CertificateName)
    Log("Certificate Vendor: " & check.CertificateVendor)
    Log("Certificate Subject: " & check.CertificateSubject)
    Log("Certificate Issuer: " & check.CertificateIssuer)
    Log("Certificate Serial Number: " & check.CertificateGetSerialNumber)

Screenshot 2015-09-06 09.27.35.png
 

Attachments

  • Example-Checksignature.zip
    9 KB · Views: 432
  • Library-CheckSignature1.zip
    4.4 KB · Views: 496
Last edited:

ArminKH

Well-Known Member
thank u marco ;) dameeeeeeet garm
by using this lib we can check the signator of apps,so this is good news for in-app billing apps
 

Artur Martins

Member
Licensed User
Longtime User
Hello,

This library generates conflict to be used along with the library "mwAdmobInterstitial2".
How can I solve this problem?
 

Artur Martins

Member
Licensed User
Longtime User
I may have precipitated me to accuse the conflict with "mwAdmobInterstitial2" but the error only occurs when using the two libraries:

java.lang.ClassNotFoundException: com$devil$signature$CheckSignature
at anywheresoftware.b4a.shell.Shell.getCorrectClassName(Shell.java:605)
at anywheresoftware.b4a.shell.Shell.createObject(Shell.java:577)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:354)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at anywheresoftware.b4a.debug.Debug.delegate(Debug.java:262)
at b4a.matchmath.inter_rank._getshao(inter_rank.java:383)
at b4a.matchmath.inter_rank._synch(inter_rank.java:163)
at b4a.matchmath.main._activity_create(main.java:416)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:697)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:339)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:246)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
at b4a.matchmath.main.afterFirstLayout(main.java:102)
at b4a.matchmath.main.access$000(main.java:17)
at b4a.matchmath.main$WaitForLayout.run(main.java:80)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)
 

MarcoRome

Expert
Licensed User
Longtime User
@MarcoRome
First Thanks for beautifull purposed lib.
Can we use signature as tool against anti tampering ?
If app is tampered then signature can changed. Right ?

Sure. But in any case if you find the subject with experience he could modify and skip the check routine. Nothing is 100% safe, but everything helps
 
Top