V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
lancerly
V2EX  ›  Linux

看 Xposed 的时候发现一条奇怪的 shell 命令,结构是 filepath 2 1 filepath 有点不解,求会的人帮我解释下

  •  
  •   lancerly · 2018-09-21 18:13:34 +08:00 · 1982 次点击
    这是一个创建于 2015 天前的主题,其中的信息可能已经有所发展或是发生改变。

    源代码:

    int result = rootUtil.execute(getShellPath(updateBinaryFile) + " 2 1 " + getShellPath(mZipPath), callback);
    
        public synchronized int execute(String command, LineCallback callback) {
            if (mShell == null) {
                throw new IllegalStateException("shell is not running");
            }
    
            mCallback = callback;
            mCommandRunning = true;
            mShell.addCommand(command, 0, mStdoutListener);
            waitForCommandFinished();
    
            return mLastExitCode;
        }
        
            public synchronized void addCommand(String[] commands, int code,
                                                OnCommandLineListener onCommandLineListener) {
                this.commands.add(new Command(commands, code, null, onCommandLineListener));
                runNextCommand();
            }
    

    参数代入后的命令是:

    /data/data/de.robv.android.xposed.installer/cache/update-binary 2 1 /storage/emulated/0/Android/data/de.robv.android.xposed.installer/cache/downloads/framework/xposed-v89-sdk24-arm64.zip
    

    可以看到执行的就是上面那条命令, 求解,这个命令是啥?

    3 条回复    2018-09-21 18:34:44 +08:00
    omph
        1
    omph  
       2018-09-21 18:27:23 +08:00   ❤️ 1
    update-binary 是 shell 脚本,后面带了三个参数,有什么问题?
    ysc3839
        2
    ysc3839  
       2018-09-21 18:30:40 +08:00 via Android
    看 update-binary 的代码。
    lancerly
        3
    lancerly  
    OP
       2018-09-21 18:34:44 +08:00
    @omph 哦哦,我懂了...我脑子瓦特了,,,
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5266 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 09:14 · PVG 17:14 · LAX 02:14 · JFK 05:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.