AndroidKiller中smali打包错误解决

使用AndroidKiller打开一款app,修改代码后重新编译打包报错如下

当前 Apktool 使用版本:apktool_2.3.2
正在编译 APK,请稍等...
>I: Using Apktool 2.3.2
>I: Smaling smali folder into classes.dex...
>I: Building resources...
>S: WARNING: Could not write to (C:\Users\Administrator\AppData\Local\apktool\framework), using C:\Users\ADMINI~1\AppData\Local\Temp\ instead...
>S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
>W: D:\Program Files\AndroidKiller_v1.3.1\projects\ChaseCamera_v1.0.1\Project\res\values\public.xml:27: error: Public symbol array/categories declared here is not defined.
>brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\ADMINI~1\AppData\Local\Temp\brut_util_Jar_3987554955499107196.tmp, p, --forced-package-id, 127, --min-sdk-version, 19, --target-sdk-version, 28, --version-code, 1, --version-name, 1.0.1, --no-version-vectors, -F, C:\Users\ADMINI~1\AppData\Local\Temp\APKTOOL7150379841642260279.tmp, -0, arsc, -0, META-INF/android.arch.core_runtime.version, -0, META-INF/android.arch.lifecycle_livedata-core.version, -0, META-INF/android.arch.lifecycle_livedata.version, -0, META-INF/android.arch.lifecycle_runtime.version, -0, META-INF/android.arch.lifecycle_viewmodel.version, -0, META-INF/androidx.asynclayoutinflater_asynclayoutinflater.version, -0, META-INF/androidx.coordinatorlayout_coordinatorlayout.version, -0, META-INF/androidx.core_core.version, -0, META-INF/androidx.cursoradapter_cursoradapter.version, -0, META-INF/androidx.customview_customview.version, -0, META-INF/androidx.documentfile_documentfile.version, -0, META-INF/androidx.drawerlayout_drawerlayout.version, -0, META-INF/androidx.fragment_fragment.version, -0, META-INF/androidx.interpolator_interpolator.version, -0, META-INF/androidx.legacy_legacy-support-core-ui.version, -0, META-INF/androidx.legacy_legacy-support-core-utils.version, -0, META-INF/androidx.legacy_legacy-support-v4.version, -0, META-INF/androidx.loader_loader.version, -0, META-INF/androidx.localbroadcastmanager_localbroadcastmanager.version, -0, META-INF/androidx.media_media.version, -0, META-INF/androidx.print_print.version, -0, META-INF/androidx.slidingpanelayout_slidingpanelayout.version, -0, META-INF/androidx.swiperefreshlayout_swiperefreshlayout.version, -0, META-INF/androidx.versionedparcelable_versionedparcelable.version, -0, META-INF/androidx.viewpager_viewpager.version, -0, META-INF/com.android.support_animated-vector-drawable.version, -0, META-INF/com.android.support_appcompat-v7.version, -0, META-INF/com.android.support_cardview-v7.version, -0, META-INF/com.android.support_customtabs.version, -0, META-INF/com.android.support_support-vector-drawable.version, -0, arsc, -I, C:\Users\ADMINI~1\AppData\Local\Temp\1.apk, -S, D:\Program Files\AndroidKiller_v1.3.1\projects\ChaseCamera_v1.0.1\Project\res, -M, D:\Program Files\AndroidKiller_v1.3.1\projects\ChaseCamera_v1.0.1\Project\AndroidManifest.xml]
APK 编译失败,无法继续下一步签名!

报这么多错误,咋个解决呢。这里说下思路。思路是最重要的。

先检查下自己配置是否正确(我自己写一个demo,解包,重新编译,成功,那就说明环境是ok的)
来看看demo编译的日志

当前 Apktool 使用版本:apktool_2.3.2
正在编译 APK,请稍等...
>I: Using Apktool 2.3.2
>I: Smaling smali folder into classes.dex...
>I: Building resources...
>S: WARNING: Could not write to (C:\Users\Administrator\AppData\Local\apktool\framework), using C:\Users\ADMINI~1\AppData\Local\Temp\ instead...
>S: Please be aware this is a volatile directory and frameworks could go missing, please utilize --frame-path if the default storage directory is unavailable
>I: Copying libs... (/kotlin)
>I: Building apk file...
>I: Copying unknown files/dir...
>I: Built apk...
APK 编译完成!
正在对 APK 进行签名,请稍等...
APK 签名完成!
---------------------------
APK 所有编译工作全部完成!!!
生成路径:
file:D:\Program Files\AndroidKiller_v1.3.1\projects\app-debug\Bin\app-debug_killer.apk

从日志就可以看出两点,第一就是环境是ok的,第二,对于S: WARNING这种信息不用管它,不影响编译。
再回去看我们文章开头的报错,关注点移动到这里

>W: D:\Program Files\AndroidKiller_v1.3.1\projects\ChaseCamera_v1.0.1\Project\res\values\public.xml:27: error: Public symbol array/categories declared here is not defined.

你不知道这个W:是什么意思?那你总知道这个xml:27: error: Public是错误的意思吧。上面这句话报错,说是values\public.xml有个叫做categories的,但是你没有定义它。接下来就去’工程搜索’,发现这个是facebook的。

<public type="array" name="categories" id="0x7f020000" />  

那我代码里没有定义这个,所以我就注销这句

   <!--    <public type="array" name="categories" id="0x7f020000" />  -->

重新编译成功。
你学会了吗?如果你的情况是还有其他错误,你会自己排查了吗?

### 如何在 Spring Boot 2 中集成 Lettuce 和 Redis #### 添加依赖项 为了在 Spring Boot 2 中集成 Redis 并使用 Lettuce 客户端,需要在 `pom.xml` 文件中添加以下 Maven 依赖项。此依赖会自动引入 Lettuce 作为默认的 Redis 客户端[^4]。 ```xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> </dependency> ``` #### 创建 Spring Boot 启动类 定义一个标准的 Spring Boot 应用程序启动类。该类通过 `@SpringBootApplication` 注解标记,并提供了一个静态入口点用于运行应用程序[^3]。 ```java package com.example.demo; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class DemoApplication { public static void main(String[] args) { SpringApplication.run(DemoApplication.class, args); } } ``` #### 配置 Redis 连接 在项目的 `application.properties` 或 `application.yml` 文件中配置 Redis 的连接参数。以下是基于 YAML 格式的示例配置: ```yaml spring: redis: host: localhost port: 6379 password: timeout: 5000ms lettuce: pool: max-active: 8 max-idle: 8 min-idle: 0 ``` 上述配置指定了 Redis 实例的位置、密码以及超时时间等基本信息。此外,还设置了 Lettuce 的连接池属性以优化性能。 对于更复杂的场景,比如 Redis 集群模式下的配置,则可以参考如下设置[^5]: ```yaml spring: application: name: demo-application lettuce: cluster: nodes: 127.0.0.1:7000,127.0.0.1:7001,127.0.0.1:7002 refresh: adaptive: true ``` #### 使用 RedisTemplate 访问数据 完成以上步骤后,在业务逻辑层可以通过注入 `RedisTemplate` 来访问 Redis 数据库。下面是一个简单的例子展示如何存储和检索字符串类型的键值对: ```java import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Service; @Service public class RedisService { @Autowired private RedisTemplate<String, String> redisTemplate; public void setValue(String key, String value){ redisTemplate.opsForValue().set(key,value); } public String getValue(String key){ return redisTemplate.opsForValue().get(key); } } ```
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值