在反编译APK后保护AndroidManifest.xml文件中的fabric.io API密钥
我想从Androidmanifest文件中删除/保护fabric.io API密钥。并且已经实施了以下两种不同的方法,其中没有一种是有效的。 反编译/逆向工程后,仍然能够在清单文件中看到API密钥。 第一种方法 创建了fabric.properties文件,并在下面添加了密钥在反编译APK后保护AndroidManifest.xml文件中的fabric.io API密钥,android,fabric.io,Android,Fabric.io,我想从Androidmanifest文件中删除/保护fabric.io API密钥。并且已经实施了以下两种不同的方法,其中没有一种是有效的。 反编译/逆向工程后,仍然能够在清单文件中看到API密钥。 第一种方法 创建了fabric.properties文件,并在下面添加了密钥 apiKey=XXXX 并从AndroidManifest.xml文件中删除了以下代码 <meta-data android:name="io.fabric.ApiKey"
apiKey=XXXX
并从AndroidManifest.xml文件中删除了以下代码
<meta-data
android:name="io.fabric.ApiKey"
android:value="XXXXXXXXXX" />
在build.gradle中添加了以下代码
def getLocalProperty(String propertyName) {
def propsFile = rootProject.file('local.properties')
if (propsFile.exists()) {
def props = new Properties()
props.load(new FileInputStream(propsFile))
return props[propertyName]
} else {
return ""
}
defaultConfig {
manifestPlaceholders = [fabric_io_id: getLocalProperty("io.fabric.ApiKey")]
}
在AndroidManifest.xml中添加以下代码
<meta-data
android:name="io.fabric.ApiKey"
android:value="${fabric_io_id}" />
上述方法无法在反编译APK后安全地从AndroidManifest.xml中删除API密钥。
有谁能提出不同的方法吗?fabric crashlytics不是不推荐吗?使用Firebase crashlytics,在Firebase项目设置中,您可以添加应用程序的哈希id以设置限制。这样API就不会在你的应用程序之外工作了
<meta-data
android:name="io.fabric.ApiKey"
android:value="${fabric_io_id}" />