GithubHelp home page GithubHelp logo

all-to-zip's Introduction

使用密码

打开config/index.js可以看到一些配置,大致如下:

{
    matches: byKeyword('xxx'),
    answer: constant('zzz')
}

上面这个配置的意思是,当文名包含xxx时,使用zzz作为密码。

或者这样:

{
    matches({output}) {
        return output.split('\n').pop().includes('use current password');
    },
    answer: constant('A')
}

这就是自定义的逻辑,其中matches中的参数里的output是当前命令行的输出,取最后一行来判断,answer表示返回的密码。

最后的一段:

{
    matches({output}) {
        return output.split('\n').pop().startsWith('Enter password (will not be echoed)');
    },
    answer(child) {
        const query = readline.createInterface({input: process.stdin, output: process.stdout});

        const executor = resolve => query.question(
            'Password: ',
            answer => {
                resolve(answer);
                query.close();
            }
        );

        return new Promise(executor);
    }
}

则表示实在没有任何密码时,提示手动输入再提交。

当前的config/index.js中包含了不少不可名状的解压密码,可以无视。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.