Skip to content

能否支持加密引入的aar呢? #173

@OctRaging

Description

@OctRaging

目前在app级别build.gradle通过implementation files('libs/something.aar')引入aar

基于如下配置
`plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
id("stringfog")
}
apply plugin: 'stringfog'

// 导入RandomKeyGenerator类,如果使用HardCodeKeyGenerator,更换下类名
import com.github.megatronking.stringfog.plugin.kg.RandomKeyGenerator
import com.github.megatronking.stringfog.plugin.StringFogMode

stringfog {
// 必要:加解密库的实现类路径,需和上面配置的加解密算法库一致。
implementation 'com.github.megatronking.stringfog.xor.StringFogImpl'
// 可选:StringFog会自动尝试获取packageName,如果遇到获取失败的情况,可以显式地指定。
// packageName 'com.example.mypackagename'
// 可选:加密开关,默认开启。
enable true
// 可选:指定需加密的代码包路径,可配置多个,未指定将默认全部加密。
// fogPackages = []
// 可选(3.0版本新增):指定密钥生成器,默认使用长度8的随机密钥(每个字符串均有不同随机密钥),
// 也可以指定一个固定的密钥:HardCodeKeyGenerator("This is a key")
kg new RandomKeyGenerator()
// 可选(4.0版本新增):用于控制字符串加密后在字节码中的存在形式, 默认为base64,
// 也可以使用text或者bytes
mode StringFogMode.base64
}
`

无法正常加密aar中的字符串,但项目中的字符串是被加密了的,是我的配置有问题,还是StringFog本身不支持呢?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions