Monday, May 27, 2013

[android help] failed verify apk signature


failed verify apk signature



Now,I port MIPSAndroid to MIPS processor of big-endian.and my apk can do well in emulator with arm.so what's the matter with it?


and i find it failed in JNI code-----> Oepnssl ..


and i use DEBUG print the information.so is anyone can tell me how to do?



I/PackageManagerService( 74): PackageManagerService.java scanPath = /system/app/ServiceSample.apk
D/PackageParser( 74): PackageParser.java Scanning package: = /system/app/ServiceSample.apk
I/PackageParser( 74): parsePackage pkgName = tjuci.edu.dl
I/PackageParser( 74): parsePackage mOnlyCoreApps = false
I/PackageParser( 74): parsePackage sa =[0, 0, 1, 0, 0, 0, 16, 1, -1, 0, 0, 0, 3, 12, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0]
I/PackageParser( 74): parsePackage pkg.mVersionCode = 1
I/PackageParser( 74): parsePackage pkg.mVersionName = 1.0
I/PackageParser( 74): parsePackage sharedUserId = null
I/PackageParser( 74): PackageParser.java pkg.installLocation = -1
I/PackageParser( 74): PackageParser.java tagName = uses-sdk
I/PackageParser( 74): parsepackage minsdkVersion = TypedValue{t=0x10/d=0xf a=-1}
I/PackageParser( 74): parsepackage minVers(min) = 15
I/PackageParser( 74): parsepackage val = null
I/PackageParser( 74): PackageParser.java tagName = application
I/PackageParser( 74): parseApplication attrs =android.content.res.XmlBlock$Parser@2c7c39b0
I/PackageParser( 74): parseApplication parseApplication name = null
I/PackageParser( 74): PackageParser.java manageSpaceActivity = null
I/PackageParser( 74): parseApplication ParseApplication ai.icon = 0
I/PackageParser( 74): parseApplication ParseApplication ai.logo = 0
I/PackageParser( 74): parseApplication ParseApplication ai.theme = 0
I/PackageParser( 74): parseApplication ParseApplication ai.descriptionRes = 0
I/PackageParser( 74): parseApplication ParseApplication v.coerceToString = ServiceSample
I/PackageParser( 74): parseApplication ParseApplication label = TypedValue{t=0x3/d=0x4 "ServiceSample" a=2 r=0x7f040001}
I/PackageParser( 74): parseApplication ApplicationInfo = ApplicationInfo{2c7c4010 tjuci.edu.dl}
I/PackageParser( 74): parseApplication ParseApplication tagName = service
I/PackageParser( 74): parseService serviceInfo = Service{2c7c83b8 tjuci.edu.dl/tjuci.edu.service.MyService}
I/PackageManagerService( 74): /system/app/ServiceSample.apk changed; collecting certs
I/PackageParser( 74): PackageParser.java pkg.mPath = /system/app/ServiceSample.apk
I/PackageParser( 74): PackageParser.java pkg.mScanPath = /system/app/ServiceSample.apk
I/PackageManagerService( 74): PackageManagerService.java oldName=null
I/PackageManagerService( 74): PackageManagerService.java ps == null
I/PackageManagerService( 74): PackageManagerService.java updatePkg = null
I/PackageParser( 74): collectCertificates readBuffer = [B@2c7c9830
I/PackageParser( 74): collectCertificates mArchiveSourcePath = /system/app/ServiceSample.apk
I/System.out( 74): libcore ----> JarFile.java getInputStream start.
I/System.out( 74): libcore ----> JarFile.java getInputStream manifestEntry = META-INF/MANIFEST.MF
I/System.out( 74): libcore ----> JarFile.java getInputStream verifier = java.util.jar.JarVerifier@2c7ce358
I/PackageParser( 74): collectCertificates jarEntry=AndroidManifest.xml ANDROID_MANIFEST_FILENAME=AndroidManifest.xml
I/System.out( 74): libcore->JarVerifier.java key = META-INF/CERT.RSA
I/System.out( 74): libcore->JarVerifier.java verifyCertificate start.
I/System.out( 74): libcore->JarVerifier.java verifyCertificate cerFile =META-INF/CERT.RSA
I/System.out( 74): libcore->JarVerifier.java verifyCertificate signatureFile =META-INF/CERT.SF
I/System.out( 74): libcore->JarUtils.java verifySignature start.
I/System.out( 74): libcore->JarUtils.java certs[i++] = new done
I/System.out( 74): libcore->JarUtils.java verifySignature issuer = CN=Android Debug, O=Android, C=US
I/System.out( 74): libcore->JarUtils.java verifySignature snum = 1065134142
I/System.out( 74): libcore->JarUtils.java verifySianature Get Signature instance
I/System.out( 74): libcore->JarUtils.java verifySignature alg = 1.3.14.3.2.26with1.2.840.113549.1.1.1
I/System.out( 74): libcore->JarUtils.java verifySignature sig = SIGNATURE RSA-SHA1 state: UNINITIALIZED
I/System.out( 74): libcore->JarUtils.java sig.initVerify start.
I/NativeCrypto-jni( 74): EVP_PKEY_new_RSA(n=0x46700005, e=0x3bf00009, d=0x0, p=0x0, q=0x0)
I/NativeCrypto-jni( 74): arrayToBignum(0x46700005)
I/NativeCrypto-jni( 74): arrayToBignum(0x46700005) => 0x70f418
I/NativeCrypto-jni( 74): arrayToBignum(0x3bf00009)
I/NativeCrypto-jni( 74): arrayToBignum(0x3bf00009) => 0x70f430
I/NativeCrypto-jni( 74): EVP_PKEY_new_RSA(n=0x46700005, e=0x3bf00009, d=0x0, p=0x0, q=0x0) => 0x683870
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyInit(0x46800005)
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyInit ctx=0x6b5fc8
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyInit algorithmChars=RSA-SHA1
I/System.out( 74): libcore->JarUtils.java sig.initVerify end.
I/System.out( 74): libcore->JarUtils.java atr == null
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyUpdate(0x6b5fc8, 0x46b00005, 0, 638)
I/System.out( 74): libcore->JarUtils.java verifySignature sig.update(sfBytes) done
I/System.out( 74): libcore->Signature.java verify state ==VERIFY
I/System.out( 74): OpenSSLSignature.java engineVerify start.
I/System.out( 74): OpenSSLSignature.java engineVerify handle = 6830192
I/System.out( 74): OpenSSLSignature.java engineVerify Native.EVP_VerifyFinal
I/System.out( 74): OpenSSLSignature.java engineVerify sigBytes = [B@2c7ddc30
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyFinal(0x6b5fc8, 0x47200005, 0, 256, 0x683870)
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyFinal bufferBytes = 0x2c7ddc40
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyFinal bufferBytes = 0x2c7ddc40
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyFinal (unsigned char *)(bufferBytes) = 0x2c7ddc40
I//system/bin/app_process( 45): p_verify.c EVP_VerifyFinal start.
I//system/bin/app_process( 45): p_verify.c EVP_VerifyFinal start EVP_PKEY_verify start.
I//system/bin/app_process( 45): pmeth_fn.c EVP_PKEY_verify start.
I//system/bin/app_process( 45): pmeth_fn.c EVP_PKEY_verify end.
I/NativeCrypto-jni( 74): OpenSSL error in NativeCrypto_EVP_VerifyFinal 67702888: error:04091068:rsa routines:INT_RSA_VERIFY:bad signature
I/NativeCrypto-jni( 74): NativeCrypto_EVP_VerifyFinal(0x6b5fc8, 0x47200005, 0, 256, 0x683870) => 0


W/PackageParser( 74): Exception reading AndroidManifest.xml in /system/app/ServiceSample.apk
W/PackageParser( 74): java.lang.SecurityException: /system/app/ServiceSample.apk failed verification of META-INF/CERT.SF
W/PackageParser( 74): at java.util.jar.JarVerifier.failedVerification(JarVerifier.java:136)
W/PackageParser( 74): at java.util.jar.JarVerifier.verifyCertificate(JarVerifier.java:315)
W/PackageParser( 74): at java.util.jar.JarVerifier.readCertificates(JarVerifier.java:259)
W/PackageParser( 74): at java.util.jar.JarFile.getInputStream(JarFile.java:385)
W/PackageParser( 74): at android.content.pm.PackageParser.loadCertificates(PackageParser.java:362)
W/PackageParser( 74): at android.content.pm.PackageParser.collectCertificates(PackageParser.java:543)
W/PackageParser( 74): at com.android.server.pm.PackageManagerService.collectCertificatesLI(PackageManagerService.java:2869)
W/PackageParser( 74): at com.android.server.pm.PackageManagerService.scanPackageLI(PackageManagerService.java:2967)
W/PackageParser( 74): at com.android.server.pm.PackageManagerService.scanDirLI(PackageManagerService.java:2813)
W/PackageParser( 74): at com.android.server.pm.PackageManagerService.(PackageManagerService.java:1090)
W/PackageParser( 74): at com.android.server.pm.PackageManagerService.main(PackageManagerService.java:837)
W/PackageParser( 74): at com.android.server.ServerThread.run(SystemServer.java:164)


.

stackoverflow.comm

No comments:

Post a Comment

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...