请教插件上传到cydia源服务器后,从cydia安装不重启springboard

插件上传到cydia源服务器后,从cydia安装不重启springboard,而显示返回cydia?`

可以用 postinst

1. 简单的 postinst 可以这样写

#!/bin/bash

declare -a cydia
cydia=($CYDIA)

if [[ ${CYDIA+@} ]]; then
        eval "echo 'finish:restart' >&${cydia[0]}"
else
        echo "Please reboot your device after this!"
fi

exit 0

2. make package 前,将 postinst 一并加到 deb 中,可在 Makefile 添加

before-package::
	cp (postinst dir)/postinst ./.theos/_/DEBIAN/

我用你的脚本试了下还是不行啊,还是重启springboard

这是我的一个git demo ,麻烦你看看有问题没 https://github.com/onezens/QQTweak.git

有点看晕了,你是不希望重启 SpringBoard 是吗?
我那个脚本是重启 SpringBoard 的。

之前试过上传到自建源服务器,默认是不会重启的,你可以看看源管理器后台,是否有相关配置?

或者,直接对比上传前的 deb 跟下载后的 deb,找找是否添加了 postinst 之类的。

是的,我不希望重启springboard,但是我找的自建cydia源,然后在cydia添加后,安装是重启springboard的,你上次测试的自建cydia还有教程吗?

Package: cc.onezen.mqq
Version: 1.3.1
Section: Tweaks
Maintainer: wz
Depends: mobilesubstrate
Architecture: iphoneos-arm
Filename: .//cc.onezen.mqq_1.3.1-1+debug_iphoneos-arm.deb
Size: 1774
MD5sum: 0a76854767853d74b0eb2ac7a9ffd6e3
Description: An awesome MobileSubstrate tweak!
Name: qq
Author: wz

这是生成的配置,没有发现有相关的配置

dpkg -I xx.deb
看看上传前 deb,跟下载后 deb 显示的信息,若是要重启 SpringBoard,显示的信息,应该会有 postinst 的。

谢谢指教,受你的启发已经解决了

#!/bin/bash
declare -a cydia
cydia=($CYDIA)
if [[ ${CYDIA+@} ]]; then
        eval "echo 'finish:open' >&${cydia[0]}"
else
        echo "Please reboot your device after this!"
fi

exit 0

比较好奇

finish:open 

这条命令,是在哪找到的资料?

我当时也是google,百度,都没有找到。然后不知道怎么弄得,在越狱iPhone上找到了所有包的脚本路径: /var/lib/dpkg/info/ 然后一条条看的,上面不同的脚本不同的操作,reopen是关闭cydia open 打开cydia, restart 重启springboard , reboot 重启系统

一样,我也是这么找的:sweat_smile:

wiki 上找到 Cydia 可以接收的参数:

## Acceptable parameters for finish
# return - normal behaviour (return to cydia)
# reopen - exit cydia
# restart - reload springboard
# reload - reload springboard
# reboot - reboot device
##
3 个赞

666 ,好详细

我在ios11上eval "echo ‘finish:reboot’ >&${cydia[0]}"可以显示重启按钮

但是eval "echo ‘finish:return’ >&${cydia[0]}"或者不写都是显示重启Springboard按钮

比如openSSH的postinst只有个exit 0结尾,会显示回到Cydia
但是我只写exit 0却显示重启Springboard。

请问大佬们有遇到过吗,还是说有其他地方需要设置

makefile有个after install的部分看一下

需要把control文件的依赖干掉:

Package: cc.onezen.wechatbot  #包名id
Name: WeChatBot
Depends: mobilesubstrate   #依赖库和依赖插件,如果需要插件在cydia安装后不重启springboard可以删掉,否则每次重新
Version: 0.0.1
Architecture: iphoneos-arm
Description: An awesome MobileSubstrate tweak!
Maintainer: wz
Author: wz
Section: Tweaks #cydia源中的分类
Icon: file:///Library/AppSupport/WeChatBot/imgs/wcb_icon.png #icon

移除掉: Depends: mobilesubstrate

具体描述可看这个文档:https://www.jianshu.com/p/768d71f87ca4

1 个赞

把 tweaks改成system就可以了