0.结果


1.需求

迫于每次都要打开 Powershell 手动敲 adb install xxx.apk 太麻烦,就想通过注册表搞一个右键菜单,实现快捷安装 apk 的功能。

最后决定先实现三个功能:

  • adb install -r
  • adb install -t
  • 使用 jarsigner 重签名

可是对 windows 一窍不通,只能去网上抄代码。


2.抄代码

照着几个现成的代码抄,又测了半天,最后发现无论是注册HKEY_CLASSES_ROOT\.apk\还是HKEY_CLASSES_ROOT\apk_auto_file\、无论配置SubCommands还是直接在\.apk\shell下面增加条目,都没办法在apk文件的右键中展示。

反正也是自己用,图方便就直接对HKEY_CLASSES_ROOT\*\进行注册了。

调用的代码是Powershell -noexit 'command',第一次写 shell 代码,这个-noexit还查了老半天。


3.代码

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\Shell\ApkHelper]

"MUIVerb"="APK Helper"

"SubCommands"=""

"Position"="Center"

[HKEY_CLASSES_ROOT\*\shell\ApkHelper\Shell]

[HKEY_CLASSES_ROOT\*\shell\ApkHelper\Shell\InstallR]

@="adb install -r"

[HKEY_CLASSES_ROOT\*\shell\ApkHelper\Shell\InstallR\command]

@="PowerShell -noexit adb install -r \"%1\" "

[HKEY_CLASSES_ROOT\*\shell\ApkHelper\Shell\InstallT]

@="adb install -t"

[HKEY_CLASSES_ROOT\*\shell\ApkHelper\Shell\InstallT\command]

@="PowerShell -noexit adb install -r -t \"%1\" "

[HKEY_CLASSES_ROOT\*\shell\ApkHelper\Shell\SignNew]

@="Jarsigner"

[HKEY_CLASSES_ROOT\*\shell\ApkHelper\Shell\SignNew\command]

@="PowerShell -noexit jarsigner -verbose -keystore F:\Decompile\windows签名工具\Test.keystore -storepass 123456 -signedjar \"%1.signed.apk\"  \"%1\"  test -digestalg SHA1 -sigalg MD5withRSA  "


4.Todo

  • 1.只为 apk 文件注册右键菜单组
  • 2.配置命令执行 python 脚本对重签名的文件名进行优化
  • 3.为 apk 文件增加常用的 apktool 命令
  • 4.为 dex 文件增加常用的 d2j 命令

最新文章

  1. mysql 导出批量导出表数据 (程序)
  2. linux环境下安装tomcat并配置tomcat日志分割
  3. ODAC学习地址
  4. 论文笔记之: Recurrent Models of Visual Attention
  5. hdu 1491 Octorber 21st
  6. android抓包工具
  7. 学习 ExtJS 4 面板与布局
  8. LINUX nfs服务
  9. thinkphp 3.2 导入第三方类库的两种方式
  10. EBS-子库存转移和物料搬运单区别
  11. Unix历史及相关概念回顾
  12. AspnetCore WebApi使用Swagger简单入门
  13. What can Reactive Streams offer EE4J?
  14. ppt字体
  15. python爬虫---BeautifulSoup的用法
  16. linux命令1—安装optimizer
  17. nc63 树管理型单据的开发
  18. 转载--void指针(void *的用法)
  19. 面试准备——(三)Selenium面试题总结
  20. Pro Git 学习笔记

热门文章

  1. Codeforces Round #666 (Div. 2)
  2. NOIP2015提高组 信息传递 ---并查集问题
  3. Java中赋值常量的注意事项
  4. Vitya and Strange Lesson CodeForces - 842D 字典树+交换节点
  5. Educational Codeforces Round 91 (Rated for Div. 2) A. Three Indices (模拟)
  6. Django分页APP_django-pure-pagination
  7. pthread_create函数
  8. Leetcode(11)-盛最多水的容器
  9. (转载)RTMP协议中的AMF数据 http://blog.csdn.net/yeyumin89/article/details/7932585
  10. exgcd&&中国剩余定理专题练习