精华内容
下载资源
问答
  • Androiddll文件的修改,最近下载了一款非常不错的益智类游戏,一打开,顶部还有广告,最讨厌游戏中还带广告的,点又点不掉,又怕误点,真的看了都烦。。。作为程序员,就有种想要把它干掉的想法,作为玩游戏没耐心...

    Android中dll文件的修改,最近下载了一款非常不错的益智类游戏,一打开,顶部还有广告,最讨厌游戏中还带广告的,点又点不掉,又怕误点,真的看了都烦。。。作为程序员,就有种想要把它干掉的想法,作为玩游戏没耐心的人,玩到一半过不了关总想看到最后一关是什么样。不知道你们有没有这种感觉。。。

    这个游戏很适合给小学生做数学题(好像小学生以上的都很适合,哈哈),游戏中所要做的就是将下面标注着数字的水球切开或是粘合起来,以符合在框框里标注的数字。如果用手指将水球像两个方向拉伸,水球就变成了大小相同的两个小水球,而上面写着的数字就变成了原来的一半。而让两个小水球合并到一起,上面的数字就会加在一起。在画面中有的区域会出现小框里面也会标注相应的数字,让水球和这些框框里的数字相吻合,紧紧地嵌入框框就可以过关。

    243692_0.png

    好了,下面直接进入正题吧,当前要解决的问题就是:1.去除广告 2.解锁关卡

    需要的工具:

    一:Android Killer

    二:Reflector

    拿到apk包后使用Android Killer反编译得到如下:

    243692_1.png

    很明显这个游戏是使用Unity3D引擎开发的,那么,一般它的游戏逻辑都会写在assetsbinDataManagedAssembly-CSharp.dll这个文件里(也有一些会写在其他文件里)。

    1.去除广告:

    打开它的目录结构如下:

    243692_2.png

    之前看过一篇去除广告的文章,一般它加载广告在smali中都会有invoke-virtual.........->loadAd........;(有些会在so文件里加载广告,这种方式更高级,这里就不说在so文件里是如何加载广告的,其实我也不懂在so文件里面是怎么加载广告的,哈哈哈。。。)那么我们直接就搜“->loadAd”看看,结果如下:

    243692_3.png

    看到有3处调用了“loadAd”的地方,那我们就直接把它注释掉吧,不让它调用,

    只需要在被调用的地方加个“#”号就行,这样就注释掉了。简单吧,哪里不要就“#”哪里,妈妈再也不用担心话费乱扣了。。。

    243692_4.png

    注释掉之后,重新打包,运行如下:

    243692_5.png

    这就对了嘛,真干净,看了就很爽。

    去除广告成功,妈妈还会担心每个月几百块的话费哪里去吗,哈哈哈。。。

    2.解锁关卡:

    从上面我们知道使用Unity3D引擎开发的,那么我们直接把它拖入Reflector工具里查看,看到如下:

    243692_6.png

    一般解锁关卡,无非就是unlock什么的,这里我们就直接在此工具下按键盘上的“F3”搜搜看:

    243692_7.png

    看到了吧,里面有很多有关于关卡的解锁逻辑,

    尝试过把UnlockAchievements()方法内的this.Level >=XX都改为

    this.Level >=1(后面给出怎么修改的方式),但是这样修改,运行之后是没有看到有解锁关卡或别的什么。那肯定是我们没改对地方,导致解锁失败。

    243692_8.png

    在里面我们还看到有LoadLevel(),LoadNextLevel(),这两个方法,

    在游戏中我们可以看到界面中 上下关卡只有图中两个按钮。

    243692_9.png

    再看看LoadLevel()这个方法里面好像也没有看到什么“+1”之类的逻辑,

    243692_10.png

    再看看LoadNextLevel()这个方法,

    243692_11.png

    到这里我们就基本锁定上下关卡就是在这里做的操作,但是一旦调用这个方法,进来立马就保存当前关卡,到下面就判断是否要载入上下关卡,那我们就让它一调用这个方法就先给Level加1,也就是this.Level++; 相反的在图中的 this.Level++ 和 this.Level-- ,就要变成

    this.Level+=0; this.Level-=2; 因为上面已经加1了,所以这里else if 里面的判断就不能再加1了,而else里面的判断就要多减1,具体的看图:

    这里补充一点:

    要修改dll文件需要在你的Reflector/Addins目录下有这个两个文件

    243692_12.png

    然后再配置这两个文件,如下图

    243692_13.png

    243692_14.png

    配置完之后在Tools下就会多出Reflexil v1.6这个选项

    243692_15.png

    终于要开始改了。。。。。。。

    继续上面说的,点击Reflexil v1.6这个选项,看到如下:

    243692_16.png

    那我们怎么添加呢,这里其实我也不懂,我也是参照它里面的语句

    243692_17.png

    找到对应的语句就好办了,我们再这样操作,如下图:

    243692_18.png

    添加:ldarg.0

    243692_19.png

    添加:dup

    243692_20.png

    添加ldfld System.Int32 StageController::Level ,

    这里分成两步,第一步是OpCode,和Operand type

    243692_21.png

    第二步:

    在Operand中:

    243692_22.png

    243692_23.png

    243692_24.png

    添加ldc.i4.1

    243692_25.png

    添加add

    243692_26.png

    添加stfld System.Int32 StageController::Level

    这个跟上面添加ldfld System.Int32 StageController::Level 是一样的,这里就不贴图了,

    最后添加成功后是这样,如下图:

    243692_27.png

    注意:如果上面添加标签的时候不小心点到 ”Append”,会跑到最后去,记得删掉。否则也会报错。

    到这里还没完,记得上面说的this.Level++ 和 this.Level-- ,要改为

    this.Level+=0; this.Level-=2 ,这里就只贴加法的修改步骤,减法的自行修改

    243692_28.png

    243692_29.png

    到这里就全部修改完成了,那接下来就是保存了

    243692_30.png

    243692_31.png

    保存完成之后可以按键盘“F5”刷新一下,看有没有修改成功

    243692_32.png

    最后就是重新打包这个apk文件,运行。。。

    进入游戏后发现还是下一关卡按钮还是灰色的,说明没改对地方,这就尴尬了。。。

    辛苦大半天还是一样。。。难道this.Level++不是在这改的吗,(这不是废话吗,如果改对了,还会有下文吗,哈哈哈。。。)

    没办法了,回去看看哪里还有使用Level变量的。

    243692_33.png

    直接鼠标左击”this.Level++”中的Level会跳到Level的出处,再右键点击Level,选择Analyze

    243692_34.png

    243692_35.png

    一个是我们刚刚的LoadNextLevel(),还有另一个,那很有可能是在另一个地方被调用了,

    很明显,这个两个方法都在同一个类下,右键图中对应的方法选择Go To Member

    243692_36.png

    进入这个方法后看到如下:

    243692_37.png

    改的方法跟上面是一样的,因为是在同一个类下,所以都一样,但是这里需要注意一下,因为它本来已经有this.Level=stageData.Level,直接修改就行,或者把这句对应的语句删掉再重新添加也行,修改后样子如下:

    243692_38.png

    然后修改后,记得我们刚刚在LoadNextLevel()方法里添加的this.Level++记得要删除,

    否则进入下一关卡的时候level就相当于加了两次。

    好了,经过刚才添加,删除之后我们再保存这个文件(修改完之后最好F5刷新一下,看有没有修改成功),重新打包apk。

    成功,嘿嘿

    最后放一张gif动图,不知道发布出去,有没有动画效果。

    243692_39.gif

    总结:

    1.移除XXX广告的方法,正在调用的时候就是一句话,所以只要注释掉关键点就行。

    2.对dll文件的修改,利用一些关键词去修改,这只是我的一些思路,如果你有搞怪的方法,还请留言一起探讨下,我一开始也是蒙逼的,删除还好,但是增加就有点困难,特别是要用它里面的方法,一开始都不知道那是啥,哈哈,不过现在总算有点了解了。

    展开全文
  • Androiddll文件的修改

    千次阅读 2017-08-17 21:11:05
    最近下载了一款非常不错的益智类游戏,一打开,顶部还有广告,最讨厌游戏中还带广告的,点又点不掉,又怕误点,真的看了都烦。。。作为程序员,就有种想要把它干掉的想法,作为玩游戏没耐心的人,玩到一半过不了关总...

    最近下载了一款非常不错的益智类游戏,一打开,顶部还有广告,最讨厌游戏中还带广告的,点又点不掉,又怕误点,真的看了都烦。。。作为程序员,就有种想要把它干掉的想法,作为玩游戏没耐心的人,玩到一半过不了关总想看到最后一关是什么样。不知道你们有没有这种感觉。。。

     

    这个游戏很适合给小学生做数学题(好像小学生以上的都很适合,哈哈),游戏中所要做的就是将面标注着数字的水球切开或是粘合起来,以符合在框框里标注的数字。如果用手指将水球像两个方向拉伸,水球就变成了大小相同的两个小水球,而上面写着的数字就变成了原来的一半。而让两个小水球合并到一起,上面的数字就会加在一起。在画面中有的区域会出现小框里面也会标注相应的数字,让水球和这些框框里的数字相吻合,紧紧地嵌入框框就可以过关。

     

     

     

    好了,下面直接进入正题吧,当前要解决的问题就是:1.去除广告 2.解锁关卡

    需要的工具:

    一:Android Killer

    二:Reflector

     

    拿到apk包后使用Android Killer反编译得到如下:

     

     

    很明显这个游戏是使用Unity3D引擎开发的,那么,一般它的游戏逻辑都会写在assets\bin\Data\Managed\Assembly-CSharp.dll这个文件里(也有一些会写在其他文件里)。

     

    1.去除广告:

    打开它的目录结构如下:

     

    之前看过一篇去除广告的文章,一般它加载广告在smali中都会有invoke-virtual.........->loadAd........;(有些会在so文件里加载广告,这种方式更高级,这里就不说在so文件里是如何加载广告的,其实我也不懂在so文件里面是怎么加载广告的,哈哈哈。。。)那么我们直接就搜“->loadAd”看看,结果如下:

     

     

    看到有3处调用了“loadAd”的地方,那我们就直接把它注释掉吧,不让它调用,

    只需要在被调用的地方加个#”号就行,这样就注释掉了。简单吧,哪里不要就“#”哪里,妈妈再也不用担心话费乱扣了。。。

     

    注释掉之后,重新打包,运行如下:

     

    这就对了嘛,真干净,看了就很爽。

    去除广告成功,妈妈还会担心每个月几百块的话费哪里去吗,哈哈哈。。。

     

    2.解锁关卡:

     

    从上面我们知道使用Unity3D引擎开发的,那么我们直接把它拖入Reflector工具里查看,看到如下:

     

    一般解锁关卡,无非就是unlock什么的,这里我们就直接在此工具下按键盘上的“F3”搜搜看:

     

    看到了吧,里面有很多有关于关卡的解锁逻辑,

    尝试过把UnlockAchievements()方法内的this.Level >=XX都改为

    this.Level >=1(后面给出怎么修改的方式),但是这样修改,运行之后是没有看到有解锁关卡或别的什么。那肯定是我们没改对地方,导致解锁失败。

     

     

     

    在里面我们还看到有LoadLevel(),LoadNextLevel(),这两个方法,

    在游戏中我们可以看到界面中 上下关卡只有图中两个按钮。

     

    再看看LoadLevel()这个方法里面好像也没有看到  什么“+1”之类的逻辑,

     

     

    再看看LoadNextLevel()这个方法,

     

    到这里我们就基本锁定上下关卡就是在这里做的操作,但是一旦调用这个方法,进来立马就保存当前关卡,到下面就判断是否要载入上下关卡,那我们就让它一调用这个方法就先给Level1,也就是this.Level++;  相反的在图中的 this.Level++  this.Level--  ,就要变成

    this.Level+=0;  this.Level-=2;  因为上面已经加1了,所以这里else if 里面的判断就不能再加1了,而else里面的判断就要多减1,具体的看图:

     

    这里补充一点:

    要修改dll文件需要在你的Reflector/Addins目录下有这个两个文件

     

    然后再配置这两个文件,如下图

       

     

     

    配置完之后在Tools下就会多出Reflexil v1.6这个选项

     

     

    终于要开始改了。。。。。。。

    继续上面说的,点击Reflexil v1.6这个选项,看到如下:

     

     

    那我们怎么添加呢,这里其实我也不懂,我也是参照它里面的语句

     

    找到对应的语句就好办了,我们再这样操作,如下图:

     

     

     

    添加:ldarg.0

     

     

    添加:dup

     

     

    添加ldfld    System.Int32 StageController::Level

    这里分成两步,第一步是OpCode,Operand type

     

    第二步:

    Operand中:

     



     

    添加ldc.i4.1

     

     

    添加add

     

     

    添加stfld    System.Int32 StageController::Level   

    这个跟上面添加ldfld    System.Int32 StageController::Level 是一样的,这里就不贴图了,

     

    最后添加成功后是这样,如下图:

     

     

    注意:如果上面添加标签的时候不小心点到 ”Append” ,会跑到最后去,记得删掉。否则也会报错。

     

    到这里还没完,记得上面说的this.Level++  this.Level--  ,要改为

    this.Level+=0;  this.Level-=2  ,这里就只贴加法的修改步骤,减法的自行修改

     

     

     

    到这里就全部修改完成了,那接下来就是保存了

     

     

     

    保存完成之后可以按键盘F5”刷新一下,看有没有修改成功

     

     

    最后就是重新打包这个apk文件,运行。。。

    进入游戏后发现还是下一关卡按钮还是灰色的,说明没改对地方,这就尴尬了。。。

    辛苦大半天还是一样。。。难道this.Level++不是在这改的吗,(这不是废话吗,如果改对了,还会有下文吗,哈哈哈。。。)

    没办法了,回去看看哪里还有使用Level变量的。

     

     

    直接鼠标左击”this.Level++”中的Level会跳到Level的出处,再右键点击Level,选择Analyze

     


     

    一个是我们刚刚的LoadNextLevel(),还有另一个,那很有可能是在另一个地方被调用了,

    很明显,这个两个方法都在同一个类下,右键图中对应的方法选择Go To Member

     

     

    进入这个方法后看到如下:

     

    改的方法跟上面是一样的,因为是在同一个类下,所以都一样,但是这里需要注意一下,因为它本来已经有this.Level=stageData.Level,直接修改就行,或者把这句对应的语句删掉再重新添加也行,修改后样子如下:

     

    然后修改后,记得我们刚刚在LoadNextLevel()方法里添加的this.Level++记得要删除,

    否则进入下一关卡的时候level就相当于加了两次。

    好了,经过刚才添加,删除之后我们再保存这个文件(修改完之后最好F5刷新一下,看有没有修改成功),重新打包apk

    成功,嘿嘿

    最后放一张gif动图,不知道发布出去,有没有动画效果。

     

     

    总结:

    1.移除XXX广告的方法,正在调用的时候就是一句话,所以只要注释掉关键点就行。

    2.对dll文件的修改,利用一些关键词去修改,这只是我的一些思路,如果你有搞怪的方法,还请留言一起探讨下,我一开始也是蒙逼的,删除还好,但是增加就有点困难,特别是要用它里面的方法,一开始都不知道那是啥,哈哈,不过现在总算有点了解了。

     

    最后还是那句老套话,以上只是用来技术交流,如果您使用该已经破解的游戏用于任何非法用途,均与本作者无关。


                                                                                                                                                                2017.08.17

    展开全文
  • Android打开系统文件管理器

    千次阅读 2019-09-29 09:40:51
    通过SAF,用户可以轻松地浏览和打开所有首选文档存储提供商中的文档,图像和其他文件。 一个标准、易于使用的UI允许用户在应用程序和提供程序之间以一致的方式浏览文件并访问最新消息。云或本地存储服务可以通过...

    一、前言

    Android 4.4(API级别19)引入了存储访问框架(SAF)。
    通过SAF,用户可以轻松地浏览和打开所有首选文档存储提供商中的文档,图像和其他文件。
    也就是说,接下来介绍的方式适用于android4.4+的操作系统。
    参考链接:https://developer.android.com/guide/topics/providers/document-provider

    二、详细实现

    1、调出系统文件管理器界面
    private static final int READ_REQUEST_CODE = 42;
    ...
    /**
     * Fires an intent to spin up the "file chooser" UI and select an image.
     */
    public void performFileSearch() {
    
        // ACTION_OPEN_DOCUMENT is the intent to choose a file via the system's file
        // browser.
        Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    
        // Filter to only show results that can be "opened", such as a
        // file (as opposed to a list of contacts or timezones)
        intent.addCategory(Intent.CATEGORY_OPENABLE);
    
        // Filter to show only images, using the image MIME data type.
        // If one wanted to search for ogg vorbis files, the type would be "audio/ogg".
        // To search for all documents available via installed storage providers,
        // it would be "*/*".
        intent.setType("image/*");
    
        startActivityForResult(intent, READ_REQUEST_CODE);
    }
    
    1)Intent除了可以设置为ACTION_OPEN_DOCUMEN,还可以替换为ACTION_GET_CONTENT ,两者的区别如下:
    • 如果您希望您的应用仅读取/导入数据,请使用ACTION_GET_CONTENT。 通过这种方法,应用程序可以导入数据的副本,例如图像文件。
    • 如果希望您的应用对文件提供者拥有的文件具有长期,持久的访问权限,请使用ACTION_OPEN_DOCUMENT
    2)Category设置为CATEGORY_OPENABLE,过滤出可以打开的文件
    3)Type设置的是MIMETYPE,比如:
    • 过滤所有图片,则设置为:"image/*"
    • 只过滤png图片,则设置为:"image/png"
    • 过滤apk,那么可设置为:"application/vnd.android.package-archive"
    4)startActivityForResult 启动Inetent,以便在onActivityResult接收文件选择结果
    2、在onActivityResult中处理返回结果
    @Override
    public void onActivityResult(int requestCode, int resultCode,
            Intent resultData) {
    
        // The ACTION_OPEN_DOCUMENT intent was sent with the request code
        // READ_REQUEST_CODE. If the request code seen here doesn't match, it's the
        // response to some other intent, and the code below shouldn't run at all.
    
        if (requestCode == READ_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
            // The document selected by the user won't be returned in the intent.
            // Instead, a URI to that document will be contained in the return intent
            // provided to this method as a parameter.
            // Pull that URI using resultData.getData().
            Uri uri = null;
            if (resultData != null) {
                uri = resultData.getData();
                Log.i(TAG, "Uri: " + uri.toString());
                showImage(uri);
            }
        }
    }
    
    1)从Intent中getData()获取到返回的Uri对象,旧版本是file://开头,新版本是content://开头
    3、从Uri获取所需的信息
    1)从Uri中获取文件元数据,一般只能获取到文件名与大小
    public void dumpImageMetaData(Uri uri) {
    
        // The query, since it only applies to a single document, will only return
        // one row. There's no need to filter, sort, or select fields, since we want
        // all fields for one document.
        Cursor cursor = getActivity().getContentResolver()
                .query(uri, null, null, null, null, null);
    
        try {
        // moveToFirst() returns false if the cursor has 0 rows.  Very handy for
        // "if there's anything to look at, look at it" conditionals.
            if (cursor != null && cursor.moveToFirst()) {
    
                // Note it's called "Display Name".  This is
                // provider-specific, and might not necessarily be the file name.
                String displayName = cursor.getString(
                        cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
                Log.i(TAG, "Display Name: " + displayName);
    
                int sizeIndex = cursor.getColumnIndex(OpenableColumns.SIZE);
                // If the size is unknown, the value stored is null.  But since an
                // int can't be null in Java, the behavior is implementation-specific,
                // which is just a fancy term for "unpredictable".  So as
                // a rule, check if it's null before assigning to an int.  This will
                // happen often:  The storage API allows for remote files, whose
                // size might not be locally known.
                String size = null;
                if (!cursor.isNull(sizeIndex)) {
                    // Technically the column stores an int, but cursor.getString()
                    // will do the conversion automatically.
                    size = cursor.getString(sizeIndex);
                } else {
                    size = "Unknown";
                }
                Log.i(TAG, "Size: " + size);
            }
        } finally {
            cursor.close();
        }
    }
    
    2)将Uri转换为Bitmap
    private Bitmap getBitmapFromUri(Uri uri) throws IOException {
        ParcelFileDescriptor parcelFileDescriptor =
                getContentResolver().openFileDescriptor(uri, "r");
        FileDescriptor fileDescriptor = parcelFileDescriptor.getFileDescriptor();
        Bitmap image = BitmapFactory.decodeFileDescriptor(fileDescriptor);
        parcelFileDescriptor.close();
        return image;
    }
    
    3)将Uri转换为InputStream
    private String readTextFromUri(Uri uri) throws IOException {
        StringBuilder stringBuilder = new StringBuilder();
        try (InputStream inputStream =
                getContentResolver().openInputStream(uri);
                BufferedReader reader = new BufferedReader(
                new InputStreamReader(Objects.requireNonNull(inputStream)))) {
            String line;
            while ((line = reader.readLine()) != null) {
                stringBuilder.append(line);
            }
        }
        return stringBuilder.toString();
    }
    
    MIMETYPE 常见的用法:
    文件类型 mime名称 文件类型 mime名称
    3gp video/3gpp pdb chemical/x-pdb
    aab application/x-authoware-bin pdf application/pdf
    aam application/x-authoware-map pfr application/font-tdpfr
    aas application/x-authoware-seg pgm image/x-portable-graymap
    ai application/postscript pict image/x-pict
    aif audio/x-aiff pm application/x-perl
    aifc audio/x-aiff pmd application/x-pmd
    aiff audio/x-aiff png image/png
    als audio/X-Alpha5 pnm image/x-portable-anymap
    amc application/x-mpeg pnz image/png
    ani application/octet-stream pot application/vnd.ms-powerpoint
    apk application/vnd.android.package-archive ppm image/x-portable-pixmap
    asc text/plain pps application/vnd.ms-powerpoint
    asd application/astound ppt application/vnd.ms-powerpoint
    asf video/x-ms-asf pqf application/x-cprplayer
    asn application/astound pqi application/cprplayer
    asp application/x-asap prc application/x-prc
    asx video/x-ms-asf proxy application/x-ns-proxy-autoconfig
    au audio/basic ps application/postscript
    avb application/octet-stream ptlk application/listenup
    avi video/x-msvideo pub application/x-mspublisher
    awb audio/amr-wb pvx video/x-pv-pvx
    bcpio application/x-bcpio qcp audio/vnd.qcelp
    bin application/octet-stream qt video/quicktime
    bld application/bld qti image/x-quicktime
    bld2 application/bld2 qtif image/x-quicktime
    bmp image/bmp r3t text/vnd.rn-realtext3d
    bpk application/octet-stream ra audio/x-pn-realaudio
    bz2 application/x-bzip2 ram audio/x-pn-realaudio
    cal image/x-cals rar application/x-rar-compressed
    ccn application/x-cnc ras image/x-cmu-raster
    cco application/x-cocoa rdf application/rdf+xml
    cdf application/x-netcdf rf image/vnd.rn-realflash
    cgi magnus-internal/cgi rgb image/x-rgb
    chat application/x-chat rlf application/x-richlink
    class application/octet-stream rm audio/x-pn-realaudio
    clp application/x-msclip rmf audio/x-rmf
    cmx application/x-cmx rmm audio/x-pn-realaudio
    co application/x-cult3d-object rmvb audio/x-pn-realaudio
    cod image/cis-cod rnx application/vnd.rn-realplayer
    cpio application/x-cpio roff application/x-troff
    cpt application/mac-compactpro rp image/vnd.rn-realpix
    crd application/x-mscardfile rpm audio/x-pn-realaudio-plugin
    csh application/x-csh rt text/vnd.rn-realtext
    csm chemical/x-csml rte x-lml/x-gps
    csml chemical/x-csml rtf application/rtf
    css text/css rtg application/metastream
    cur application/octet-stream rtx text/richtext
    dcm x-lml/x-evm rv video/vnd.rn-realvideo
    dcr application/x-director rwc application/x-rogerwilco
    dcx image/x-dcx s3m audio/x-mod
    dhtml text/html s3z audio/x-mod
    dir application/x-director sca application/x-supercard
    dll application/octet-stream scd application/x-msschedule
    dmg application/octet-stream sdf application/e-score
    dms application/octet-stream sea application/x-stuffit
    doc application/msword sgm text/x-sgml
    dot application/x-dot sgml text/x-sgml
    dvi application/x-dvi sh application/x-sh
    dwf drawing/x-dwf shar application/x-shar
    dwg application/x-autocad shtml magnus-internal/parsed-html
    dxf application/x-autocad shw application/presentations
    dxr application/x-director si6 image/si6
    ebk application/x-expandedbook si7 image/vnd.stiwap.sis
    emb chemical/x-embl-dl-nucleotide si9 image/vnd.lgtwap.sis
    embl chemical/x-embl-dl-nucleotide sis application/vnd.symbian.install
    eps application/postscript sit application/x-stuffit
    eri image/x-eri skd application/x-Koan
    es audio/echospeech skm application/x-Koan
    esl audio/echospeech skp application/x-Koan
    etc application/x-earthtime skt application/x-Koan
    etx text/x-setext slc application/x-salsa
    evm x-lml/x-evm smd audio/x-smd
    evy application/x-envoy smi application/smil
    exe application/octet-stream smil application/smil
    fh4 image/x-freehand smp application/studiom
    fh5 image/x-freehand smz audio/x-smd
    fhc image/x-freehand snd audio/basic
    fif image/fif spc text/x-speech
    fm application/x-maker spl application/futuresplash
    fpx image/x-fpx spr application/x-sprite
    fvi video/isivideo sprite application/x-sprite
    gau chemical/x-gaussian-input spt application/x-spt
    gca application/x-gca-compressed src application/x-wais-source
    gdb x-lml/x-gdb stk application/hyperstudio
    gif image/gif stm audio/x-mod
    gps application/x-gps sv4cpio application/x-sv4cpio
    gtar application/x-gtar sv4crc application/x-sv4crc
    gz application/x-gzip svf image/vnd
    hdf application/x-hdf svg image/svg-xml
    hdm text/x-hdml svh image/svh
    hdml text/x-hdml svr x-world/x-svr
    hlp application/winhlp swf application/x-shockwave-flash
    hqx application/mac-binhex40 swfl application/x-shockwave-flash
    htm text/html t application/x-troff
    html text/html tad application/octet-stream
    hts text/html talk text/x-speech
    ice x-conference/x-cooltalk tar application/x-tar
    ico application/octet-stream taz application/x-tar
    ief image/ief tbp application/x-timbuktu
    ifm image/gif tbt application/x-timbuktu
    ifs image/ifs tcl application/x-tcl
    imy audio/melody tex application/x-tex
    ins application/x-NET-Install texi application/x-texinfo
    ips application/x-ipscript texinfo application/x-texinfo
    ipx application/x-ipix tgz application/x-tar
    it audio/x-mod thm application/vnd.eri.thm
    itz audio/x-mod tif image/tiff
    ivr i-world/i-vrml tiff image/tiff
    j2k image/j2k tki application/x-tkined
    jad text/vnd.sun.j2me.app-descriptor tkined application/x-tkined
    jam application/x-jam toc application/toc
    jar application/java-archive toy image/toy
    jnlp application/x-java-jnlp-file tr application/x-troff
    jpe image/jpeg trk x-lml/x-gps
    jpeg image/jpeg trm application/x-msterminal
    jpg image/jpeg tsi audio/tsplayer
    jpz image/jpeg tsp application/dsptype
    js application/x-javascript tsv text/tab-separated-values
    jwc application/jwc tsv text/tab-separated-values
    kjx application/x-kjx ttf application/octet-stream
    lak x-lml/x-lak ttz application/t-time
    latex application/x-latex txt text/plain
    lcc application/fastman ult audio/x-mod
    lcl application/x-digitalloca ustar application/x-ustar
    lcr application/x-digitalloca uu application/x-uuencode
    lgh application/lgh uue application/x-uuencode
    lha application/octet-stream vcd application/x-cdlink
    lml x-lml/x-lml vcf text/x-vcard
    lmlpack x-lml/x-lmlpack vdo video/vdo
    lsf video/x-ms-asf vib audio/vib
    lsx video/x-ms-asf viv video/vivo
    lzh application/x-lzh vivo video/vivo
    m13 application/x-msmediaview vmd application/vocaltec-media-desc
    m14 application/x-msmediaview vmf application/vocaltec-media-file
    m15 audio/x-mod vmi application/x-dreamcast-vms-info
    m3u audio/x-mpegurl vms application/x-dreamcast-vms
    m3url audio/x-mpegurl vox audio/voxware
    ma1 audio/ma1 vqe audio/x-twinvq-plugin
    ma2 audio/ma2 vqf audio/x-twinvq
    ma3 audio/ma3 vql audio/x-twinvq
    ma5 audio/ma5 vre x-world/x-vream
    man application/x-troff-man vrml x-world/x-vrml
    map magnus-internal/imagemap vrt x-world/x-vrt
    mbd application/mbedlet vrw x-world/x-vream
    mct application/x-mascot vts workbook/formulaone
    mdb application/x-msaccess wav audio/x-wav
    mdz audio/x-mod wax audio/x-ms-wax
    me application/x-troff-me wbmp image/vnd.wap.wbmp
    mel text/x-vmel web application/vnd.xara
    mi application/x-mif wi image/wavelet
    mid audio/midi wis application/x-InstallShield
    midi audio/midi wm video/x-ms-wm
    mif application/x-mif wma audio/x-ms-wma
    mil image/x-cals wmd application/x-ms-wmd
    mio audio/x-mio wmf application/x-msmetafile
    mmf application/x-skt-lbs wml text/vnd.wap.wml
    mng video/x-mng wmlc application/vnd.wap.wmlc
    mny application/x-msmoney wmls text/vnd.wap.wmlscript
    moc application/x-mocha wmlsc application/vnd.wap.wmlscriptc
    mocha application/x-mocha wmlscript text/vnd.wap.wmlscript
    mod audio/x-mod wmv audio/x-ms-wmv
    mof application/x-yumekara wmx video/x-ms-wmx
    mol chemical/x-mdl-molfile wmz application/x-ms-wmz
    mop chemical/x-mopac-input wpng image/x-up-wpng
    mov video/quicktime wpt x-lml/x-gps
    movie video/x-sgi-movie wri application/x-mswrite
    mp2 audio/x-mpeg wrl x-world/x-vrml
    mp3 audio/x-mpeg wrz x-world/x-vrml
    mp4 video/mp4 ws text/vnd.wap.wmlscript
    mpc application/vnd.mpohun.certificate wsc application/vnd.wap.wmlscriptc
    mpe video/mpeg wv video/wavelet
    mpeg video/mpeg wvx video/x-ms-wvx
    mpg video/mpeg wxl application/x-wxl
    mpg4 video/mp4 x-gzip application/x-gzip
    mpga audio/mpeg xar application/vnd.xara
    mpn application/vnd.mophun.application xbm image/x-xbitmap
    mpp application/vnd.ms-project xdm application/x-xdma
    mps application/x-mapserver xdma application/x-xdma
    mrl text/x-mrml xdw application/vnd.fujixerox.docuworks
    mrm application/x-mrm xht application/xhtml+xml
    ms application/x-troff-ms xhtm application/xhtml+xml
    mts application/metastream xhtml application/xhtml+xml
    mtx application/metastream xla application/vnd.ms-excel
    mtz application/metastream xlc application/vnd.ms-excel
    mzv application/metastream xll application/x-excel
    nar application/zip xlm application/vnd.ms-excel
    nbmp image/nbmp xls application/vnd.ms-excel
    nc application/x-netcdf xlt application/vnd.ms-excel
    ndb x-lml/x-ndb xlw application/vnd.ms-excel
    ndwn application/ndwn xm audio/x-mod
    nif application/x-nif xml text/xml
    nmz application/x-scream xmz audio/x-mod
    nokia-op-logo image/vnd.nok-oplogo-color xpi application/x-xpinstall
    npx application/x-netfpx xpm image/x-xpixmap
    nsnd audio/nsnd xsit text/xml
    nva application/x-neva1 xsl text/xml
    oda application/oda xul text/xul
    oom application/x-AtlasMate-Plugin xwd image/x-xwindowdump
    pac audio/x-pac xyz chemical/x-pdb
    pae audio/x-epac yz1 application/x-yz1
    pan application/x-pan z application/x-compress
    pbm image/x-portable-bitmap zac application/x-zaurus-zac
    pcx image/x-pcx zip application/zip

    三、文件创建、编辑与删除

    1、创建文件,可以在onActivity中接收到结果

    // Here are some examples of how you might call this method.
    // The first parameter is the MIME type, and the second parameter is the name
    // of the file you are creating:
    //
    // createFile("text/plain", "foobar.txt");
    // createFile("image/png", "mypicture.png");
    
    // Unique request code.
    private static final int WRITE_REQUEST_CODE = 43;
    ...
    private void createFile(String mimeType, String fileName) {
        Intent intent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
    
        // Filter to only show results that can be "opened", such as
        // a file (as opposed to a list of contacts or timezones).
        intent.addCategory(Intent.CATEGORY_OPENABLE);
    
        // Create a file with the requested MIME type.
        intent.setType(mimeType);
        intent.putExtra(Intent.EXTRA_TITLE, fileName);
        startActivityForResult(intent, WRITE_REQUEST_CODE);
    }
    

    2、获取Uri之后,要是文件的Document.COLUMN_FLAGS 包含SUPPORTS_DELETE,则可以删除该文件:

    DocumentsContract.deleteDocument(getContentResolver(), uri);
    

    3、编辑文件

    private static final int EDIT_REQUEST_CODE = 44;
    /**
     * Open a file for writing and append some text to it.
     */
     private void editDocument() {
        // ACTION_OPEN_DOCUMENT is the intent to choose a file via the system's
        // file browser.
        Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
    
        // Filter to only show results that can be "opened", such as a
        // file (as opposed to a list of contacts or timezones).
        intent.addCategory(Intent.CATEGORY_OPENABLE);
    
        // Filter to show only text files.
        intent.setType("text/plain");
    
        startActivityForResult(intent, EDIT_REQUEST_CODE);
    }
    
    private void alterDocument(Uri uri) {
        try {
            ParcelFileDescriptor pfd = getActivity().getContentResolver().
                    openFileDescriptor(uri, "w");
            FileOutputStream fileOutputStream =
                    new FileOutputStream(pfd.getFileDescriptor());
            fileOutputStream.write(("Overwritten by MyCloud at " +
                    System.currentTimeMillis() + "\n").getBytes());
            // Let the document provider know you're done by closing the stream.
            fileOutputStream.close();
            pfd.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    

    4、检查最新的文件数据

    final int takeFlags = intent.getFlags()
                & (Intent.FLAG_GRANT_READ_URI_PERMISSION
                | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
    // Check for the freshest data.
    getContentResolver().takePersistableUriPermission(uri, takeFlags);
    

    四、拓展

    1、Android 7.0在存储访问框架中添加了虚拟文件的概念。
    2、即使虚拟文件没有二进制表示形式,您的客户端应用程序也可以通过将其强制转换为其他文件类型或使用ACTION_VIEW意图查看这些文件来打开其内容
    3、要打开虚拟文件,您的客户端应用程序需要包含特殊的逻辑来处理它们。如果要获取文件的字节表示形式(例如,预览文件),则需要从文档提供者处请求其他MIME类型。
    4、要在您的应用程序中获取虚拟文档的URI,首先要创建一个Intent以打开文件选择器UI,就像前面在Seach中为文档显示的代码一样。
    5、重要提示:由于应用无法使用openInputStream()方法直接打开虚拟文件,因此,如果您在ACTION_OPEN_DOCUMENT意向中包括CATEGORY_OPENABLE类别,则您的应用将不会收到任何虚拟文件。用户做出选择后,系统将调用onActivityResult()方法,如先前在处理结果中所示。您的应用可以检索文件的URI,然后使用类似于以下代码片段的方法来确定文件是否为虚拟文件。验证文件为虚拟文件后,可以将其强制转换为其他MIME类型,例如图像文件。以下代码段显示了如何检查虚拟文件是否可以表示为映像,如果可以,则从虚拟文件获取输入流。

    private boolean isVirtualFile(Uri uri) {
        if (!DocumentsContract.isDocumentUri(this, uri)) {
            return false;
        }
    
        Cursor cursor = getContentResolver().query(
            uri,
            new String[] { DocumentsContract.Document.COLUMN_FLAGS },
            null, null, null);
    
        int flags = 0;
        if (cursor.moveToFirst()) {
            flags = cursor.getInt(0);
        }
        cursor.close();
    
        return (flags & DocumentsContract.Document.FLAG_VIRTUAL_DOCUMENT) != 0;
    }
    
    
    private InputStream getInputStreamForVirtualFile(Uri uri, String mimeTypeFilter)
        throws IOException {
    
        ContentResolver resolver = getContentResolver();
    
        String[] openableMimeTypes = resolver.getStreamTypes(uri, mimeTypeFilter);
    
        if (openableMimeTypes == null ||
            openableMimeTypes.length < 1) {
            throw new FileNotFoundException();
        }
    
        return resolver
            .openTypedAssetFileDescriptor(uri, openableMimeTypes[0], null)
            .createInputStream();
    }
    
    
    展开全文
  • 很实用的dll文件工具 关于软件的使用说明和注册,如无特别说明本站软件全部为绿色软件 不用安装,解压及用,真正做到不给系统留任何垃圾!
  • android 打开预览不同类型文件

    千次阅读 2018-11-06 14:44:00
    调用手机app打开不同文件是会遇到上面问题,这是android从××版本开始要求访问权限,并要求通过URI访问文件。 先在AndroidManifest.xml文件添加fileprovider <provider android:name="android....

    exposed beyond app through Intent.getData() 

    调用手机app打开不同文件是会遇到上面问题,这是android从××版本开始要求访问权限,并要求通过URI访问文件。

    先在AndroidManifest.xml文件添加fileprovider

    <provider
        android:name="android.support.v4.content.FileProvider"
        android:authorities="app包名.fileprovider"
        android:exported="false"
    
        android:grantUriPermissions="true">
        <meta-data
           android:name="android.support.FILE_PROVIDER_PATHS"
           android:resource="@xml/file_paths"
        />
    </provider>
    
    //exported:要求必须为false,为true则会报安全异常。
    //grantUriPermissions:true,表示授予 URI 临时访问权限。

    在res资源目录下新建一个xml目录放入file_paths.xml文件

    <?xml version="1.0" encoding="utf-8"?>
    <paths>
        <external-path path="Android/data/com.data.cloudminds.disk/" name="files_root"/>
    
        <external-path path="." name="external_storage_root"/>
    
    </paths>

    上面配置好了现在上代码打开文件,只有传入文件路径即可

    import android.content.Context;
    import android.content.Intent;
    import android.net.Uri;
    import android.support.v4.content.FileProvider;
    import android.text.TextUtils;
    import android.util.Log;
    
    import java.io.File;
    import java.util.HashMap;
    import java.util.Map;
    
    public class MineType {
        static String TAG = "MineType";
        private static final String auther = "app包名.fileprovider";//与AndroidManifest.xml 保存一只
    
        public static String getMIMETypeString(File file) {
            String type = "*/*";
            String strings[] = file.getPath().split("/");
            String fName = strings[strings.length - 1];
            //获取后缀名前的分隔符"."在fName中的位置。
            int dotIndex = fName.lastIndexOf(".");
            if (dotIndex < 0) {
                return type;
            }
            dotIndex++;
            /* 获取文件的后缀名 */
            String end = fName.substring(dotIndex, fName.length()).toLowerCase();
            Log.d(TAG, "fName = " + fName + " dotIndex = " + dotIndex + " end = " + end);
            if (TextUtils.isEmpty(end)) return type;
            //在MIME和文件类型的匹配表中找到对应的MIME类型。
            for (int i = 0; i < MIME_MapTable.length; i++) {
                if (end.equals(MIME_MapTable[i][0]))
                    type = MIME_MapTable[i][1];
            }
            return type;
        }
    
        /**
         * 打开文件
         *
         * @param file
         */
        public static void openFile(Context context, File file) {
            //Uri uri = Uri.parse("file://"+file.getAbsolutePath());
            Intent intent = new Intent();
            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            //设置intent的Action属性
            intent.setAction(Intent.ACTION_VIEW);
            //获取文件file的MIME类型
            String type = getMIMETypeString(file);
            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
            Uri uri = FileProvider.getUriForFile(context, auther,file);
            //设置intent的data和Type属性。
            intent.setDataAndType(uri, type);
            //跳转
            context.startActivity(intent);
        }
    
        public static final String[][] MIME_MapTable = {
                //{后缀名,MIME类型}
                {"pbm", "image/x-portable-bitmap"},
                {"pcx", "image/x-pcx"},
                {"nbmp", "image/nbmp"},
                {"pda", "image/x-pda"},
                {"pgm", "image/x-portable-graymap"},
                {"pict", "image/x-pict"},
                {"png", "image/png"},
                {"pnm", "image/x-portable-anymap"},
                {"pnz", "image/png"},
                {"ppm", "image/x-portable-pixmap"},
                {"nokia-op-logo", "image/vnd.nok-oplogo-color"},
                {"qti", "image/x-quicktime"},
                {"qtif", "image/x-quicktime"},
                {"ras", "image/x-cmu-raster"},
                {"rf", "image/vnd.rn-realflash"},
                {"rp", "image/vnd.rn-realpix"},
                {"rgb", "image/x-rgb"},
                {"si9", "image/vnd.lgtwap.sis"},
                {"si7", "image/vnd.stiwap.sis"},
                {"svf", "image/vnd"},
                {"svg", "image/svg-xml"},
                {"svh", "image/svh"},
                {"si6", "image/si6"},
                {"tif", "image/tiff"},
                {"tiff", "image/tiff"},
                {"toy", "image/toy"},
                {"wbmp", "image/vnd.wap.wbmp"},
                {"wi", "image/wavelet"},
                {"wpng", "image/x-up-wpng"},
                {"xbm", "image/x-xbitmap"},
                {"xpm", "image/x-xpixmap"},
                {"xwd", "image/x-xwindowdump"},
                {"fh4", "image/x-freehand"},
                {"fh5", "image/x-freehand"},
                {"fhc", "image/x-freehand"},
                {"fif", "image/fif"},
                {"bmp", "image/bmp"},
                {"cal", "image/x-cals"},
                {"cod", "image/cis-cod"},
                {"fpx", "image/x-fpx"},
                {"dcx", "image/x-dcx"},
                {"eri", "image/x-eri"},
                {"gif", "image/gif"},
                {"ief", "image/ief"},
                {"ifm", "image/gif"},
                {"ifs", "image/ifs"},
                {"j2k", "image/j2k"},
                {"jpe", "image/jpeg"},
                {"jpeg", "image/jpeg"},
                {"jpg", "image/jpeg"},
                {"jpz", "image/jpeg"},
                {"mil", "image/x-cals"},
    
                {"3gp", "video/3gpp"},
                {"asf", "video/x-ms-asf"},
                {"asx", "video/x-ms-asf"},
                {"avi", "video/x-msvideo"},
                {"fvi", "video/isivideo"},
                {"lsf", "video/x-ms-asf"},
                {"lsx", "video/x-ms-asf"},
                {"m4u", "video/vnd.mpegurl"},
                {"m4v", "video/x-m4v"},
                {"pvx", "video/x-pv-pvx"},
                {"qt", "video/quicktime"},
                {"rv", "video/vnd.rn-realvideo"},
                {"viv", "video/vivo"},
                {"vivo", "video/vivo"},
                {"vdo", "video/vdo"},
                {"wm", "video/x-ms-wm"},
                {"wmx", "video/x-ms-wmx"},
                {"wv", "video/wavelet"},
                {"wvx", "video/x-ms-wvx"},
                {"mov", "video/quicktime"},
                {"movie", "video/x-sgi-movie"},
                {"mp4", "video/mp4"},
                {"mng", "video/x-mng"},
                {"mpe", "video/mpeg"},
                {"mpeg", "video/mpeg"},
                {"mpg video/mpeg"},
                {"mpg4", "video/mp4"},
    
                {"aif", "audio/x-aiff"},
                {"aifc", "audio/x-aiff"},
                {"aiff", "audio/x-aiff"},
                {"als", "audio/X-Alpha5"},
                {"au", "audio/basic"},
                {"es", "audio/echospeech"},
                {"esl", "audio/echospeech"},
                {"awb", "audio/amr-wb"},
                {"imy", "audio/melody"},
                {"it", "audio/x-mod"},
                {"itz", "audio/x-mod"},
                {"tsi", "audio/tsplayer"},
                {"ult", "audio/x-mod"},
                {"vib", "audio/vib"},
                {"vox", "audio/voxware"},
                {"vqe", "audio/x-twinvq-plugin"},
                {"vqf", "audio/x-twinvq"},
                {"vql", "audio/x-twinvq"},
                {"wav", "audio/x-wav"},
                {"wax", "audio/x-ms-wax"},
                {"wmv", "audio/x-ms-wmv"},
                {"wma", "audio/x-ms-wma"},
                {"xmz", "audio/x-mod"},
                {"m15", "audio/x-mod"},
                {"m3u", "audio/x-mpegurl"},
                {"m3url", "audio/x-mpegurl"},
                {"m4a", "audio/mp4a-latm"},
                {"m4b", "audio/mp4a-latm"},
                {"m4p", "audio/mp4a-latm"},
                {"ma1", "audio/ma1"},
                {"ma2", "audio/ma2"},
                {"ma3", "audio/ma3"},
                {"ma5", "audio/ma5"},
                {"mdz", "audio/x-mod"},
                {"mid", "audio/midi"},
                {"midi", "audio/midi"},
                {"mio", "audio/x-mio"},
                {"mod", "audio/x-mod"},
                {"mp2", "audio/x-mpeg"},
                {"mp3", "audio/x-mpeg"},
                {"mpga", "audio/mpeg"},
                {"ogg", "audio/ogg"},
                {"nsnd", "audio/nsnd"},
                {"pae", "audio/x-epac"},
                {"pac", "audio/x-pac"},
                {"qcp", "audio/vnd.qcelp"},
                {"ra", "audio/x-pn-realaudio"},
                {"ram", "audio/x-pn-realaudio"},
                {"rm", "audio/x-pn-realaudio"},
                {"rmf", "audio/x-rmf"},
                {"rmm", "audio/x-pn-realaudio"},
                {"rmvb", "audio/x-pn-realaudio"},
                {"rpm", "audio/x-pn-realaudio-plugin"},
                {"s3m", "audio/x-mod"},
                {"s3z", "audio/x-mod"},
                {"stm", "audio/x-mod"},
                {"smz", "audio/x-smd"},
                {"snd", "audio/basic"},
                {"smd", "audio/x-smd"},
                {"xm", "audio/x-mod"},
    
                {"c", "text/plain"},
                {"asc", "text/plain"},
                {"conf", "text/plain"},
                {"cpp", "text/plain"},
                {"css", "text/css"},
                {"dhtml", "text/html"},
                {"etx", "text/x-setext"},
                {"h", "text/plain"},
                {"hdm", "text/x-hdml"},
                {"hdml", "text/x-hdml"},
                {"htm", "text/html"},
                {"html", "text/html"},
                {"hts", "text/html"},
                {"jad", "text/vnd.sun.j2me.app-descriptor"},
                {"java", "text/plain"},
                {"log", "text/plain"},
                {"mel", "text/x-vmel"},
                {"mrl", "text/x-mrml"},
                {"prop", "text/plain"},
                {"r3t", "text/vnd.rn-realtext3d"},
                {"sgm", "text/x-sgml"},
                {"rc", "text/plain"},
                {"rtx", "text/richtext"},
                {"rt", "text/vnd.rn-realtext"},
                {"sgml", "text/x-sgml"},
                {"spc", "text/x-speech"},
                {"txt", "text/plain"},
                {"tsv", "text/tab-separated-values"},
                {"tsv", "text/tab-separated-values"},
                {"talk", "text/x-speech"},
                {"vcf", "text/x-vcard"},
                {"wml", "text/vnd.wap.wml"},
                {"wmls", "text/vnd.wap.wmlscript"},
                {"wmlscript", "text/vnd.wap.wmlscript"},
                {"ws", "text/vnd.wap.wmlscript"},
                {"xml", "text/xml"},
                {"xsit", "text/xml"},
                {"xsl", "text/xml"},
                {"xul", "text/xul"},
    
                {"apk", "application/vnd.android.package-archive"},
    
                {"aab", "application/x-authoware-bin"},
                {"aam", "application/x-authoware-map"},
                {"aas", "application/x-authoware-seg"},
                {"ai", "application/postscript"},
                {"amc", "application/x-mpeg"},
                {"ani", "application/octet-stream"},
                {"asd", "application/astound"},
                {"asn", "application/astound"},
                {"asp", "application/x-asap"},
                {"avb", "application/octet-stream"},
                {"bcpio", "application/x-bcpio"},
                {"bin", "application/octet-stream"},
                {"bld", "application/bld"},
                {"bld2", "application/bld2"},
                {"bpk", "application/octet-stream"},
                {"bz2", "application/x-bzip2"},
                {"ccn", "application/x-cnc"},
                {"cco", "application/x-cocoa"},
                {"cdf", "application/x-netcdf"},
                {"chat", "application/x-chat"},
                {"class", "application/octet-stream"},
                {"clp", "application/x-msclip"},
                {"cmx", "application/x-cmx"},
                {"co", "application/x-cult3d-object"},
                {"cpio", "application/x-cpio"},
                {"cpt", "application/mac-compactpro"},
                {"crd", "application/x-mscardfile"},
                {"csh", "application/x-csh"},
                {"cur", "application/octet-stream"},
                {"dcr", "application/x-director"},
                {"dir", "application/x-director"},
                {"dll", "application/octet-stream"},
                {"dmg", "application/octet-stream"},
                {"dms", "application/octet-stream"},
                {"doc", "application/msword"},
                {"docx", "application/vnd.openxmlformats-officedocument.wordprocessingml.document"},
                {"dot", "application/x-dot"},
                {"dvi", "application/x-dvi"},
                {"dwg", "application/x-autocad"},
                {"dxf", "application/x-autocad"},
                {"dxr", "application/x-director"},
                {"ebk", "application/x-expandedbook"},
                {"eps", "application/postscript"},
                {"evy", "application/x-envoy"},
                {"exe", "application/octet-stream"},
                {"etc", "application/x-earthtime"},
                {"fm", "application/x-maker"},
                {"gps", "application/x-gps"},
                {"gtar", "application/x-gtar"},
                {"gz", "application/x-gzip"},
                {"gca", "application/x-gca-compressed"},
                {"hdf", "application/x-hdf"},
                {"hlp", "application/winhlp"},
                {"hqx", "application/mac-binhex40"},
                {"ico", "application/octet-stream"},
                {"ins", "application/x-NET-Install"},
                {"ips", "application/x-ipscript"},
                {"ipx", "application/x-ipix"},
                {"jam", "application/x-jam"},
                {"jar", "application/java-archive"},
                {"jnlp", "application/x-java-jnlp-file"},
                {"latex", "application/x-latex"},
                {"lcc", "application/fastman"},
                {"lcl", "application/x-digitalloca"},
                {"lcr", "application/x-digitalloca"},
                {"lgh", "application/lgh"},
                {"lha", "application/octet-stream"},
                {"js", "application/x-javascript"},
                {"jwc", "application/jwc"},
                {"kjx", "application/x-kjx"},
                {"lzh", "application/x-lzh"},
                {"m13", "application/x-msmediaview"},
                {"m14", "application/x-msmediaview"},
                {"man", "application/x-troff-man"},
                {"mbd", "application/mbedlet"},
                {"mct", "application/x-mascot"},
                {"mdb", "application/x-msaccess"},
                {"me", "application/x-troff-me"},
                {"mi", "application/x-mif"},
                {"mif", "application/x-mif"},
                {"mmf", "application/x-skt-lbs"},
                {"mny", "application/x-msmoney"},
                {"moc", "application/x-mocha"},
                {"mocha", "application/x-mocha"},
                {"mpn", "application/vnd.mophun.application"},
                {"mpc", "application/vnd.mpohun.certificate"},
                {"mof", "application/x-yumekara"},
                {"mpp", "application/vnd.ms-project"},
                {"mps", "application/x-mapserver"},
                {"mrm", "application/x-mrm"},
                {"ms", "application/x-troff-ms"},
                {"msg", "application/vnd.ms-outlook"},
                {"mts", "application/metastream"},
                {"mtx", "application/metastream"},
                {"mtz", "application/metastream"},
                {"mzv", "application/metastream"},
                {"nar", "application/zip"},
                {"nc", "application/x-netcdf"},
                {"ndwn", "application/ndwn"},
                {"nif", "application/x-nif"},
                {"nmz", "application/x-scream"},
                {"npx", "application/x-netfpx"},
                {"nva", "application/x-neva1"},
                {"oda", "application/oda"},
                {"oom", "application/x-AtlasMate-Plugin"},
                {"pan", "application/x-pan"},
                {"pdf", "application/pdf"},
                {"pfr", "application/font-tdpfr"},
                {"pm", "application/x-perl"},
                {"pmd", "application/x-pmd"},
                {"pot", "application/vnd.ms-powerpoint"},
                {"pps", "application/vnd.ms-powerpoint"},
                {"ppt", "application/vnd.ms-powerpoint"},
                {"pptx", "application/vnd.openxmlformats-officedocument.presentationml.presentation"},
                {"pqf", "application/x-cprplayer"},
                {"pqi", "application/cprplayer"},
                {"proxy", "application/x-ns-proxy-autoconfig"},
                {"ps", "application/postscript"},
                {"ptlk", "application/listenup"},
                {"pub", "application/x-mspublisher"},
                {"prc", "application/x-prc"},
                {"rar", "application/x-rar-compressed"},
                {"rdf", "application/rdf+xml"},
                {"rlf", "application/x-richlink"},
                {"rnx", "application/vnd.rn-realplayer"},
                {"roff", "application/x-troff"},
                {"rtf", "application/rtf"},
                {"rtg", "application/metastream"},
                {"rwc", "application/x-rogerwilco"},
                {"sca", "application/x-supercard"},
                {"scd", "application/x-msschedule"},
                {"sdf", "application/e-score"},
                {"sea", "application/x-stuffit"},
                {"sh", "application/x-sh"},
                {"shw", "application/presentations"},
                {"shar", "application/x-shar"},
                {"sis", "application/vnd.symbian.install"},
                {"sit", "application/x-stuffit"},
                {"skd", "application/x-Koan"},
                {"skm", "application/x-Koan"},
                {"skp", "application/x-Koan"},
                {"skt", "application/x-Koan"},
                {"slc", "application/x-salsa"},
                {"smi", "application/smil"},
                {"smil", "application/smil"},
                {"smp", "application/studiom"},
                {"spl", "application/futuresplash"},
                {"spr", "application/x-sprite"},
                {"sprite", "application/x-sprite"},
                {"spt", "application/x-spt"},
                {"src", "application/x-wais-source"},
                {"stk", "application/hyperstudio"},
                {"sv4cpio", "application/x-sv4cpio"},
                {"sv4crc", "application/x-sv4crc"},
                {"swf", "application/x-shockwave-flash"},
                {"swfl", "application/x-shockwave-flash"},
                {"t", "application/x-troff"},
                {"tad", "application/octet-stream"},
                {"tar", "application/x-tar"},
                {"taz", "application/x-tar"},
                {"tbp", "application/x-timbuktu"},
                {"tbt", "application/x-timbuktu"},
                {"tcl", "application/x-tcl"},
                {"tex", "application/x-tex"},
                {"texi", "application/x-texinfo"},
                {"texinfo", "application/x-texinfo"},
                {"tgz", "application/x-tar"},
                {"thm", "application/vnd.eri.thm"},
                {"tki", "application/x-tkined"},
                {"tkined", "application/x-tkined"},
                {"toc", "application/toc"},
                {"tr", "application/x-troff"},
                {"trm", "application/x-msterminal"},
                {"tsp", "application/dsptype"},
                {"ttf", "application/octet-stream"},
                {"ttz", "application/t-time"},
                {"ustar", "application/x-ustar"},
                {"uu", "application/x-uuencode"},
                {"uue", "application/x-uuencode"},
                {"vcd", "application/x-cdlink"},
                {"vmd", "application/vocaltec-media-desc"},
                {"vmf", "application/vocaltec-media-file"},
                {"vmi", "application/x-dreamcast-vms-info"},
                {"vms", "application/x-dreamcast-vms"},
                {"wis", "application/x-InstallShield"},
                {"wmd", "application/x-ms-wmd"},
                {"wmf", "application/x-msmetafile"},
                {"wmlc", "application/vnd.wap.wmlc"},
                {"wmlsc", "application/vnd.wap.wmlscriptc"},
                {"wps", "application/vnd.ms-works"},
                {"wmz", "application/x-ms-wmz"},
                {"wri", "application/x-mswrite"},
                {"web", "application/vnd.xara"},
                {"wsc", "application/vnd.wap.wmlscriptc"},
                {"wxl", "application/x-wxl"},
                {"x-gzip", "application/x-gzip"},
                {"xar", "application/vnd.xara"},
                {"xdm", "application/x-xdma"},
                {"xdma", "application/x-xdma"},
                {"xdw", "application/vnd.fujixerox.docuworks"},
                {"xht", "application/xhtml+xml"},
                {"xhtm", "application/xhtml+xml"},
                {"xhtml", "application/xhtml+xml"},
                {"xla", "application/vnd.ms-excel"},
                {"xlc", "application/vnd.ms-excel"},
                {"xll", "application/x-excel"},
                {"xlm", "application/vnd.ms-excel"},
                {"xls", "application/vnd.ms-excel"},
                {"xlt", "application/vnd.ms-excel"},
                {"xlw", "application/vnd.ms-excel"},
                {"xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},
                {"xpi", "application/x-xpinstall"},
                {"yz1", "application/x-yz1"},
                {"z", "application/x-compress"},
                {"zac", "application/x-zaurus-zac"},
                {"zip", "application/zip"},
    
                {"gau", "chemical/x-gaussian-input"},
                {"csm", "chemical/x-csml"},
                {"csml", "chemical/x-csml"},
                {"emb", "chemical/x-embl-dl-nucleotide"},
                {"embl", "chemical/x-embl-dl-nucleotide"},
                {"mol", "chemical/x-mdl-molfile"},
                {"pdb", "chemical/x-pdb"},
                {"xyz", "chemical/x-pdb"},
                {"mop", "chemical/x-mopac-input"},
    
                {"dcm", "x-lml/x-evm"},
                {"evm", "x-lml/x-evm"},
                {"gdb", "x-lml/x-gdb"},
                {"lak", "x-lml/x-lak"},
                {"lml", "x-lml/x-lml"},
                {"lmlpack", "x-lml/x-lmlpack"},
                {"ndb", "x-lml/x-ndb"},
                {"rte", "x-lml/x-gps"},
                {"wpt", "x-lml/x-gps"},
                {"trk", "x-lml/x-gps"},
    
                {"svr", "x-world/x-svr"},
                {"ivr", "i-world/i-vrml"},
                {"vre", "x-world/x-vream"},
                {"vrml", "x-world/x-vrml"},
                {"vrt", "x-world/x-vrt"},
                {"vrw", "x-world/x-vream"},
                {"vts", "workbook/formulaone"},
                {"wrl", "x-world/x-vrml"},
                {"wrz", "x-world/x-vrml"},
    
                {"dwf", "drawing/x-dwf"},
                {"ice", "x-conference/x-cooltalk"},
                {"map", "magnus-internal/imagemap"},
                {"shtml", "magnus-internal/parsed-html"},
                {"cgi", "magnus-internal/cgi"},
    
                {"", "*/*"}
        };
    
    }
    

     

    展开全文
  • 今天在安装apk文件到虚拟机时又遇到了两个问题,google完后解决问题了,现在汇总补充总结如下,希望对大家有所帮助:安装APK文件Android虚拟机一、把APK文件复制到Android虚拟机目录下的tools文件夹下。...
  • android 打开各种文件(setDataAndType)

    万次阅读 2014-11-04 11:52:38
     * 打开文件  * @param file  */  private void openFile(File file){     Intent intent = new Intent();   intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);   //设置intent的Action属性
  • 如何将Unity中的脚本文件转为dll文件

    万次阅读 多人点赞 2016-06-23 21:57:25
    本篇文章讨论的是如何吧unity中的脚本文件转为dll文件 如果想使用unity的api,则需要引入unity的,分别是 UnityEditor.dll 和 UnityEngine.dll,它们的地址如下: 这时候该把dll文件引入进来 下面就在...
  • android打开文件方法

    千次阅读 2012-03-23 10:39:02
    通过MIME type的不同用系统含有的程序打开 Uri uri = Uri.parse("file://" + filePath); Intent intent = new Intent(); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(Intent.ACTION_VIEW...
  • [java] view plain copy //打开文件时调用 public void openFiles(String filesPath) { Uri uri = Uri.parse("file://" + filesPath); Intent intent = new Intent(); intent.addFlags(Int
  • 简单Unity 3D游戏加密dll文件提取

    千次阅读 2018-09-02 14:23:02
    大多数游戏都是使用Unity 3D做的,我们逆向分析主要分析\assets\bin\Data\Managed中的Assembly-CSharp.dll文件,当我们用.NET Reflector 或者dnSpy 打开Assembly-CSharp.dll文件时,有时候会发现什么信息也看不到,...
  • 近期做了一个小应用,打包好后在自己...今天从新打开测试,把单个exe拷至桌面安装,发现也报错,这才明白打包的exe文件需要和自动生成的XXX-data文件夹和unityplayer.dll文件一起拷过去才能正常安装。(上述两个文...
  • 我在写android资源管理器(文件浏览器)的时候,希望能在资源管理器的中实现打开文件的操作,此时就需要用到文件的MIME类型。 实现方法: private void openFile(File file){ //Uri uri = Uri.parse("file:...
  • 1.C/C++动态库的编写下面是我编写的一个比较简单的C++dll文件用来测试,关于如何编写dll文件,我这里便不再赘述,不懂得自行查询,(1).h文件#ifdef MYDLL_EXPORTS#define MYDLL_API __declspec(dllexport)#else#...
  • 有一个报警灯的dll文件,程序报错的时候要使报警灯报警,现在要在页面上使用js去调用这个dll文件,求大神们帮帮我!
  • 在命令行模式下尝试打开adb,出现一个弹出框:未安装AdbWinApi....platform-tools找到adb.exe和AdbWinApi.dll,把它复制到C:\Windows\System32目录里,如果没有这两个文件,我上传了一个rar包,下载解压再复制进去就行
  • android 添加文件打开方式

    千次阅读 2013-04-25 11:42:55
    比如通过文档查看器打开一个文本文件时,会弹出一个可用来打开的软件列表; 如何让自己的软件也出现在该列表中呢? 通过设置AndroidManifest.xml文件即可: 第一个标签是每个程序都有的...
  • uniyt android DLL加密

    2018-10-29 20:03:25
    注意这个加密只适合android端加密,DLL热更新和简单加密。 参考教程:https://www.xuanyusong.com/archives/3553 安装ndk方法,打开控制台输入: cd '/home/xujing/DLLFile' ./android-ndk-r10e-linux-x86_64.bin...
  • 3、单击 “打开” 按钮,选择Unity3d 安装目录下的dll文件,导入ILSpy中,即可查看所有dll文件内容,截图如下 二、效果展示 效果一 效果二 效果三 到这,就可以完全实现unity3d中dll文件的反编译。
  • Unity3D 08-Android加密DLL

    2017-06-30 17:12:05
    Mono 加载 Assembly-CSharp.dll 的时候就是读取文件到内存中,和平时读取一个 游戏资源 文件没什么区别。 为了防止别人破解,我们会对游戏资源加密,简单点的 比如修改文件的一个字节 或者 位移一下 。只
  • Unity3D之Android加密DLL与破解DLL

    千次阅读 2017-02-28 21:28:44
    1.加密方案 Unity 3D项目游戏逻辑采用C#脚本,我们知道C#编译生成的DLL或EXE是IL程序集。IL程序集中有一个MetaData,记录了...当我们得到APK包的时候,其实他就是一个压缩文件,类似zip,rar等,我们把后缀“.apk”
  • android intent打开各种文件的方法

    千次阅读 2014-12-08 17:37:58
    通过MIME type的不同用系统含有的程序打开 [java] view plaincopy Uri uri = Uri.parse("file://" + filePath);  Intent intent = new Intent();  intent.addFlags(Intent.FLAG...
  • unity3d 调用C++中DLL文件

    千次阅读 2013-07-01 15:54:18
    Unity 3D 调用DLL的方法 接触Unity 3D 时间不长,看到网上有人问怎么通过Unity来调用Dll,而且发现这个问题似乎是用unity的朋友并不熟悉DLL的使用造成的,正好我使用过C++,对DLL还比较熟悉,因此写了一个...
  • 如果开发的时候按之前的一个Hotfix工程,...ILRuntime的原理就是热更代码单独生成一个dll文件,然后Unity启动的时候读取这个dll文件,热更新的时候只需要热更dll文件即可。之前的Hotfix工程就是把工程内的代码导成dl...
  • //Android获取一个用于打开VIDEO文件的intent    public static Intent getVideoFileIntent( String param ) {        Intent intent =  new Intent( "android.intent.action.VIEW" );...
  • 2020-08-11 15:45:00 浏览量:7000apk文件一般都是安卓手机的软件,当然,我们也可以用windows系统打开。但是苹果系统怎么办呢?有些朋友想要通过苹果电脑玩安卓的手机游戏,却不知道从何下手,那么apk文件用苹果...
  • 转自:http://www.cppblog.com/longzxr/archive/2009/12/04/102565.html?opt=admin今天调试OpenGl的源程序,编译通过,但一运行就提示,计算机丢失 glut32.dll文件,郁闷的不行,上网查了下,网上提供的绝大多是做法...
  • Unity编程笔录--Unity Android加密dll

    千次阅读 2015-11-14 18:08:14
    前言: 以前写过Unity加密apk的方法,但是那只是非常初级的,现在使用了不同的方法,... http://www.luzexi.com/unity3d/游戏架构/前端技术/2015/04/11/Unity3D-重新编译Mono加密DLL/   正文: 1:下载必要工具 mo

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 9,052
精华内容 3,620
关键字:

安卓打开dll文件