[
  {
    "path": ".idea/.gitignore",
    "content": "# 默认忽略的文件\n/shelf/\n/workspace.xml\n# 数据源本地存储已忽略文件\n/dataSources/\n/dataSources.local.xml\n# 基于编辑器的 HTTP 客户端请求\n/httpRequests/\n"
  },
  {
    "path": ".idea/.name",
    "content": "FofaCollect"
  },
  {
    "path": ".idea/artifacts/FofaCollect_jar.xml",
    "content": "<component name=\"ArtifactManager\">\n  <artifact type=\"jar\" name=\"FofaCollect:jar\">\n    <output-path>$PROJECT_DIR$/out/artifacts/FofaCollect_jar</output-path>\n    <root id=\"archive\" name=\"FofaCollect.jar\">\n      <element id=\"directory\" name=\"META-INF\">\n        <element id=\"file-copy\" path=\"$PROJECT_DIR$/src/META-INF/MANIFEST.MF\" />\n      </element>\n      <element id=\"module-output\" name=\"FofaCollect\" />\n      <element id=\"extracted-dir\" path=\"$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.9.9/jackson-core-2.9.9.jar\" path-in-jar=\"/\" />\n      <element id=\"extracted-dir\" path=\"$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.9.10.4/jackson-databind-2.9.10.4.jar\" path-in-jar=\"/\" />\n      <element id=\"extracted-dir\" path=\"$MAVEN_REPOSITORY$/com/r4v3zn/fofa/fofa-core/1.0.2.RELEASE/fofa-core-1.0.2.RELEASE.jar\" path-in-jar=\"/\" />\n      <element id=\"extracted-dir\" path=\"$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.9.10/jackson-annotations-2.9.10.jar\" path-in-jar=\"/\" />\n    </root>\n  </artifact>\n</component>"
  },
  {
    "path": ".idea/compiler.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"CompilerConfiguration\">\n    <annotationProcessing>\n      <profile name=\"Maven default annotation processors profile\" enabled=\"true\">\n        <sourceOutputDir name=\"target/generated-sources/annotations\" />\n        <sourceTestOutputDir name=\"target/generated-test-sources/test-annotations\" />\n        <outputRelativeToContentRoot value=\"true\" />\n        <module name=\"FofaCollect\" />\n      </profile>\n    </annotationProcessing>\n    <bytecodeTargetLevel>\n      <module name=\"FofaCollect\" target=\"6\" />\n    </bytecodeTargetLevel>\n  </component>\n</project>"
  },
  {
    "path": ".idea/jarRepositories.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"RemoteRepositoriesConfiguration\">\n    <remote-repository>\n      <option name=\"id\" value=\"central\" />\n      <option name=\"name\" value=\"Central Repository\" />\n      <option name=\"url\" value=\"https://repo.maven.apache.org/maven2\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"central\" />\n      <option name=\"name\" value=\"Central Repository\" />\n      <option name=\"url\" value=\"http://maven.aliyun.com/nexus/content/repositories/central/\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"central\" />\n      <option name=\"name\" value=\"Maven Central repository\" />\n      <option name=\"url\" value=\"https://repo1.maven.org/maven2\" />\n    </remote-repository>\n    <remote-repository>\n      <option name=\"id\" value=\"jboss.community\" />\n      <option name=\"name\" value=\"JBoss Community repository\" />\n      <option name=\"url\" value=\"https://repository.jboss.org/nexus/content/repositories/public/\" />\n    </remote-repository>\n  </component>\n</project>"
  },
  {
    "path": ".idea/libraries/Maven__cn_hutool_hutool_core_5_7_3.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"Maven: cn.hutool:hutool-core:5.7.3\">\n    <CLASSES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-core/5.7.3/hutool-core-5.7.3.jar!/\" />\n    </CLASSES>\n    <JAVADOC>\n      <root url=\"jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-core/5.7.3/hutool-core-5.7.3-javadoc.jar!/\" />\n    </JAVADOC>\n    <SOURCES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/cn/hutool/hutool-core/5.7.3/hutool-core-5.7.3-sources.jar!/\" />\n    </SOURCES>\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_12_4.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.4\">\n    <CLASSES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.12.4/jackson-annotations-2.12.4.jar!/\" />\n    </CLASSES>\n    <JAVADOC>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.12.4/jackson-annotations-2.12.4-javadoc.jar!/\" />\n    </JAVADOC>\n    <SOURCES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-annotations/2.12.4/jackson-annotations-2.12.4-sources.jar!/\" />\n    </SOURCES>\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_12_4.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"Maven: com.fasterxml.jackson.core:jackson-core:2.12.4\">\n    <CLASSES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.12.4/jackson-core-2.12.4.jar!/\" />\n    </CLASSES>\n    <JAVADOC>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.12.4/jackson-core-2.12.4-javadoc.jar!/\" />\n    </JAVADOC>\n    <SOURCES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-core/2.12.4/jackson-core-2.12.4-sources.jar!/\" />\n    </SOURCES>\n  </library>\n</component>"
  },
  {
    "path": ".idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_12_4.xml",
    "content": "<component name=\"libraryTable\">\n  <library name=\"Maven: com.fasterxml.jackson.core:jackson-databind:2.12.4\">\n    <CLASSES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.12.4/jackson-databind-2.12.4.jar!/\" />\n    </CLASSES>\n    <JAVADOC>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.12.4/jackson-databind-2.12.4-javadoc.jar!/\" />\n    </JAVADOC>\n    <SOURCES>\n      <root url=\"jar://$MAVEN_REPOSITORY$/com/fasterxml/jackson/core/jackson-databind/2.12.4/jackson-databind-2.12.4-sources.jar!/\" />\n    </SOURCES>\n  </library>\n</component>"
  },
  {
    "path": ".idea/misc.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"MavenProjectsManager\">\n    <option name=\"originalFiles\">\n      <list>\n        <option value=\"$PROJECT_DIR$/pom.xml\" />\n      </list>\n    </option>\n  </component>\n  <component name=\"ProjectRootManager\" version=\"2\" languageLevel=\"JDK_1_8\" project-jdk-name=\"1.8\" project-jdk-type=\"JavaSDK\" />\n</project>"
  },
  {
    "path": ".idea/modules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"ProjectModuleManager\">\n    <modules>\n      <module fileurl=\"file://$PROJECT_DIR$/FofaCollect.iml\" filepath=\"$PROJECT_DIR$/FofaCollect.iml\" />\n    </modules>\n  </component>\n</project>"
  },
  {
    "path": ".idea/vcs.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project version=\"4\">\n  <component name=\"VcsDirectoryMappings\">\n    <mapping directory=\"$PROJECT_DIR$\" vcs=\"Git\" />\n  </component>\n</project>"
  },
  {
    "path": "FofaCollect.iml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=\"true\" type=\"JAVA_MODULE\" version=\"4\">\n  <component name=\"NewModuleRootManager\" LANGUAGE_LEVEL=\"JDK_1_6\">\n    <output url=\"file://$MODULE_DIR$/target/classes\" />\n    <output-test url=\"file://$MODULE_DIR$/target/test-classes\" />\n    <content url=\"file://$MODULE_DIR$\">\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/java\" isTestSource=\"false\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/main/resources\" type=\"java-resource\" />\n      <sourceFolder url=\"file://$MODULE_DIR$/src/test/java\" isTestSource=\"true\" />\n      <excludeFolder url=\"file://$MODULE_DIR$/target\" />\n    </content>\n    <orderEntry type=\"inheritedJdk\" />\n    <orderEntry type=\"sourceFolder\" forTests=\"false\" />\n    <orderEntry type=\"library\" name=\"Maven: com.fasterxml.jackson.core:jackson-core:2.12.4\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Maven: com.fasterxml.jackson.core:jackson-databind:2.12.4\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Maven: com.fasterxml.jackson.core:jackson-annotations:2.12.4\" level=\"project\" />\n    <orderEntry type=\"library\" name=\"Maven: cn.hutool:hutool-core:5.7.3\" level=\"project\" />\n  </component>\n</module>"
  },
  {
    "path": "META-INF/MANIFEST.MF",
    "content": "Manifest-Version: 1.0\r\nMain-Class: com.suyu.Main\r\n\r\n"
  },
  {
    "path": "README.md",
    "content": "# Fofa-collect\n\n\n### 版本说明\n\n支持jdk8直接运行\n\njdk11因为没有javafx这个依赖需要自己再加上参数\n\n```\njava -Dfile.encoding=\"UTF-8\" --module-path \"C:\\Program Files\\Java\\javafx-sdk-11.0.2\\lib\" --add-modules \"javafx.controls,javafx.fxml,javafx.web\" -jar \"xxx.jar\"\n```\n<br></br>\n### star趋势\n[![Stargazers over time](https://starchart.cc/tangxiaofeng7/Fofa-collect.svg)](https://starchart.cc/tangxiaofeng7/Fofa-collect)\n"
  },
  {
    "path": "pom.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project xmlns=\"http://maven.apache.org/POM/4.0.0\"\n         xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n         xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd\">\n    <modelVersion>4.0.0</modelVersion>\n\n    <groupId>com.suyu</groupId>\n    <artifactId>FofaConllect</artifactId>\n    <version>3.0</version>\n    <packaging>jar</packaging>\n\n    <build>\n        <finalName>FofaCollect</finalName>\n        <plugins>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-jar-plugin</artifactId>\n                <version>3.0.2</version>\n                <configuration>\n                    <outputDirectory>${project.build.directory}</outputDirectory>\n                    <archive>\n                        <manifest>\n                            <addClasspath>true</addClasspath>\n                            <classpathPrefix>libs/</classpathPrefix>\n                            <mainClass>com.suyu.Main</mainClass>\n                        </manifest>\n                    </archive>\n                </configuration>\n            </plugin>\n            <plugin>\n                <groupId>org.apache.maven.plugins</groupId>\n                <artifactId>maven-compiler-plugin</artifactId>\n                <configuration>\n                    <source>6</source>\n                    <target>6</target>\n                </configuration>\n            </plugin>\n        </plugins>\n\n        <resources>\n            <resource>\n                <directory>src/main/java</directory>\n                <includes>\n                    <include>**/*.properties</include>\n                    <include>**/*.fxml</include>\n                    <include>**/*.ini</include>\n                </includes>\n                <filtering>false</filtering>\n            </resource>\n        </resources>\n    </build>\n\n\n    <dependencies>\n        <!-- jackson -->\n        <dependency>\n            <groupId>com.fasterxml.jackson.core</groupId>\n            <artifactId>jackson-core</artifactId>\n            <version>2.12.4</version>\n        </dependency>\n        <dependency>\n            <groupId>com.fasterxml.jackson.core</groupId>\n            <artifactId>jackson-databind</artifactId>\n            <version>2.12.4</version>\n        </dependency>\n        <dependency>\n            <groupId>cn.hutool</groupId>\n            <artifactId>hutool-core</artifactId>\n            <version>5.7.3</version>\n        </dependency>\n    </dependencies>\n\n</project>"
  },
  {
    "path": "src/META-INF/MANIFEST.MF",
    "content": "Manifest-Version: 1.0\r\nMain-Class: com.suyu.Main\r\n\r\n"
  },
  {
    "path": "src/main/java/META-INF/MANIFEST.MF",
    "content": "Manifest-Version: 1.0\r\nMain-Class: com.suyu.Main\r\n\r\n"
  },
  {
    "path": "src/main/java/com/suyu/Main.java",
    "content": "package com.suyu;\n\nimport javafx.application.Application;\nimport javafx.fxml.FXMLLoader;\nimport javafx.scene.Parent;\nimport javafx.scene.Scene;\nimport javafx.stage.Stage;\n\npublic class Main extends Application {\n\n    @Override\n    public void start(Stage primaryStage) throws Exception{\n        Parent root =  FXMLLoader.load(getClass().getClassLoader().getResource(\"com/suyu/views/Main.fxml\"));\n        primaryStage.setTitle(\"FofaCollect by txf\");\n        primaryStage.setScene(new Scene(root));\n        primaryStage.show();\n    }\n\n    public static void main(String[] args) {\n        launch(args);\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/controller/FofaController.java",
    "content": "package com.suyu.controller;\n\nimport com.fasterxml.jackson.core.JsonProcessingException;\n\n\nimport com.suyu.Main;\nimport com.suyu.core.DO.FofaData;\nimport com.suyu.core.client.FofaClient;\nimport com.suyu.utils.FileTools;\nimport com.suyu.utils.Path;\nimport javafx.collections.FXCollections;\nimport javafx.collections.ObservableList;\nimport javafx.event.ActionEvent;\nimport javafx.fxml.FXML;\nimport javafx.fxml.Initializable;\nimport javafx.scene.control.*;\n\nimport java.net.URL;\nimport java.util.ResourceBundle;\n\npublic class FofaController extends Main implements Initializable {\n    @FXML\n    private Button stop_btn;\n    @FXML\n    private TextArea result_text;\n    @FXML\n    private ComboBox<?> page_cbx;\n    @FXML\n    private TextField fofa_q;\n    @FXML\n    private Button search_btn;\n    @FXML\n    private Button clear_btn;\n    @FXML\n    private ProgressBar processbar;\n\n    private MainController main;\n    private GoThread t;\n\n    public FofaController() {\n    }\n\n    public MainController getMain() {\n        return this.main;\n    }\n\n    public void setMain(MainController main) {\n        ObservableList products = FXCollections.observableArrayList((Object[]) new String[]{\"1\", \"99\", \"500\", \"999\", \"9999\"});\n\n        this.page_cbx.setItems(products);\n        this.page_cbx.getSelectionModel().select(2);\n        this.main = main;\n        this.syslog(\"在使用本工具前，请先在配置您的Fofa账号和KEY\");\n    }\n\n\n    public void syslog(String log) {\n        this.result_text.appendText(log + \"\\r\\n\");\n    }\n\n    private void go() throws JsonProcessingException {\n        String pa = Path.getRootPath() + \"fofa.ini\";\n        String pstr = FileTools.readFileAllContent(pa, \"utf-8\");\n        if (pstr.equals(\"\")) {\n            this.syslog(\"提示：在使用本工具前，请先在配置您的Fofa账号和KEY\");\n        }\n        String[] ps = pstr.split(\":\");\n        String email = ps[0];\n        String key = ps[1].replace(\"\\n\", \"\");\n        String q = this.fofa_q.getText();\n        int p = Integer.parseInt(this.page_cbx.getValue().toString());\n        FofaClient client = new FofaClient(email, key);\n        try {\n            System.out.println(client.getUser());\n        } catch (Exception e) {\n            e.printStackTrace();\n        }\n        for (int i = 1; i < p; ++i) {\n            processbar.setProgress((float) i / (float) p);\n            FofaData a = new FofaData();\n            try {\n                a = client.getData(q, i);\n            } catch (Exception ex) {\n                this.syslog(ex.toString());\n            }\n            String b = String.valueOf(a.getResults());\n            String c = b.substring(b.indexOf(\"[\") + 1,b.indexOf(\"]\")).replace(\", \", \"\\n\").replace(\"https://\", \"\").replace(\"http://\", \".\");\n            this.syslog(c);\n        }\n    }\n\n    public void fofa_search(ActionEvent actionEvent) {\n        this.result_text.setText(\"\");\n        (t = new GoThread()).start();\n    }\n\n\n    public void fofa_search_stop(ActionEvent actionEvent) {\n        t.stop();\n        processbar.setProgress(1);\n    }\n\n    public void fofa_clear(ActionEvent actionEvent) {\n        this.result_text.setText(\"\");\n    }\n\n\n    @Override\n    public void initialize(URL location, ResourceBundle resources) {\n\n    }\n\n    class GoThread extends Thread {\n        @Override\n        public void run() {\n            try {\n                go();\n            } catch (JsonProcessingException e) {\n                e.printStackTrace();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/controller/FofaPwdController.java",
    "content": "package com.suyu.controller;\n\nimport com.suyu.utils.*;\nimport javafx.fxml.*;\nimport javafx.scene.control.*;\nimport javafx.event.*;\nimport java.net.*;\nimport java.util.*;\n\npublic class FofaPwdController implements Initializable {\n    @FXML\n    private Button fofa_save;\n    @FXML\n    private TextField key_id;\n    @FXML\n    private TextArea fofa_acc_text;\n    @FXML\n    private TextField mail_account;\n    private MainController main;\n\n//    public void setMain(final MainController main) {\n//        this.main = main;\n//    }\n\n    public void syslog(final String log) {\n        this.fofa_acc_text.appendText(log + \"----\" + Tools.getTimeNow() + \"\\r\\n\");\n    }\n\n    @FXML\n    public void savefofa(final Event e) {\n        final String pc = this.mail_account.getText() + \":\" + this.key_id.getText();\n        FileTools.writeFile(Path.getRootPath() + \"fofa.ini\", pc);\n        this.syslog(\"配置文件修改成功\");\n    }\n\n\n    @Override\n    public void initialize(URL location, ResourceBundle resources) {\n\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/controller/MainController.java",
    "content": "package com.suyu.controller;\n\nimport com.suyu.utils.*;\nimport javafx.event.*;\nimport javafx.stage.*;\nimport javafx.fxml.*;\nimport javafx.scene.control.*;\nimport javafx.scene.*;\nimport java.net.*;\nimport java.util.*;\n\n\npublic class MainController implements Initializable {\n    @FXML\n    private TabPane mainTabPane;\n    @FXML\n    public static TextArea txtlog;\n    @FXML\n    private ToggleButton PortScanStop_btn;\n    @FXML\n    private static TextField Target_port;\n    @FXML\n    private TextArea PortScan_ip;\n    @FXML\n    private ToggleButton PortScanStart_btn;\n    @FXML\n    private ToggleButton PortImport_btn;\n    @FXML\n    private MenuItem close;\n\n    public void syslog(final String log) {\n        MainController.txtlog.appendText(log + \"----\" + Tools.getTimeNow() + \"\\r\\n\");\n    }\n\n    @FXML\n    public void about(final Event e) {\n        try {\n            final DialogPane da = new DialogPane();\n            da.setHeaderText(\"唐小风 \\n Wechat: suyu401\");\n            final Stage stage = new Stage();\n            final Scene sc = new Scene((Parent)da);\n            stage.setScene(sc);\n            stage.initStyle(StageStyle.UTILITY);\n            stage.initModality(Modality.WINDOW_MODAL);\n            stage.setTitle(\"关于我\");\n            stage.setAlwaysOnTop(true);\n            stage.show();\n        }\n        catch (Exception ex) {\n            ex.printStackTrace();\n        }\n    }\n\n    public void openFofacollect(final Event e) {\n        try {\n            final FXMLLoader fxmlLoader = new FXMLLoader();\n            fxmlLoader.setLocation(getClass().getClassLoader().getResource(\"com/suyu/views/FoFa.fxml\"));\n            final Parent root = (Parent)fxmlLoader.load();\n            final FofaController fo = (FofaController)fxmlLoader.getController();\n            fo.setMain(this);\n            final Tab tab = new Tab();\n            tab.setText(\"Fofa查询窗口界面\");\n            tab.setContent((Node)root);\n            this.mainTabPane.getTabs().add((Tab) tab);\n            this.mainTabPane.getSelectionModel().select(tab);\n        }\n        catch (Exception var2) {\n            this.syslog(var2.getMessage());\n        }\n    }\n\n    @FXML\n    private void fofa_pwd(final Event event) {\n        try {\n            final FXMLLoader fxmlLoader = new FXMLLoader();\n            fxmlLoader.setLocation(getClass().getClassLoader().getResource(\"com/suyu/views/fofa_pwd.fxml\"));\n            final Parent root = (Parent)fxmlLoader.load();\n            final Stage stage = new Stage();\n            final Scene sc = new Scene(root);\n            stage.setScene(sc);\n            stage.setAlwaysOnTop(true);\n            stage.show();\n        }\n        catch (Exception var3) {\n            this.syslog(var3.getMessage());\n        }\n    }\n\n\n    @Override\n    public void initialize(URL location, ResourceBundle resources) {\n\n    }\n\n}"
  },
  {
    "path": "src/main/java/com/suyu/core/DO/FofaData.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.DO;\n\nimport java.util.List;\n\n/**\n * Title: FofaData\n * Descrption: this is fofa datas\n * Date:2019-06-08 17:49\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n *\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class FofaData {\n\n    /**\n     * mode\n     */\n    private String mode;\n\n    /**\n     * current page no\n     */\n    private Integer page;\n\n    /**\n     * total size\n     */\n    private Integer size;\n\n    /**\n     * total page\n     */\n    private Integer totalPage;\n\n    /**\n     * query\n     */\n    private String query;\n\n    /**\n     * results\n     */\n    private List<List<String>> results;\n\n    public void setQuery(String query) {\n        this.query = query;\n    }\n\n    public String getQuery() {\n        return query;\n    }\n\n    public void setTotalPage(Integer totalPage) {\n        this.totalPage = totalPage;\n    }\n\n    public Integer getTotalPage() {\n        return totalPage;\n    }\n\n    public String getMode() {\n        return mode;\n    }\n\n    public Integer getPage() {\n        return page;\n    }\n\n    public Integer getSize() {\n        return size;\n    }\n\n    public List<List<String>> getResults() {\n        return results;\n    }\n\n    public void setResults(List<List<String>> results) {\n        this.results = results;\n    }\n\n    public void setMode(String mode) {\n        this.mode = mode;\n    }\n\n    public void setPage(Integer page) {\n        this.page = page;\n    }\n\n    public void setSize(Integer size) {\n        this.size = size;\n    }\n\n    @Override\n    public String toString() {\n        return \"FofaData{\" +\n                \"mode='\" + mode + '\\'' +\n                \", page=\" + page +\n                \", size=\" + size +\n                \", totalPage=\" + totalPage +\n                \", query='\" + query + '\\'' +\n                \", results=\" + results +\n                '}';\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/core/DO/User.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.DO;\n\nimport com.suyu.core.enmus.UserVipLevelEnum;\n\n/**\n * Title: User\n * Descrption: this is User\n * Date:2019-06-07 16:00\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class User {\n    /**\n     * user email\n     */\n    private String email;\n\n    /**\n     * username;\n     */\n    private String userName;\n\n    /**\n     * fcion\n     */\n    private Integer fCoin;\n\n    /**\n     * vip\n     */\n    private Boolean isVip;\n\n    /**\n     * vip level\n     */\n    private UserVipLevelEnum vipLevel;\n\n    /**\n     * is verified\n     */\n    private Boolean isVerified;\n\n    /**\n     * avatar\n     */\n    private String avatar;\n\n    /**\n     * message count\n     */\n    private Integer message;\n\n    /**\n     * fofacli version\n     */\n    private String fofacliVersion;\n\n    /**\n     * fofa server\n     */\n    private Boolean fofaServer;\n\n    /**\n     * User\n     * @param email email\n     * @param userName name\n     * @param fCoin FCoin\n     * @param isVip is vip\n     * @param vipLevel vip level\n     * @param isVerified is verified\n     * @param avatar avatar link\n     * @param message message count\n     * @param fofacliVersion fofacli version\n     * @param fofaServer fofaServer\n     */\n    public User(String email, String userName, Integer fCoin, Boolean isVip, UserVipLevelEnum vipLevel, Boolean isVerified, String avatar, Integer message, String fofacliVersion, Boolean fofaServer) {\n        this.email = email;\n        this.userName = userName;\n        this.fCoin = fCoin;\n        this.isVip = isVip;\n        this.vipLevel = vipLevel;\n        this.isVerified = isVerified;\n        this.avatar = avatar;\n        this.message = message;\n        this.fofacliVersion = fofacliVersion;\n        this.fofaServer = fofaServer;\n    }\n\n    public void setEmail(String email) {\n        this.email = email;\n    }\n\n    public void setUserName(String userName) {\n        this.userName = userName;\n    }\n\n    public void setfCoin(Integer fCoin) {\n        this.fCoin = fCoin;\n    }\n\n    public void setVip(Boolean vip) {\n        isVip = vip;\n    }\n\n    public void setVipLevel(UserVipLevelEnum vipLevel) {\n        this.vipLevel = vipLevel;\n    }\n\n    public void setVerified(Boolean verified) {\n        isVerified = verified;\n    }\n\n    public void setAvatar(String avatar) {\n        this.avatar = avatar;\n    }\n\n    public void setMessage(Integer message) {\n        this.message = message;\n    }\n\n    public void setFofacliVersion(String fofacliVersion) {\n        this.fofacliVersion = fofacliVersion;\n    }\n\n    public void setFofaServer(Boolean fofaServer) {\n        this.fofaServer = fofaServer;\n    }\n\n    public String getEmail() {\n        return email;\n    }\n\n    public String getUserName() {\n        return userName;\n    }\n\n    public Integer getfCoin() {\n        return fCoin;\n    }\n\n    public Boolean getVip() {\n        return isVip;\n    }\n\n    public UserVipLevelEnum getVipLevel() {\n        return vipLevel;\n    }\n\n    public Boolean getVerified() {\n        return isVerified;\n    }\n\n    public String getAvatar() {\n        return avatar;\n    }\n\n    public Integer getMessage() {\n        return message;\n    }\n\n    public String getFofacliVersion() {\n        return fofacliVersion;\n    }\n\n    public Boolean getFofaServer() {\n        return fofaServer;\n    }\n\n    @Override\n    public String toString() {\n        return \"User{\" +\n                \"email='\" + email + '\\'' +\n                \", userName='\" + userName + '\\'' +\n                \", fCoin=\" + fCoin +\n                \", isVip=\" + isVip +\n                \", vipLevel=\" + vipLevel +\n                \", isVerified=\" + isVerified +\n                \", avatar='\" + avatar + '\\'' +\n                \", message=\" + message +\n                \", fofacliVersion='\" + fofacliVersion + '\\'' +\n                \", fofaServer=\" + fofaServer +\n                '}';\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/core/DO/UserLogin.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.DO;\n\n/**\n * Title: UserLogin\n * Descrption: UserLogin DO\n * Date:2019-06-07 16:13\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class UserLogin {\n\n    /**\n     * this is FOFA Pro email\n     */\n    private  String email;\n\n    /**\n     * this is FOFA Pro key\n     */\n    private  String key;\n\n    /**\n     * Constructor\n     * @param email user email\n     * @param key user key\n     */\n    public UserLogin(String email, String key) {\n        this.email = email;\n        this.key = key;\n    }\n\n    public String getEmail() {\n        return email;\n    }\n\n    public String getKey() {\n        return key;\n    }\n\n    public void setEmail(String email) {\n        this.email = email;\n    }\n\n    public void setKey(String key) {\n        this.key = key;\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/core/client/FofaClient.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.client;\n\nimport com.fasterxml.jackson.databind.JsonNode;\nimport com.fasterxml.jackson.databind.ObjectMapper;\nimport com.suyu.core.DO.FofaData;\nimport com.suyu.core.DO.User;\nimport com.suyu.core.DO.UserLogin;\nimport com.suyu.core.enmus.UserVipLevelEnum;\nimport com.suyu.core.exception.FofaException;\nimport com.suyu.core.util.HttpUtils;\nimport java.util.*;\n\nimport static cn.hutool.core.codec.Base64.encode;\nimport static com.suyu.core.constants.FofaClientConsts.*;\nimport static com.suyu.core.constants.FofaFieldsConsts.FIELDS_LIST;\n\n/**\n * Title: FofaClient\n * Descrption: this is FOFA Pro client\n * Date:2019-06-07 14:21\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class FofaClient {\n\n    private String email;\n\n    private String key;\n\n    /**\n     * Constructor\n     * @param email email\n     * @param key key\n     */\n    public FofaClient(String email, String key){\n        this.email = email;\n        this.key = key;\n    }\n\n    /**\n     * Jackson mapper\n     */\n    private ObjectMapper mapper = new ObjectMapper();\n\n    /**\n     * getUserLogin\n     * @return\n     */\n    public UserLogin getUserLogin(){\n        return new UserLogin(email, key);\n    }\n\n    /**\n     * get user info\n     * @return\n     */\n    public User getUser() throws Exception{\n        String loginEmail = this.email;\n        String loginKey = this.key;\n        // get user\n        String url = BASE_URL + GET_USER_INFO_URI;\n        Map<String,Object> map = new HashMap<String, Object>();\n        map.put(\"email\", loginEmail);\n        map.put(\"key\", loginKey);\n        String rsp = HttpUtils.doGet(url, map);\n        JsonNode node = mapper.readTree(rsp);\n        JsonNode errorNode = node.get(\"error\");\n        if(errorNode != null && errorNode.asBoolean()){\n            throw new FofaException(node.get(\"errmsg\").asText());\n        }\n        String email = node.get(\"email\").asText();\n        String userName = node.get(\"username\").asText();\n        Integer fCoin = node.get(\"fcoin\").asInt();\n        Boolean isVip = node.get(\"isvip\").asBoolean();\n        Integer vipLevel = node.get(\"vip_level\").asInt();\n        Boolean isVerified = node.get(\"is_verified\").asBoolean();\n        String avatar = node.get(\"avatar\").asText();\n        Integer message = node.get(\"message\").asInt();\n        String fofacliVersion = node.get(\"fofacli_ver\").asText();\n        Boolean fofaServer = node.get(\"fofacli_ver\").asBoolean();\n        UserVipLevelEnum vipLevelEnum = vipLevel == 1?UserVipLevelEnum.VIP:UserVipLevelEnum.SVIP;\n        User user = new User(email,userName,fCoin,isVip,vipLevelEnum,isVerified,avatar,message,fofacliVersion, fofaServer);\n        return user;\n    }\n\n    /**\n     * get data\n     * <p>\n     *     page default 1\n     *     size default 100\n     *     fields default host\n     *     full default false\n     * </p>\n     * @param q search query(not encode)\n     * @return fofa search result data\n     * @throws Exception search Expection\n     */\n    public FofaData getData(String q) throws Exception {\n        return getData(q, 1,100,\"host\",false);\n    }\n\n    /**\n     * get data\n     * <p>\n     *     size default 100\n     *     fields default host\n     *     full default false\n     * </p>\n     * @param q search query(not encode)\n     * @param page page\n     * @return fofa search result data\n     * @exception Exception search Expection\n     */\n    public FofaData getData(String q,Integer page) throws Exception {\n        return getData(q, page,100,\"host\",false);\n    }\n\n    /**\n     * get data\n     * <p>\n     *     fields default host\n     *     full default false\n     * </p>\n     * @param q search query(not encode)\n     * @param page page\n     * @param size page size\n     * @return fofa search result data\n     * @exception Exception search Expection\n     */\n    public FofaData getData(String q,Integer page,Integer size) throws  Exception{\n        return getData(q, page,size,\"host\",false);\n    }\n\n    /**\n     * get data\n     * <p>\n     *     full default false\n     * </p>\n     * @param q search query(not encode)\n     * @param page page\n     * @param size page size\n     * @param fields fields\n     * @return  fofa search result data\n     * @throws Exception search Expection\n     */\n    public FofaData getData(String q,Integer page,Integer size,String fields)throws Exception{\n        return getData(q,page,size,fields,false);\n    }\n\n    /**\n     * get data\n     * @param q search query(not encode)\n     * @param page page no\n     * @param size page size\n     * @param fields fields\n     * @param full is full\n     * @return fofa search result data\n     */\n   public FofaData getData(String q, Integer page, Integer size, String fields, Boolean full) throws Exception{\n       checkParam(q,size,fields);\n       // check page\n       page = page < 0 ? 1:page;\n       // check full is not null\n       full = full == null ? false:full;\n       String url = BASE_URL+SEARCH_URI;\n       Map<String,Object> map = new HashMap<String, Object>();\n       map.put(\"qbase64\", encode(q));\n       map.put(\"page\", page);\n       map.put(\"size\", size);\n       map.put(\"fields\", fields);\n       map.put(\"full\",full);\n       map.put(\"key\", key);\n       map.put(\"email\", email);\n       String rsp = HttpUtils.doGet(url, map);\n       JsonNode node = mapper.readTree(rsp);\n       JsonNode errorNode = node.get(\"error\");\n       if(errorNode != null && errorNode.asBoolean()){\n           throw new FofaException(node.get(\"errmsg\").asText());\n       }\n       String mode = node.get(\"mode\").asText();\n       String query = node.get(\"query\").asText();\n       Integer rspPage = node.get(\"page\").asInt();\n       Integer totalSize = node.get(\"size\").asInt();\n       String results = node.get(\"results\").toString();\n       Integer totalPage = totalSize%size == 0 ? totalSize/size:totalSize/size + 1;\n       FofaData fofaData = new FofaData();\n       fofaData.setMode(mode);\n       fofaData.setPage(rspPage);\n       fofaData.setSize(totalSize);\n       fofaData.setQuery(query);\n       fofaData.setTotalPage(totalPage);\n       List<List<String>> list = mapper.readValue(results, List.class);\n       fofaData.setResults(list);\n       return fofaData;\n   }\n\n    /**\n     * check param\n     * @param q search query\n     * @param size size\n     * @param fields fields\n     * @throws FofaException\n     */\n   public void checkParam(String q,Integer size, String fields)throws FofaException{\n       // check search query\n       if(q == null || \"\".equals(q)){\n           throw  new FofaException(\"search query cannot be empty\");\n       }\n       // check max size\n       if(size > MAX_SIZE){\n           throw new FofaException(\"max size \"+MAX_SIZE);\n       }\n       // check fields\n       List<String> splitList = Arrays.asList(fields.split(\",\"));\n       splitList = new ArrayList<String>(splitList);\n       splitList.removeAll(FIELDS_LIST);\n       if(splitList.size() > 0){\n           throw new FofaException(splitList+\" not's fields,please delte that\");\n       }\n   }\n}"
  },
  {
    "path": "src/main/java/com/suyu/core/constants/FofaClientConsts.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.constants;\n\n/**\n * Title: FofaClientConsts\n * Descrption: this is Fofo Pro Client Constants\n * Date:2019-06-07 21:56\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n *\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class FofaClientConsts {\n\n    /**\n     * Base FOFA Pro Api\n     */\n//    public  static  final  String BASE_URL = \"https://fofa.so\";\n\n    public  static  final  String BASE_URL = \"https://fofa.info\";\n\n    /**\n     * get user info uri\n     */\n    public static final  String GET_USER_INFO_URI = \"/api/v1/info/my\";\n\n    /**\n     * search uri\n     */\n    public static final String SEARCH_URI = \"/api/v1/search/all\";\n\n    /**\n     * max size\n     */\n    public static final  Integer MAX_SIZE = 10000;\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/core/constants/FofaFieldsConsts.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.constants;\n\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Title: FofaFieldsConsts\n * Descrption: this is FOFA Pro fields Constants\n * Date:2019-06-08 18:53\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n *\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class FofaFieldsConsts {\n\n    /**\n     * FOFA Pro fields list\n     */\n    public static final List<String> FIELDS_LIST = Arrays.asList(new String[]{\"host\",\"title\",\"ip\",\"domain\",\"port\",\"country\",\"province\",\"city\",\"country_name\",\"header\",\"protocol\",\"banner\",\"cert\",\"isp\",\"as_number\",\"as_organization\",\"latitude\",\"longitude\"});\n}"
  },
  {
    "path": "src/main/java/com/suyu/core/constants/UserConsts.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.constants;\n\n/**\n * Title: UserConsts\n * Descrption: this is User Consts\n * Date:2019-06-07 20:36\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n *\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class UserConsts {\n    \n}\n"
  },
  {
    "path": "src/main/java/com/suyu/core/enmus/UserVipLevelEnum.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.enmus;\n\n/**\n * Title: UserVipLevelEnum\n * Descrption: TODO\n * Date:2019-06-07 20:45\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n *\n * @author R4v3zn\n * @version 1.0.0\n */\npublic enum UserVipLevelEnum {\n\n    /**\n     * Senior member, Free member\n     */\n    SVIP(2,\"高级会员\"),VIP(1,\"普通会员\");\n\n    private String levelName;\n\n    private Integer code;\n\n    UserVipLevelEnum(Integer code,String levelName){\n        this.code = code;\n        this.levelName = levelName;\n    }\n\n}"
  },
  {
    "path": "src/main/java/com/suyu/core/exception/FofaException.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.exception;\n\n/**\n * Title: FofaException\n * Descrption: FofaException\n * Date:2019-06-07 16:12\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n *\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class FofaException extends Exception{\n\n    /**\n     * Constructor\n     * @param msg message\n     */\n    public FofaException(String msg){\n        super(msg);\n    }\n}"
  },
  {
    "path": "src/main/java/com/suyu/core/util/HttpUtils.java",
    "content": "/*\n * Copyright (c) 2019. r4v3zn.\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.suyu.core.util;\n\nimport java.io.BufferedReader;\nimport java.io.IOException;\nimport java.io.InputStreamReader;\nimport java.net.*;\nimport java.util.Map;\n\n/**\n * Title: HttpUtils\n * Descrption: HttpUtils\n * Date:2019-06-10 19:10\n * Email:woo0nise@gmail.com\n * Company:www.j2ee.app\n * @author R4v3zn\n * @version 1.0.0\n */\npublic class HttpUtils {\n    /**\n     * private\n     */\n    private HttpUtils(){}\n\n    /**\n     * do get\n     * @param url requests url\n     * @return response info\n     */\n    public static String doGet(String url){\n        return doGet(url,null);\n    }\n\n    /**\n     * do get\n     * @param actionUrl requests url\n     * @param map requests param\n     * @return response info\n     */\n    public static  String doGet(String actionUrl,Map<String,Object> map) {\n        String result = \"\";\n        try {\n            if(map != null && map.size() > 0){\n                actionUrl += \"?\";\n\n                for (String key: map.keySet()) {\n                    actionUrl += key + \"=\"+URLEncoder.encode(map.get(key).toString(), \"UTF-8\")+\"&\";\n                }\n            }\n            URL url = new URL(actionUrl);\n            HttpURLConnection connection = (HttpURLConnection) url.openConnection();\n            connection.setRequestMethod(\"GET\");\n            BufferedReader reader = null;\n            if(HttpURLConnection.HTTP_OK == connection.getResponseCode()){\n                reader = new BufferedReader(new InputStreamReader(connection.getInputStream(), \"utf-8\"));\n            }else{\n                reader = new BufferedReader(new InputStreamReader(connection.getErrorStream(), \"utf-8\"));\n            }\n            String s = \"\";\n            String temp = \"\";\n            while ((temp = reader.readLine()) != null) {\n                s += temp;\n            }\n            result = s;\n            reader.close();\n        } catch (ProtocolException e) {\n            e.printStackTrace();\n        } catch (MalformedURLException e) {\n            e.printStackTrace();\n        } catch (IOException e) {\n            e.printStackTrace();\n        }\n        return result;\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/utils/FileTools.java",
    "content": "package com.suyu.utils;\n\nimport java.io.*;\n\npublic class FileTools\n{\n    public static byte[] getBytesByFile(final String filePath) throws IOException {\n        final InputStream in = new FileInputStream(filePath);\n        final byte[] data = toByteArray(in);\n        in.close();\n        return data;\n    }\n    \n    public static byte[] toByteArray(final InputStream in) throws IOException {\n        final ByteArrayOutputStream out = new ByteArrayOutputStream();\n        final byte[] buffer = new byte[4096];\n        final boolean var3 = false;\n        int n;\n        while ((n = in.read(buffer)) != -1) {\n            out.write(buffer, 0, n);\n        }\n        return out.toByteArray();\n    }\n    \n    public static byte[] readToBytes(final String path) throws IOException {\n        final ByteArrayOutputStream bos = new ByteArrayOutputStream();\n        final File ff = new File(path);\n        final FileInputStream fs = new FileInputStream(ff);\n        final byte[] temp = new byte[4096];\n        final boolean var5 = false;\n        int len;\n        while ((len = fs.read(temp)) != -1) {\n            bos.write(temp, 0, len);\n        }\n        fs.close();\n        final byte[] data = bos.toByteArray();\n        bos.close();\n        return data;\n    }\n    \n    public static String readFileToString(final String path) throws IOException {\n        final byte[] data = readToBytes(path);\n        final String str = new String(data, \"UTF-8\");\n        return str;\n    }\n    \n    public static void writeFile(final String filePath, final String content) {\n        try {\n            final OutputStreamWriter write = new OutputStreamWriter(new FileOutputStream(filePath), \"utf-8\");\n            final BufferedWriter writer = new BufferedWriter(write);\n            writer.write(content);\n            writer.close();\n        }\n        catch (IOException var4) {\n            var4.printStackTrace();\n        }\n    }\n    \n    public static String readOneLineTxtFile(final String filePath) {\n        try {\n            final String encoding = \"utf-8\";\n            final File file = new File(filePath);\n            if (file.isFile() && file.exists()) {\n                final InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding);\n                final BufferedReader bufferedReader = new BufferedReader(read);\n                final String lineTxt = bufferedReader.readLine();\n                bufferedReader.close();\n                read.close();\n            }\n            else {\n                System.out.println(\"\\u627e\\u4e0d\\u5230\\u6307\\u5b9a\\u7684\\u6587\\u4ef6,\\u67e5\\u770b\\u6b64\\u8def\\u5f84\\u662f\\u5426\\u6b63\\u786e:\" + filePath);\n            }\n        }\n        catch (Exception var6) {\n            System.out.println(\"\\u8bfb\\u53d6\\u6587\\u4ef6\\u5185\\u5bb9\\u51fa\\u9519\");\n        }\n        return \"\";\n    }\n    \n    public static String readFileAllContent(final String filePath, final String encoding) {\n        final StringBuffer fileContent = new StringBuffer();\n        try {\n            final File file = new File(filePath);\n            if (file.isFile() && file.exists()) {\n                final InputStreamReader read = new InputStreamReader(new FileInputStream(file), encoding);\n                final BufferedReader bufferedReader = new BufferedReader(read);\n                String lineTxt = null;\n                while ((lineTxt = bufferedReader.readLine()) != null) {\n                    fileContent.append(lineTxt);\n                    fileContent.append(\"\\n\");\n                }\n                read.close();\n            }\n            else {\n                System.out.println(\"\\u627e\\u4e0d\\u5230\\u6307\\u5b9a\\u7684\\u6587\\u4ef6,\\u67e5\\u770b\\u6b64\\u8def\\u5f84\\u662f\\u5426\\u6b63\\u786e:\" + filePath);\n            }\n        }\n        catch (Exception var7) {\n            System.out.println(\"\\u8bfb\\u53d6\\u6587\\u4ef6\\u5185\\u5bb9\\u51fa\\u9519\");\n        }\n        return fileContent.toString();\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/utils/Path.java",
    "content": "package com.suyu.utils;\n\nimport java.net.*;\nimport java.io.*;\n\npublic class Path\n{\n    public static String getRootPath() {\n        final URL url = Path.class.getProtectionDomain().getCodeSource().getLocation();\n        String filePath = \"\";\n        try {\n            filePath = URLDecoder.decode(url.getPath(), \"UTF-8\");\n        }\n        catch (Exception ex) {}\n        filePath = filePath.replace(\"\\\\\", \"/\").replace(\"//\", \"/\");\n        if (filePath.contains(\":/\") && filePath.startsWith(\"/\")) {\n            filePath = filePath.substring(1);\n        }\n        if (filePath.endsWith(\".jar\")) {\n            filePath = filePath.substring(0, filePath.lastIndexOf(\"/\") + 1);\n        }\n        return filePath;\n    }\n    \n    public static String getClassResources() {\n        String cpath = new Object() {\n            public String getPath() {\n                return this.getClass().getResource(\"\").getPath();\n            }\n        }.getPath();\n        cpath = URLDecoder.decode(cpath.replaceAll(\"file:/\", \"\"));\n        if (cpath.indexOf(\":\") != 1) {\n            cpath = File.separator + cpath;\n        }\n        return cpath;\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/utils/Tools.java",
    "content": "package com.suyu.utils;\n\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\n\npublic class Tools\n{\n    public static String date2Str(final Date date, final String format) {\n        if (date != null) {\n            final SimpleDateFormat sdf = new SimpleDateFormat(format);\n            return sdf.format(date);\n        }\n        return \"\";\n    }\n    \n    public static String getTimeNow() {\n        return date2Str(new Date(), \"yyyy-MM-dd HH:mm:ss\");\n    }\n}\n"
  },
  {
    "path": "src/main/java/com/suyu/views/FoFa.fxml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<?import javafx.geometry.*?>\n<?import java.lang.*?>\n<?import java.util.*?>\n<?import javafx.scene.*?>\n<?import javafx.scene.control.*?>\n<?import javafx.scene.layout.*?>\n\n<BorderPane maxHeight=\"-Infinity\" maxWidth=\"-Infinity\" minHeight=\"-Infinity\" minWidth=\"-Infinity\" prefHeight=\"746.0\" prefWidth=\"940.0\" xmlns=\"http://javafx.com/javafx/8\" xmlns:fx=\"http://javafx.com/fxml/1\" fx:controller=\"com.suyu.controller.FofaController\">\n    <bottom>\n        <AnchorPane prefHeight=\"641.0\" prefWidth=\"795.0\" BorderPane.alignment=\"CENTER\">\n            <children>\n                <TextArea fx:id=\"result_text\" layoutX=\"11.0\" layoutY=\"-8.0\" prefHeight=\"629.0\" prefWidth=\"918.0\" AnchorPane.bottomAnchor=\"20.0\" AnchorPane.leftAnchor=\"11.0\" AnchorPane.rightAnchor=\"11.0\" AnchorPane.topAnchor=\"-8.0\" />\n            </children>\n        </AnchorPane>\n    </bottom>\n    <center>\n        <AnchorPane prefHeight=\"74.0\" prefWidth=\"940.0\" BorderPane.alignment=\"CENTER\">\n            <children>\n                <Label layoutX=\"14.0\" layoutY=\"14.0\" prefHeight=\"38.0\" prefWidth=\"79.0\" text=\"查询条件 :\" />\n                <TextField fx:id=\"fofa_q\" layoutX=\"115.0\" layoutY=\"20.0\" prefHeight=\"27.0\" prefWidth=\"398.0\" promptText=\"app=&quot;Solr&quot;\" />\n                <Label layoutX=\"542.0\" layoutY=\"14.0\" prefHeight=\"38.0\" prefWidth=\"79.0\" text=\"页 数 ：\" />\n                <ComboBox fx:id=\"page_cbx\" layoutX=\"602.0\" layoutY=\"20.0\" prefHeight=\"27.0\" prefWidth=\"90.0\" />\n                <Button fx:id=\"search_btn\" layoutX=\"730.0\" layoutY=\"21.0\" mnemonicParsing=\"false\" onAction=\"#fofa_search\" text=\"search\" />\n                <Button fx:id=\"clear_btn\" layoutX=\"866.0\" layoutY=\"20.0\" mnemonicParsing=\"false\" onAction=\"#fofa_clear\" text=\" claer\" />\n                <Button fx:id=\"stop_btn\" layoutX=\"799.0\" layoutY=\"21.0\" mnemonicParsing=\"false\" onAction=\"#fofa_search_stop\" text=\"  stop  \" />\n            <ProgressBar fx:id=\"processbar\" layoutX=\"115.0\" layoutY=\"65.0\" prefHeight=\"20.0\" prefWidth=\"811.0\" progress=\"0.0\" />\n            <Label layoutX=\"14.0\" layoutY=\"56.0\" prefHeight=\"38.0\" prefWidth=\"79.0\" text=\"进度条：\" />\n            </children>\n        </AnchorPane>\n    </center>\n</BorderPane>\n"
  },
  {
    "path": "src/main/java/com/suyu/views/Main.fxml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<?import javafx.scene.*?>\n<?import javafx.scene.text.*?>\n<?import javafx.scene.control.*?>\n<?import java.lang.*?>\n<?import javafx.scene.layout.*?>\n<?import javafx.geometry.Insets?>\n<?import javafx.scene.layout.GridPane?>\n<?import javafx.scene.control.Button?>\n<?import javafx.scene.control.Label?>\n\n<BorderPane maxHeight=\"-Infinity\" maxWidth=\"-Infinity\" minHeight=\"-Infinity\" minWidth=\"-Infinity\" prefHeight=\"799.0\" prefWidth=\"952.0\" xmlns=\"http://javafx.com/javafx/8\" xmlns:fx=\"http://javafx.com/fxml/1\" fx:controller=\"com.suyu.controller.MainController\">\n    <top>\n        <MenuBar BorderPane.alignment=\"CENTER\">\n            <menus>\n                <Menu mnemonicParsing=\"false\" text=\"设 置\">\n                    <items>\n                        <MenuItem mnemonicParsing=\"false\" onAction=\"#fofa_pwd\" text=\"fofa账号配置\" />\n                    </items>\n                </Menu>\n                <Menu mnemonicParsing=\"false\" text=\"关 于\">\n                    <items>\n                        <MenuItem fx:id=\"about\" mnemonicParsing=\"false\" onAction=\"#about\" text=\"About\" />\n                    </items>\n                </Menu>\n            </menus>\n        </MenuBar>\n    </top>\n    <center>\n        <TabPane fx:id=\"mainTabPane\" prefHeight=\"751.0\" prefWidth=\"915.0\" tabClosingPolicy=\"UNAVAILABLE\" BorderPane.alignment=\"CENTER\">\n            <tabs>\n                <Tab text=\"功 能 列 表\">\n                    <content>\n                        <BorderPane prefHeight=\"718.0\" prefWidth=\"832.0\">\n                     <top>\n                        <ToolBar prefHeight=\"40.0\" prefWidth=\"200.0\" BorderPane.alignment=\"CENTER\">\n                          <items>\n                            <Button onMouseClicked=\"#openFofacollect\" text=\"Fofa采集\" />\n                          </items>\n                        </ToolBar>\n                     </top>\n                     <center>\n                        <TextArea prefHeight=\"200.0\" prefWidth=\"200.0\" promptText=\"第一次使用Fofa采集，请先配置您的邮箱和KEY\" BorderPane.alignment=\"CENTER\">\n                           <font>\n                              <Font size=\"41.0\" />\n                           </font>\n                        </TextArea>\n                     </center>\n                        </BorderPane>\n                    </content>\n                </Tab>\n            </tabs>\n        </TabPane>\n    </center>\n</BorderPane>\n"
  },
  {
    "path": "src/main/java/com/suyu/views/fofa_pwd.fxml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\n<?import javafx.scene.control.*?>\n<?import java.lang.*?>\n<?import javafx.scene.layout.*?>\n\n<BorderPane prefHeight=\"100.0\" prefWidth=\"755.0\" xmlns=\"http://javafx.com/javafx/8\" xmlns:fx=\"http://javafx.com/fxml/1\" fx:controller=\"com.suyu.controller.FofaPwdController\">\n    <top>\n        <Pane prefHeight=\"46.0\" prefWidth=\"600.0\" BorderPane.alignment=\"CENTER\">\n            <children>\n                <Button fx:id=\"fofa_save\" layoutX=\"680.0\" layoutY=\"10.0\" mnemonicParsing=\"false\" onAction=\"#savefofa\" prefHeight=\"23.0\" prefWidth=\"61.0\" text=\"保 存\" />\n                <TextField fx:id=\"mail_account\" layoutX=\"73.0\" layoutY=\"12.0\" prefHeight=\"23.0\" prefWidth=\"224.0\" />\n                <TextField fx:id=\"key_id\" layoutX=\"339.0\" layoutY=\"11.0\" prefHeight=\"27.0\" prefWidth=\"327.0\" />\n                <Label layoutX=\"21.0\" layoutY=\"16.0\" text=\"mail：\" />\n                <Label layoutX=\"297.0\" layoutY=\"16.0\" text=\" key：\" />\n            </children>\n        </Pane>\n    </top>\n    <center>\n        <TextArea fx:id=\"fofa_acc_text\" prefHeight=\"352.0\" prefWidth=\"755.0\" />\n    </center>\n</BorderPane>\n"
  }
]