-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1、添加GooglePlay加固特征 2、临时取消V2签名验证
- Loading branch information
Showing
7 changed files
with
68 additions
and
43 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
//} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters