读取/data/data/下文件或者数据库

学习目标:

学习目标:读取/data/data/下文件或者数据库,Android 11读写权限动态申请


前言

当开发一款新的app时需要另一款app数据相互依赖就需要去读数据但Android 11 上面变成了特殊权限需要


一、特殊权限是什么?

首先 Android 的权限大致分为三种:
1.普通权限:只需要在清单文件中注册即可
2.危险权限:需要在代码中动态申请,以弹系统 Dialog 的形式进行请求
3.特殊权限:需要在代码中动态申请,以跳系统 Activity 的形式进行请求
在 Android 6.0 之后就变成了危险权限,而到了 Android 11 上面变成了特殊权限,而最明显的区别是一个是通过 Dialog 展示给用户看,另外一个是通过 Activity 展现给用户看。

二、读取步骤

1.动静结合

静 代码如下(示例):

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
    在AndroidManifest.xml文件中application节点中加上android:requestLegacyExternalStorage="true"属性
    就可以了,如下:
   <application
    android:requestLegacyExternalStorage="true"
    

    

动 代码如下(示例):

private fun requestPermission() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
            // 先判断有没有权限
            if (Environment.isExternalStorageManager()) {
                writeFile()

            } else {
                startActivityForResult(
                    Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION),
                    REQUEST_CODE
                )
            }
        } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            // 先判断有没有权限
            if (ActivityCompat.checkSelfPermission(
                    this,
                    Manifest.permission.READ_EXTERNAL_STORAGE
                ) == PackageManager.PERMISSION_GRANTED &&
                ContextCompat.checkSelfPermission(
                    this,
                    Manifest.permission.WRITE_EXTERNAL_STORAGE
                ) == PackageManager.PERMISSION_GRANTED
            ) {

                writeFile()
            } else {
                ActivityCompat.requestPermissions(
                    this,
                    arrayOf(
                        Manifest.permission.READ_EXTERNAL_STORAGE,
                        Manifest.permission.WRITE_EXTERNAL_STORAGE
                    ),
                    REQUEST_CODE
                )
            }
        } else {
            writeFile()
        }
    }
   /**
     * In this method, you can write the business logic related to reading and writing
     */
 private fun writeFile() {
 ......
 }   
 

2.读入数据

数据权限已经申请了原本以为万事俱备只欠东风了可惜…读取的是另一个app的/data/data/这些显然不够,当然如果那么容易咱们的手机信息安全是个大问题呢 。当咱们是开发者只要咱们出发点是正义的为全人类制造福利的,正义无敌嘛哈哈。这个时候我想到了雷震子拿起了家伙事一顿操作猛似虎
1.下载模拟器
.在这里插入图片描述
2.开启root权限在这里插入图片描述
3.我们不能直接访问/data/data/下路径怎么搞呢?既然不能直接搞那我们间接的搞吧,打开命令框输入adb shell ,mkdir test 新建文件,cat /data/data/com.whatsapp/shared_prefs/keystore.xml > /sdcard/test/keystore.xml 复制 文件到指定文件对啊我们可以复制到可以访问的目录下载访问啊。可是咱们的这些都需要代码执行怎么搞呢…妈的坑真多哈哈其实这才是开始。咱们有root权限这玩意相当于你有上帝视角这他妈可不是开玩笑的,可以直接代码执行shell命令。shell的运行原理(shell是什么)Linux严格意义上是一个操作系统,我们称为核心,但我们一般的用户是不能直接使用核心的,而是通过外壳程序。也就是shell,对比Windows,图形界面就是外壳程序。shell的简单定义就是命令行解释器,功能是将使用者的命令翻译给核心处理,同时将核心处理的结果翻译给使用者。可以看出shell主要是对我们的指令进行解析,解析指令给Linux内核。反馈结果在通过内核运行出结果,通过shell解析给用户。
在这里插入图片描述
这是我们就可以理解为什么说外壳程序包裹着我们的操作系统,外壳程序仅仅对我们的指令进行解析,解析指令给Linux内核。反馈结果在通过内核运行出结果,通过shell解析给用户。

    下面我们来接着了解shell。shell在解释命令的时候并不是自己亲自执行,而是派生子进程让子进程去完成这项工作,这样的好处是把风险交给别人,当指令的执行出现问题时不会影响到shell(影响到其他指令的执行)。shell不可以挂,shell 一旦挂就没有什么可以解释命令了。对我们而言shell为了保证自己风险最低,通过创建子进程进行命令行的解释工作。而shell自己只要去等就可以了。

     可到底什么是shell呢?shell 是一个外壳程序统称,如Windows的图形界面(GUI),Linux下我们使用的bash就是具体的一种shell。 .

在这里插入图片描述
举个例子:shell是媒婆,那么bash就是王婆。shell是外壳程序的统称,bash 是具体的一种shell。
以上就是我们对shell初步的理解。

执行shell命令需要的工具类 代码如下(示例):

public final class ShellUtils {

    private static final String LINE_SEP = System.getProperty("line.separator");

    private ShellUtils() {
        throw new UnsupportedOperationException("u can't instantiate me...");
    }

    /**
     * Execute the command asynchronously.
     *
     * @param command  The command.
     * @param isRooted True to use root, false otherwise.
     * @param consumer The consumer.
     * @return the task
     */
    public static Utils.Task<CommandResult> execCmdAsync(final String command,
                                                         final boolean isRooted,
                                                         final Utils.Consumer<CommandResult> consumer) {
        return execCmdAsync(new String[]{command}, isRooted, true, consumer);
    }

    /**
     * Execute the command asynchronously.
     *
     * @param commands The commands.
     * @param isRooted True to use root, false otherwise.
     * @param consumer The consumer.
     * @return the task
     */
    public static Utils.Task<CommandResult> execCmdAsync(final List<String> commands,
                                                         final boolean isRooted,
                                                         final Utils.Consumer<CommandResult> consumer) {
        return execCmdAsync(commands == null ? null : commands.toArray(new String[]{}), isRooted, true, consumer);
    }

    /**
     * Execute the command asynchronously.
     *
     * @param commands The commands.
     * @param isRooted True to use root, false otherwise.
     * @param consumer The consumer.
     * @return the task
     */
    public static Utils.Task<CommandResult> execCmdAsync(final String[] commands,
                                                         final boolean isRooted,
                                                         final Utils.Consumer<CommandResult> consumer) {
        return execCmdAsync(commands, isRooted, true, consumer);
    }

    /**
     * Execute the command asynchronously.
     *
     * @param command         The command.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @param consumer        The consumer.
     * @return the task
     */
    public static Utils.Task<CommandResult> execCmdAsync(final String command,
                                                         final boolean isRooted,
                                                         final boolean isNeedResultMsg,
                                                         final Utils.Consumer<CommandResult> consumer) {
        return execCmdAsync(new String[]{command}, isRooted, isNeedResultMsg, consumer);
    }

    /**
     * Execute the command asynchronously.
     *
     * @param commands        The commands.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @param consumer        The consumer.
     * @return the task
     */
    public static Utils.Task<CommandResult> execCmdAsync(final List<String> commands,
                                                         final boolean isRooted,
                                                         final boolean isNeedResultMsg,
                                                         final Utils.Consumer<CommandResult> consumer) {
        return execCmdAsync(commands == null ? null : commands.toArray(new String[]{}),
                isRooted,
                isNeedResultMsg,
                consumer);
    }

    /**
     * Execute the command asynchronously.
     *
     * @param commands        The commands.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @param consumer        The consumer.
     * @return the task
     */
    public static Utils.Task<CommandResult> execCmdAsync(final String[] commands,
                                                         final boolean isRooted,
                                                         final boolean isNeedResultMsg,
                                                         @NonNull final Utils.Consumer<CommandResult> consumer) {
        return UtilsBridge.doAsync(new Utils.Task<CommandResult>(consumer) {
            @Override
            public CommandResult doInBackground() {
                return execCmd(commands, isRooted, isNeedResultMsg);
            }
        });
    }

    /**
     * Execute the command.
     *
     * @param command  The command.
     * @param isRooted True to use root, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String command, final boolean isRooted) {
        return execCmd(new String[]{command}, isRooted, true);
    }

    /**
     * Execute the command.
     *
     * @param command  The command.
     * @param envp     The environment variable settings.
     * @param isRooted True to use root, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String command, final List<String> envp, final boolean isRooted) {
        return execCmd(new String[]{command},
                envp == null ? null : envp.toArray(new String[]{}),
                isRooted,
                true);
    }

    /**
     * Execute the command.
     *
     * @param commands The commands.
     * @param isRooted True to use root, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final List<String> commands, final boolean isRooted) {
        return execCmd(commands == null ? null : commands.toArray(new String[]{}), isRooted, true);
    }

    /**
     * Execute the command.
     *
     * @param commands The commands.
     * @param envp     The environment variable settings.
     * @param isRooted True to use root, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final List<String> commands,
                                        final List<String> envp,
                                        final boolean isRooted) {
        return execCmd(commands == null ? null : commands.toArray(new String[]{}),
                envp == null ? null : envp.toArray(new String[]{}),
                isRooted,
                true);
    }

    /**
     * Execute the command.
     *
     * @param commands The commands.
     * @param isRooted True to use root, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String[] commands, final boolean isRooted) {
        return execCmd(commands, isRooted, true);
    }

    /**
     * Execute the command.
     *
     * @param command         The command.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String command,
                                        final boolean isRooted,
                                        final boolean isNeedResultMsg) {
        return execCmd(new String[]{command}, isRooted, isNeedResultMsg);
    }

    /**
     * Execute the command.
     *
     * @param command         The command.
     * @param envp            The environment variable settings.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String command,
                                        final List<String> envp,
                                        final boolean isRooted,
                                        final boolean isNeedResultMsg) {
        return execCmd(new String[]{command}, envp == null ? null : envp.toArray(new String[]{}),
                isRooted,
                isNeedResultMsg);
    }

    /**
     * Execute the command.
     *
     * @param command         The command.
     * @param envp            The environment variable settings array.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String command,
                                        final String[] envp,
                                        final boolean isRooted,
                                        final boolean isNeedResultMsg) {
        return execCmd(new String[]{command}, envp, isRooted, isNeedResultMsg);
    }

    /**
     * Execute the command.
     *
     * @param commands        The commands.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final List<String> commands,
                                        final boolean isRooted,
                                        final boolean isNeedResultMsg) {
        return execCmd(commands == null ? null : commands.toArray(new String[]{}),
                isRooted,
                isNeedResultMsg);
    }

    /**
     * Execute the command.
     *
     * @param commands        The commands.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String[] commands,
                                        final boolean isRooted,
                                        final boolean isNeedResultMsg) {
        return execCmd(commands, null, isRooted, isNeedResultMsg);
    }

    /**
     * Execute the command.
     *
     * @param commands        The commands.
     * @param envp            Array of strings, each element of which
     *                        has environment variable settings in the format
     *                        <i>name</i>=<i>value</i>, or
     *                        <tt>null</tt> if the subprocess should inherit
     *                        the environment of the current process.
     * @param isRooted        True to use root, false otherwise.
     * @param isNeedResultMsg True to return the message of result, false otherwise.
     * @return the single {@link CommandResult} instance
     */
    public static CommandResult execCmd(final String[] commands,
                                        final String[] envp,
                                        final boolean isRooted,
                                        final boolean isNeedResultMsg) {
        int result = -1;
        if (commands == null || commands.length == 0) {
            return new CommandResult(result, "", "");
        }
        Process process = null;
        BufferedReader successResult = null;
        BufferedReader errorResult = null;
        StringBuilder successMsg = null;
        StringBuilder errorMsg = null;
        DataOutputStream os = null;
        try {
            process = Runtime.getRuntime().exec(isRooted ? "su" : "sh", envp, null);
            os = new DataOutputStream(process.getOutputStream());
            for (String command : commands) {
                if (command == null) continue;
                os.write(command.getBytes());
                os.writeBytes(LINE_SEP);
                os.flush();
            }
            os.writeBytes("exit" + LINE_SEP);
            os.flush();
            result = process.waitFor();
            if (isNeedResultMsg) {
                successMsg = new StringBuilder();
                errorMsg = new StringBuilder();
                successResult = new BufferedReader(
                        new InputStreamReader(process.getInputStream(), "UTF-8")
                );
                errorResult = new BufferedReader(
                        new InputStreamReader(process.getErrorStream(), "UTF-8")
                );
                String line;
                if ((line = successResult.readLine()) != null) {
                    successMsg.append(line);
                    while ((line = successResult.readLine()) != null) {
                        successMsg.append(LINE_SEP).append(line);
                    }
                }
                if ((line = errorResult.readLine()) != null) {
                    errorMsg.append(line);
                    while ((line = errorResult.readLine()) != null) {
                        errorMsg.append(LINE_SEP).append(line);
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                if (os != null) {
                    os.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                if (successResult != null) {
                    successResult.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                if (errorResult != null) {
                    errorResult.close();
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (process != null) {
                process.destroy();
            }
        }
        return new CommandResult(
                result,
                successMsg == null ? "" : successMsg.toString(),
                errorMsg == null ? "" : errorMsg.toString()
        );
    }

    /**
     * The result of command.
     */
    public static class CommandResult {
        public int    result;
        public String successMsg;
        public String errorMsg;

        public CommandResult(final int result, final String successMsg, final String errorMsg) {
            this.result = result;
            this.successMsg = successMsg;
            this.errorMsg = errorMsg;
        }

        @Override
        public String toString() {
            return "result: " + result + "\n" +
                    "successMsg: " + successMsg + "\n" +
                    "errorMsg: " + errorMsg;
        }
    }
}

/*
* 调用execCmd里面两个参数一个是shell命令,第二个是是否开启root返回的是return execCmd(new String[]{command}, isRooted, true)下面有调用实例successMsg
*/
  val execCmd = ShellUtils.execCmd("写shell命令", true)
                    LogUtil.logGGQ("task", "输出结果-->${execCmd.successMsg}")
                    LogUtil.logGGQ("task", "输出结果-->${execCmd.errorMsg}")
                    LogUtil.logGGQ("task", "输出结果-->${execCmd.result}")    
 导入库                                   
implementation 'com.blankj:utilcodex:1.30.6'
访问拷贝后的文件地址
val readFile2String = FileIOUtils.readFile2String("sdcard/android/axolotl.db")
        LogUtil.logGGQ("task", "stringToBase64----->$readFile2String")
插入一个小知识点把String的转换成base64码
 /**
     * 把String的转换成base64码
     */
    public static String stringToBase64(String ss) {
        String encode="";
        try{
            byte[] bytes = ss.getBytes();
             encode = Base64Util.encode(bytes);
//            return encode;
        }catch (Exception e){
           LogUtil.logGGQ("task",e.getMessage());
        }

        return encode;
    }
val stringToBase64 = Base64Object.stringToBase64(readFile2String)
        LogUtil.logGGQ("task", "stringToBase64----->$stringToBase64")
        放文件到这就结束了

数据库文件查看

复制和上面一样代码执行shell

/*
*数据库打开文件路径
*/

 val database: SQLiteDatabase = SQLiteDatabase.openOrCreateDatabase(
            "sdcard/android/axolotl.db", null
        )



  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
WPViewPDF is a powerful pdf viewer control which allows you to view and print PDF data. The data can be loaded from memory, file or stream. As "PLUS" edition it can be used to merge PDF files into a new, single file. You can extract PDF pages or delete pages. It is also possible to add vector and text graphic to PDF files (stamping). Unlike many competing products WPViewPDF displays even large PDF files instantly. This component has been developed as a window class which makes it compatible to most Windows based development systems. Out of the box it can be used as ActiveX (OCX), in .NET development environments (i.e. Visual Studio 2010) and as VCL in Delphi and C++Builder. You can download a demo which includes the component as .NET, Delphi and ActiveX component and a small example application. The source for the components (C# and Pascal) is included as well. It also includes an executable demo. The new Version 3 is the result of extensive work. We completely re-thought the logic which is require to load, render and manipulate PDF data to create this new version. It makes use of clever and effective caching for quick response times. It also makes use of multithreading for better user interaction. We revised the PrintHDC method - printing to any windows device should be now much easier to do than before and produce higher quality. The multithreaded scrolling viewer can change quickly change between zoom states and various layout modes, including multi column display and side by side page layout. It can also display a separate thumbnail view to the PDF. Unlike version 1 and 2 the new version 3 uses floating point numbers for graphic output which offers better print results for many PDF files. Despite the higher text rendering quality, printing will be faster since less data has to be transferred to the printer. Version 3 PLUS introduce a new stamping method which also it to place objects or highlighting rectangles on the page. This objects can be moved and sized by the user. But we also implemented the scripted stamping because it makes it so easy to add titles or page numbers to a range of pages. You can modify the existing bookmarks by loading the structure as XML. It is also possible to extract the current bookmarks as XML. Text extraction now also creates text in rich text format (RTF) - here the logic tries to make use of PDF tags to keep text together which belongs together. The field support has been enhanced for better compatibility with existing PDF files. We work to add the ability to create new fields to the "PLUS" Edition. Supports 32 bit and also 64 bit applications!
CurrPorts v2.10 Copyright (c) 2004 - 2013 Nir Sofer Web site: http://www.nirsoft.net Description =========== CurrPorts displays the list of all currently opened TCP/IP and UDP ports on your local computer. For each port in the list, information about the process that opened the port is also displayed, including the process name, full path of the process, version information of the process (product name, file description, and so on), the time that the process was created, and the user that created it. In addition, CurrPorts allows you to close unwanted TCP connections, kill the process that opened the ports, and save the TCP/UDP ports information to HTML file , XML file, or to tab-delimited text file. CurrPorts also automatically mark with pink color suspicious TCP/UDP ports owned by unidentified applications (Applications without version information and icons) Versions History ================ * Version 2.10: o When saving the opened ports from command-line, CurrPorts now uses the same columns order saved in the .cfg file. * Version 2.09: o Fixed bug from version 2.08: Some filters stopped working... * Version 2.08: o Added support for filtering by process ID (In Advanced Filters window), for example: include:process:327 * Version 2.07: o Fixed the flickering on automatic refresh. * Version 2.06: o Fixed issue: The properties dialog-box and other windows opened in the wrong monitor, on multi-monitors system. * Version 2.05: o Added support for GeoLite City database. You can now download the GeoLite City database (GeoLiteCity.dat.gz), put it in the same folder of cports.exe, and CurrPorts will automatically use it to get the country/city information for every remote IP address. * Version 2.02: o CurrPorts now displays a simple error message if it fails to close one or more TCP connections. * Version 2.01: o The 'Remote Address' and 'Local Address' columns are now sorted by the IP address numerically. (In previous versions they were sorted alphabetically) * Version 2.00: o Added optional fifth parameter to the /close command-line option, which allows you to specify a process name (e.g: firefox.exe) * Version 1.97: o The 'Use DNS Cache For Host Names' option is now turned off by default, because it seems that reading the DNS cache causes a memory leak on some Windows 7/x64 systems. * Version 1.96: o Fixed bug: CurrPorts randomly failed to display remote port numbers of IPv6 connections. * Version 1.95: o Added 'Use DNS Cache For Host Names' option. When it's turned on, CurrPorts uses the DNS cache of Windows to resolve remote IP addresses. * Version 1.94: o Added 'Custom' AutoRefresh option under Options -> Auto Refresh. The number of seconds for the Custom AutoRefresh can be set in the Advanced Options window (Ctrl+O) o Fixed the problem with sending the data to stdout (when the filename is empty string). * Version 1.93: o Updated the internal country names (added more 14 countries) that are used for displaying the country name in the 'Remote IP Country' column. * Version 1.92: o When choosing 'Clear Log File' option, CurrPorts now asks you whether you want to clear the log, in order to avoid from clearing the log file by mistake. * Version 1.91: o Added 'Beep On New Ports' option. * Version 1.90: o Added 'Tray Balloon On New Ports' option. When both this option and 'Put Icon On Tray' option are turned on, every new port detected by CurrPorts will be displayed in a tray balloon. (If the TCP/UDP port is filtered by the other CurrPorts options and it's not displayed in the main window, it won't be displayed in the tray balloon.) * Version 1.87: o Improved the 'User Name' column. If you run CurrPorts as administrator, this column will display the user name for all processes. (In previous versions, CurrPorts failed to detect processes created by other users, even when you run it as Administrator) * Version 1.86: o Added 'Mark Odd/Even Rows' option, under the View menu. When it's turned on, the odd and even rows are displayed in different color, to make it easier to read a single line. * Version 1.85: o Added command-line options to control the settings under the Options and View menus: /MarkPorts, /DisplayUdpPorts, /DisplayTcpPorts, /DisplayClosedPorts, and more... * Version 1.83: o Added 'Add Header Line To CSV/Tab-Delimited File' option. When this option is turned on, the column names are added as the first line when you export to csv or tab-delimited file. * Version 1.82: o Added 'Resize Columns On Every Refresh' option, which allows you to automatically resize the columns according to the text length on every refresh. * Version 1.81: o Added more include/exclude filter options in the context menu of CurrPorts. * Version 1.80: o Added custom log line option (In 'Advanced Options' window), which allows you to set the format of the log line and put in it any column value you like. * Version 1.76: o Added 'One-Click Tray Icon' option. When it's checked and you use the tray icon option, one click on the tray icon with the left mouse button will open CurrPorts. (Without this option, double-click is required) * Version 1.75: o Added 'Exclude Selected Processes In Filters' option in the context menu. o Added accelerator key for 'Include Selected Processes In Filters' option. o Fixed bug 'Include Selected Processes In Filters' option: failed to work on system process. o Added 'Disable All Filters' option to easily toggle between active filter state and no filter state, as an alternative for 'Clear All Filters', which doesn't allow you to return back the filters. * Version 1.70: o Added /sort command-line option for sorting the connections list saved from command-line. * Version 1.66: o Fixed issue: When CurrPorts window is hidden and there is an icon in the taskbar, running CurrPorts again will open the existing instance of CurrPorts, instead of creating another one. * Version 1.65: o Added drag And drop icon in the toolbar that allows to to easily filter by the desired application. Simply drag the target icon into the window of the application, and CurrPorts will display only the opened ports of this application. * Version 1.60: o Added new column: Window Title (The window title of the process) o Added 'Clear All Filters' option. o Added 'Include Selected Processes In Filters' option. Allows you to easily filter by selected processes. * Version 1.56: o Added new option: Ask before any action. (If you uncheck this option, CurrPorts won't ask you any question before closing ports/applications) * Version 1.55: o Added number of remote connections to the status bar. o Added ports information in the tray icon tooltip. * Version 1.51: o Fixed bug: In rare cases, exception window may appear when starting CurrPorts. * Version 1.50: o Added 'Display Port In Address' option. When this option is checked, the addresses will be displayed in 'address:port' format. * Version 1.48: o Fixed the Alt+1 accelerator key. * Version 1.47: o Added AutoRefresh every 1 second. * Version 1.46: o Automatically launch IPNetInfo when it's in the same folder of CurrPorts. * Version 1.45: o Added 'Remote IP Country' column that displays the country name of the remote IP address (requires to download an external file from here) * Version 1.41: o Fixed bug: CurrPorts failed to display the current Auto Refresh status in Menu. * Version 1.40: o Added support for IPv6. * Version 1.37: o Fixed bug: CurrPorts failed to display process information when running under Windows Vista with non-admin user. o Added Module Filename column (works only on XP/SP2) * Version 1.36: o Fixed bug: The main window lost the focus when the user switched to another application and then returned back to CurrPorts. * Version 1.35: o Fixed bug in saving as comma-delimited file when field values contained comma character. * Version 1.34: o New Option: Remember Last Filter (The filter is saved in cports_filter.txt) * Version 1.33: o Added support for saving comma-delimited (.csv) files. o Added new command-line option: /scomma * Version 1.32: o New Option: Start CurrPorts As Hidden (Only when 'Put Icon On Tray' is turned on) o New Option: Copy Remote IP Address (F2). * Version 1.31: o Fixed bug: TCP and UDP ports with the same number and in the same process merged into one item. * Version 1.30: o New column: Added On - Displays the date that the specified connection was added. o New Option: Put Icon On Tray. o New Option: Log File. * Version 1.20: o Added support for filters. o The settings of CurrPorts utility is now saved to cfg file instead of using the Registry. o New command-line options. o You can now send the information to stdout by specifying an empty filename ("") in the command-line. o Added support for x64. * Version 1.11: o Added support for process information in Vista. * Version 1.10: o A tooltip is displayed when a string in a column is longer than the column length. * Version 1.09: o /close command-line parameter - Close a connection from command-line * Version 1.08: o Fixed columns order bug. * Version 1.07: o New option: Resolve the remote IP addresses. * Version 1.06: o New column: Process Attributes - Display the file attributes of the process (H for hidden, R for read-only, and so on) o Added support for working with IPNetInfo utility * Version 1.05: o Fixed bug: identify process path starting with '\??\' * Version 1.04: o Added more accelerator keys. o Added support for Windows XP visual styles. * Version 1.03: o New Option: Display Listening o New Option: Display Established o New Option: Display Items With Unknown State o New Option: Display Items Without Remote Address * Version 1.02: o Fixed bug: "Exception C0000005" message when running CurrPorts on Windows NT/2000 without administrator rights. o New column: "Process Services" - Displays the list of services of a process. * Version 1.01: o The 'Copy Selected Items' option now copies the ports data in tab-delimited format, so you can instantly paste the data into your Excel worksheet. o Improvment in ports to process binding under Windows 2000. Process information is now also displayed under Windows NT. * Version 1.00: First release. System Requirements =================== This utility works perfectly under Windows NT, Windows 2000, Windows XP, Windows Server 2003, Windows Server 2008, Windows Vista, and Windows 7. There is also a separated download of CurrPorts for x64 versions of Windows. If you want to use this utility on Windows NT, you should install psapi.dll in your system32 directory. You can also use this utility on older versions of Windows (Windows 98/ME), but in these versions of Windows, the process information for each port won't be displayed. Using CurrPorts =============== CurrPorts utility is a standalone executable, and it doesn't require any installation process or additional DLLs. In order to start using it, just copy the executable file (cports.exe) to any folder you like, and run it. The main window of CurrPorts displays the list of all currently opened TCP and UDP ports. You can select one or more items, and then close the selected connections, copy the ports information to the clipboard, or save it to HTML/XML/Text file. If you don't want to view all available columns, or you want to change the order of the columns on the screen and in the files you save, select 'Choose Column' from the View menu, and select the desired columns and their order. In order to sort the list by specific column, click on the header of the desired column. The Options Menu ================ The following options are available under the Options menu: * Display Listening: If this option is enabled, all listening ports are displayed. * Display Established: If this option is enabled, all established connections are displayed. * Display Closed: If this option is enabled, closed ports (with 'Time Wait', 'Close Wait', or 'Closed' state) are displayed. * Display Items With Unknown State: If this option is enabled, items with unknown state (the state column is empty) are displayed. * Display Items Without Remote Address: If this option is enabled, disconnected ports with no remote address are displayed. * Display TCP Ports: If this option is disabled, TCP ports won't be displayed in the ports list. * Display UDP Ports: If this option is disabled, UDP ports won't be displayed in the ports list. * Mark Ports Of Unidentified Applications: If this option is enabled, all TCP/UDP ports that opened by applications with no version information and with no icons, are automatically marked with pink color. If you have on your system one or more ports marked with pink color, you should deeply check the processes that created these ports. It could be only an innocent application that simply doesn't contain any icons and version information (For example: the executables of MySQL and Oracle servers don't contain any icons or version info, so if you have MySQL/Oracle servers on your system, the ports they open will be marked.) , but it can also be a trojan or other unwanted application that infiltrated into your system. * Mark New/Modified Ports: If this option is enabled, each time the ports list is refreshed, all newly added ports and existing ports with changes are marked with green color. * Auto Refresh: Allows you to automatically refresh the opened ports list each 2, 4, 6, 8, or 10 seconds. * Sort On Auto Refresh If this option is enabled, the entire ports list is sorted each time that the list is refreshed automatically. Otherwise, new/modified ports are added to the bottom of the list. The 'Remote IP Country' column ============================== In order to watch the countries of the remote IP addresses, you have to download the latest IP To Country file from here. You have the put the 'IpToCountry.csv' file in the same folder of cports.exe You can also use the GeoLite City database. Simply download the GeoLite City in Binary / gzip (GeoLiteCity.dat.gz) and put it in the same folder of cports.exe If you want to get faster loading process, extract the GeoLiteCity.dat from the GeoLiteCity.dat.gz and put it in the same folder of cports.exe Using Filters ============= Starting from version 1.20, you can monitor only the opened ports that you need, by using the "Advanced Filters" option (Options -> Advanced Filters). In the filters dialog-box, you can add one or more filter strings (separated by spaces, semicolon, or CRLF) in the following syntax: [include | exclude] : [local | remote | both | process] : [tcp | udp | tcpudp] : [IP Range | Ports Range] Here's some examples that demonstrate how to create a filter string: * Display only packets with remote tcp port 80 (Web sites): include:remote:tcp:80 * Display only packets with remote tcp port 80 (Web sites) and udp port 53 (DNS): include:remote:tcp:80 include:remote:udp:53 * Display only packets originated from the following IP address range: 192.168.0.1 192.168.0.100: include:remote:tcpudp:192.168.0.1-192.168.0.100 * Display only TCP and UDP packets that use the following port range: 53 - 139: include:both:tcpudp:53-139 * Filter most BitTorrent packets (port 6881): exclude:both:tcpupd:6881 * Display only the opened ports of FireFox browser: include:process:firefox.exe Integration with IPNetInfo utility ================================== If you want to get more information about the remote IP address displayed in CurrPorts utility, you can utilize the Integration with IPNetInfo utility in order to easily view the IP address information from WHOIS servers: 1. Download and run the latest version of IPNetInfo utility. (If you have IPNetInfo with version prior to v1.06, you must download the newer version.) 2. Select the desired connections, and then choose "IPNetInfo" from the File menu (or simply click Ctrl+I). 3. IPNetInfo will retrieve the information about remove IP addresses of the selected connections. Log File ======== Starting from version 1.30, CurrPorts allows you to save all changes (added and removed connections) into a log file. In order to start writing to the log file, check the 'Log Changes' option under the File menu. By default, the log file is saved as 'cports.log' in the same folder that cports.exe is located. You can change the default log filename by setting the 'LogFilename' entry in cports.cfg file. Be aware that the log file is updated only when you refresh the ports list manually, or when the 'Auto Refresh' option is turned on. Custom Log Line =============== Starting from version 1.80, you can set the format of the lines in the log file according to your needs. In order to use this feature, go to 'Advanced Options' window (Ctrl+O), check the custom log line option, type the desired format string. In the format string, you can use the following variables: %Process_Name% %Protocol% %Local_Port% %Local_Address% %Remote_Port% %Remote_Address% %Process_Path% %Process_ID% %State% %Product_Name% %File_Description% %File_Version% %Company% %Process_Created_On% %Local_Port_Name% %Remote_Port_Name% %User_Name% %Process_Services% %Process_Attributes% %Remote_Host_Name% %Added_On% %Module_Filename% %Remote_IP Country% %Window_Title% You can also set the minimum number of characters for the column value, for example: %Process_Name.25% (Fill with spaces - up to 25 characters) Notice: %Remote_Host_Name% variable is not displayed on newly added connections, because the IP address resolving is asynchronous operation, and the host name is still not available when the log line is added. Command-Line Options ==================== /stext <Filename> Save the list of all opened TCP/UDP ports into a regular text file. /stab <Filename> Save the list of all opened TCP/UDP ports into a tab-delimited text file. /scomma <Filename> Save the list of all opened TCP/UDP ports into a comma-delimited text file. /stabular <Filename> Save the list of all opened TCP/UDP ports into a tabular text file. /shtml <Filename> Save the list of all opened TCP/UDP ports into HTML file (Horizontal). /sverhtml <Filename> Save the list of all opened TCP/UDP ports into HTML file (Vertical). /sxml <Filename> Save the list of all opened TCP/UDP ports to XML file. /sort <column> This command-line option can be used with other save options for sorting by the desired column. If you don't specify this option, the list is sorted according to the last sort that you made from the user interface. The <column> parameter can specify the column index (0 for the first column, 1 for the second column, and so on) or the name of the column, like "Remote Port" and "Remote Address". You can specify the '~' prefix character (e.g: "~Remote Address") if you want to sort in descending order. You can put multiple /sort in the command-line if you want to sort by multiple columns. Examples: cports.exe /shtml "f:\temp\1.html" /sort 2 /sort ~1 cports.exe /shtml "f:\temp\1.html" /sort "Protocol" /sort "~Remote Address" /nosort When you specify this command-line option, the list will be saved without any sorting. /filter <filter string> Start CurrPorts with the specified filters. If you want to specify more than one filter, use the ';' character as a delimiter. /cfg <cfg filename> Start CurrPorts with the specified config file. /MarkPorts /DisplayUdpPorts /DisplayTcpPorts /DisplayClosedPorts /MarkNewModifiedPorts /SortOnAutoRefresh /AlwaysOnTop /AskBefore /DisplayIPv6Ports /DisplayListening /DisplayEstablished /DisplayNoState /DisplayNoRemoteIP /ResolveAddresses /RememberLastFilter /DisplayPortInAddress /AutoRefresh, /ShowInfoTip /TrayIcon /TrayIconOneClick /StartAsHidden /LogChanges /LogFilename /DisabledFilters /AddExportHeaderLine You can use all these parameters to control the options that are available under the Options and View menus. For example, if you want to start CurrPorts with 'Display UDP Ports' turned off and 'Display Closed' turned on: cports.exe /DisplayUdpPorts 0 /DisplayClosedPorts 1 You can also use these parameters in conjunction with all save parameters. For example: If you want to save into tab-delimited file only the UDP ports: cports.exe /DisplayUdpPorts 1 /DisplayTcpPorts 0 /stab "c:\temp\udp.txt" Here's some examples: * Save all opened TCP/IP ports created by Internet Explorer browser to HTML file: cports.exe /filter "include:process:iexplore" /shtml "c:\temp\ports.html" * Add all opened ports information to ports.txt (as tab-delimited text file). This example only works when running it from a command-prompt window. cports.exe /stab "" >> c:\temp\cports1.txt * Start CurrPorts with filter that will only display the opened ports of Internet Explorer and FireFox: cports.exe /filter "include:process:firefox;include:process:iexplore" Closing a Connection From Command-Line ====================================== Starting from version 1.09, you can close one or more connections from command-line, by using /close parameter. The syntax of /close command: /close <Local Address> <Local Port> <Remote Address> <Remote Port> {Process Name} For each parameter, you can specify "*" in order to include all ports or addresses. The process name is an optional parameter. If you specify a process, only the ports of the specified process will be closed. Examples: * Close all connections with remote port 80 and remote address 192.168.1.10: /close * * 192.168.1.10 80 * Close all connections with remote port 80 (for all remote addresses): /close * * * 80 * Close all connections to remote address 192.168.20.30: /close * * 192.168.20.30 * * Close all connections with local port 80: /close * 80 * * * Close all connections of Firefox with remote port 80: /close * * * 80 firefox.exe Translating CurrPorts To Another Language ========================================= CurrPorts allows you to easily translate all menus, dialog-boxes, and other strings to other languages. In order to do that, follow the instructions below: 1. Run CurrPorts with /savelangfile parameter: cports.exe /savelangfile A file named cports_lng.ini will be created in the folder of CurrPorts utility. 2. Open the created language file in Notepad or in any other text editor. 3. Translate all menus, dialog-boxes, and string entries to the desired language. 4. After you finish the translation, Run CurrPorts, and all translated strings will be loaded from the language file. If you want to run CurrPorts without the translation, simply rename the language file, or move it to another folder. License ======= This utility is released as freeware. You are allowed to freely distribute this utility via floppy disk, CD-ROM, Internet, or in any other way, as long as you don't charge anything for this. If you distribute this utility, you must include all files in the distribution package, without any modification ! Disclaimer ========== The software is provided "AS IS" without any warranty, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The author will not be liable for any special, incidental, consequential or indirect damages due to loss of data or any other reason. Feedback ======== If you have any problem, suggestion, comment, or you found a bug in my utility, you can send a message to [email protected]
Merge Professional is the visual file comparison (diff), merging and folder synchronization application from Araxis. Use it to compare and merge source code, web pages, XML and other text files with native application performance. Directly open and compare the text from Microsoft Office (Word and Excel), OpenDocument, PDF and RTF files. Compare images and binary files. Synchronize folders. Perform code reviews and audits. Work with folder hierarchies containing thousands of files. Merge integrates with many SCM (version control) systems and other applications. Benefits For legal and publishing professionals: instantly identify every change between different contract or manuscript drafts. Directly open and compare the text from Microsoft Office (Word and Excel), OpenDocument, PDF and RTF files. Copy text from other applications (such as Microsoft Word) and paste it directly into a text comparison window. For software engineers and web developers: compare, understand and combine different source file versions. Work quickly and accurately, whether you are comparing individual files or reconciling entire branches of source code. Use three-way comparison to integrate changes made by you, and those made by a colleague, with a common ancestor version. Synchronize a website with its staging area via ftp using the supplied ftp plugin. For release and quality control managers: compare different source code branches to give total confidence that you know and understand every change made to every file for a specific release. Compare product releases to be certain that only the expected files have been modified. Create an html or xml report of changes for audit purposes. For code reviewers and auditors: identify in context every change made between two or three source code hierarchies. Create a standalone html or xml report of your findings. Add bookmarks and comments to a file or folder comparison, then save it as a single-file archive for emailing to other team members for review. Other users: Whether you are working with multiple revisions of text files or need to keep multiple folder hierarchies in sync (for example, between a desktop and laptop machine), Merge could help save time and reduce errors by helping you to work quickly and accurately. File comparison and merging Merge enables you to compare and work with different revisions of text files, such as program source code, xml and html files. Merge can extract and compare the text from Microsoft Office, OpenDocument, PDF and RTF files. XML files can be shown with special formatting, helping you to see changes more clearly. It supports files with ascii, mbcs and Unicode character encodings. A colour-coded side-by-side comparison makes it easy to pinpoint at a glance similarities and differences between files. Linking lines are drawn between the documents showing clearly how they are related. Point-and-click merging lets you choose the parts of each file that you would like to add to a final merged version by simply clicking buttons. The in-place editor with unlimited undo enables complete control over the merged file as you create it. The file comparison display dynamically updates as the merge progresses. Merge shows detailed highlights of changes within lines. It can be configured to ignore differences in whitespace and line endings, as well as changes in lines matching specified regular expressions. The latter is useful for ignoring unimportant changes such as timestamps or expanded version control keywords. Binary and image file comparison Merge doesn’t just compare text files. Use image comparison to compare various types of image file and instantly see which pixels have been modified. Binary comparison enables you to identify differences in data files at a byte level. Three-way comparison and automatic merging Merge Professional adds advanced three-way visual file comparison and merging to the Standard Edition’s two-way visual file comparison and merging. This is particularly useful when more than one person is working on the same set of files. Automatic Merging enables swift reconciliation of even the largest files. Three-way file comparisons can be launched directly from a three-way folder comparison, allowing efficient integration of entire branches of source code. Integrated folder hierarchy comparison and synchronization Merge supports folder hierarchy comparison and synchronization, enabling you to compare and merge entire directory trees. This is ideal for detecting changes in different versions of source code or web pages. You can even use the efficient byte-by-byte comparison option to verify the contents of recordable cds or usb thumbsticks. The Professional Edition of Merge supports three-way folder comparison, enabling two revisions of a folder hierarchy to be merged with their common ancestor or some other folder hierarchy. This can be especially useful when used in conjunction with a source code control or software configuration management system. Direct access to FTP sites and configuration management systems An ftp plugin gives Merge file and folder comparisons direct access to files located on an ftp server. It is therefore possible to use a folder comparison to synchronize a local copy of a website’s content with the main site itself, provided the main site is running an ftp server. Merge plugins for Perforce, Subversion and Visual SourceSafe are also provided. These give Merge read-only access to files and folders located in Perforce depots, Subversion repositories and Visual SourceSafe databases. Therefore, for example, a Merge folder comparison can be used to compare a Perforce client workspace against the depot. Alternatively, different branches (or the same branch at different points in time) within a depot can be compared directly. A similar plugin for AllChange is available from Intasoft. Report generation File comparison reports (examples: two-way, three-way) can be created in html, html slideshow, xml or unix diff format. html reports are particularly useful for archiving and distribution. Folder comparison reports (examples: two-way, three-way) can be created in html or xml format. A folder comparison report can, optionally, include file comparison reports for some or all of the files involved in the folder comparison. Thus it is possible to generate a report that is a complete record of all the differences in all of the files involved in a folder comparison. This is especially useful in code review and code audit situations, particularly as reports can be generated directly for files and folders in configuration management systems for which there is a Merge plugin. Print support, Automation and other advanced features Other features include the ability to print a hard copy of file and folder comparisons, and to customize the behaviour and appearance of the application, including fonts, colours, whether the display is split horizontally or vertically, and more. A full Automation api and Command-Line Interface are included, allowing close integration with other applications (such as source code control and software configuration management systems) or your workflow. Comprehensive online documentation is supplied with the product and is also available from the Araxis website. Context-sensitive help is provided for every menu item, dialog and dialog control.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值