Skip to content

Commit

Permalink
20241230
Browse files Browse the repository at this point in the history
1、添加GooglePlay加固特征
2、临时取消V2签名验证
  • Loading branch information
moyuwa committed Dec 30, 2024
1 parent af7220d commit 393ba8d
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 43 deletions.
Empty file removed bin/test.txt
Empty file.
15 changes: 15 additions & 0 deletions data/apkpackdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,21 @@
"soregex": [
]
},
"google(play)加固": {
"sopath": [
"lib/arm64-v8a/libpairipcore.so",
"lib/armeabi-v7a/libpairipcore.so",
"lib/x86_64/libpairipcore.so",
"lib/x86/libpairipcore.so"
],
"soname": [
"libpairipcore.so"
],
"other": [
],
"soregex": [
]
},
"未知厂商": {
"sopath": [
],
Expand Down
60 changes: 31 additions & 29 deletions src/ACPverifyAllSignatureVersions.go
Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
package main

import (
"fmt"
"github.com/avast/apkverifier"
"os"
)

func verifyApk(apkpath string) bool {
//读取配置
res, err := apkverifier.Verify(apkpath, nil)
if err != nil {
fmt.Fprintf(os.Stderr, "Verification failed: %s\n", err.Error())
return false
}
//判断是否为V1版本
if res.SigningSchemeId == 1 {
fmt.Printf("Verification scheme used: v%d 版本签名,有Janus漏洞!\n", res.SigningSchemeId)
} else {
fmt.Printf("Verification scheme used: v%d 版本签名,无Janus漏洞!\n", res.SigningSchemeId)
}
//输出相信信息
cert, _ := apkverifier.PickBestApkCert(res.SignerCerts)
if cert == nil {
fmt.Printf("No certificate found.\n")
} else {
fmt.Println(cert)
}

return true
}
//20241230 临时取消签名验证 减小程序体积
//
//import (
// "fmt"
// "github.com/avast/apkverifier"
// "os"
//)
//
//func verifyApk(apkpath string) bool {
// //读取配置
// res, err := apkverifier.Verify(apkpath, nil)
// if err != nil {
// fmt.Fprintf(os.Stderr, "Verification failed: %s\n", err.Error())
// return false
// }
// //判断是否为V1版本
// if res.SigningSchemeId == 1 {
// fmt.Printf("Verification scheme used: v%d 版本签名,有Janus漏洞!\n", res.SigningSchemeId)
// } else {
// fmt.Printf("Verification scheme used: v%d 版本签名,无Janus漏洞!\n", res.SigningSchemeId)
// }
// //输出相信信息
// cert, _ := apkverifier.PickBestApkCert(res.SignerCerts)
// if cert == nil {
// fmt.Printf("No certificate found.\n")
// } else {
// fmt.Println(cert)
// }
//
// return true
//}
2 changes: 1 addition & 1 deletion src/PackJsonData.go

Large diffs are not rendered by default.

22 changes: 12 additions & 10 deletions src/SDKByLibSo.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,21 @@ func SDKByLibSo(apkpath string) bool {
}

//输出匹配结果 先格式化再输出
fmt.Printf("\n===扫描第三方SDK特征结果===\n\n")
if sdksolist != nil {
fmt.Printf("\n===扫描第三方SDK特征结果===\n\n")

var pftstr []string
for _, value := range sdksolist {
//fmt.Printf("%s, %s->%s", value.Team, value.Label, value.Soname)
pftstr = append(pftstr, fmt.Sprintf("%s, %s->%s", value.Team, value.Label, value.Soname))
}
var pftstr []string
for _, value := range sdksolist {
//fmt.Printf("%s, %s->%s", value.Team, value.Label, value.Soname)
pftstr = append(pftstr, fmt.Sprintf("%s, %s->%s", value.Team, value.Label, value.Soname))
}

sort.Strings(pftstr)
for _, value := range pftstr {
fmt.Printf("%s\n", value)
sort.Strings(pftstr)
for _, value := range pftstr {
fmt.Printf("%s\n", value)
}
fmt.Printf("\n=======================\n")
}
fmt.Printf("\n=======================\n")

return true
}
4 changes: 2 additions & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ func scanAPKFolder(folderPath string) error {
}

func scanAPKFile(filePath string) error {
fmt.Printf("scanAPKFile")
//fmt.Printf("scanAPKFile")

verifyApk(filePath)
//verifyApk(filePath) //20241230 临时取消签名验证 减小程序体积

PackByLibSo(filePath)

Expand Down
8 changes: 7 additions & 1 deletion windows_linux_darwin_amd64.bat
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,10 @@ echo "darwin_amd64"
SET CGO_ENABLED=0
SET GOOS=darwin
SET GOARCH=amd64
go build -ldflags="-s -w" -o bin/ApkCheckPack_darwin_amd64 ./src
go build -ldflags="-s -w" -o bin/ApkCheckPack_darwin_amd64 ./src

rem Linux上跨平台编译程序
rem CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags="-s -w" -o your-program.exe your-program.go
rem CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -ldflags="-s -w" -o your-program.exe your-program.go
rem CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w" -o your-program your-program.go

0 comments on commit 393ba8d

Please sign in to comment.