解析android截屏问题

我是基于android2.3.3系统之上的,想必大家应该知道在android源码下面有个文件叫做screencap吧,位于frameworks\base\services\surfaceflinger\tests\screencap\screencap.cpp,你直接在linux下编译(保存在 /system/bin/test-screencap),然后push到手机上再通过电脑去敲命令test-screencap /mnt/sdcard/scapxx.png就可以实现截屏。


代码如下:

/*
  * Copyright (C) 2010 The Android Open Source Project
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *      http://www.apache.org/licenses/LICENSE-2.0
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */

#include <utils/Log.h>

#include <binder/IPCThreadState.h>
 #include <binder/ProcessState.h>
 #include <binder/IServiceManager.h>

#include <binder/IMemory.h>
 #include <surfaceflinger/ISurfaceComposer.h>

#include <SkImageEncoder.h>
 #include <SkBitmap.h>

using namespace android;

int main(int argc, char** argv)
 {
     if (argc != 2) {
         printf("usage: %s path\n", argv[0]);
         exit(0);
     }

const String16 name("SurfaceFlinger");
     sp<ISurfaceComposer> composer;
     getService(name, &composer);

sp<IMemoryHeap> heap;
     uint32_t w, h;
     PixelFormat f;
     status_t err = composer->captureScreen(0, &heap, &w, &h, &f, 0, 0);
     if (err != NO_ERROR) {
         fprintf(stderr, "screen capture failed: %s\n", strerror(-err));
         exit(0);
     }

printf("screen capture success: w=%u, h=%u, pixels=%p\n",
             w, h, heap->getBase());

printf("saving file as PNG in %s ...\n", argv[1]);

SkBitmap b;
     b.setConfig(SkBitmap::kARGB_8888_Config, w, h);
     b.setPixels(heap->getBase());
     SkImageEncoder::EncodeFile(argv[1], b,
             SkImageEncoder::kPNG_Type, SkImageEncoder::kDefaultQuality);

return 0;
 }

其实这个程序真正用到的就是一个叫做capturescreen的函数,而capturescreen会调用captureScreenImplLocked这个函数
下面是代码:


代码如下:

status_t SurfaceFlinger::captureScreenImplLocked(DisplayID dpy,
         sp<IMemoryHeap>* heap,
         uint32_t* w, uint32_t* h, PixelFormat* f,
         uint32_t sw, uint32_t sh)
 {
    LOGI("captureScreenImplLocked");
     status_t result = PERMISSION_DENIED;

// only one display supported for now
     if (UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
         return BAD_VALUE;

if (!GLExtensions::getInstance().haveFramebufferObject())
         return INVALID_OPERATION;

// get screen geometry
     const DisplayHardware& hw(graphicPlane(dpy).displayHardware());
     const uint32_t hw_w = hw.getWidth();
     const uint32_t hw_h = hw.getHeight();

if ((sw > hw_w) || (sh > hw_h))
         return BAD_VALUE;

sw = (!sw) ? hw_w : sw;
     sh = (!sh) ? hw_h : sh;
     const size_t size = sw * sh * 4;

// make sure to clear all GL error flags
     while ( glGetError() != GL_NO_ERROR ) ;

// create a FBO
     GLuint name, tname;
     glGenRenderbuffersOES(1, &tname);
     glBindRenderbufferOES(GL_RENDERBUFFER_OES, tname);
     glRenderbufferStorageOES(GL_RENDERBUFFER_OES, GL_RGBA8_OES, sw, sh);
     glGenFramebuffersOES(1, &name);
     glBindFramebufferOES(GL_FRAMEBUFFER_OES, name);
     glFramebufferRenderbufferOES(GL_FRAMEBUFFER_OES,
             GL_COLOR_ATTACHMENT0_OES, GL_RENDERBUFFER_OES, tname);

GLenum status = glCheckFramebufferStatusOES(GL_FRAMEBUFFER_OES);
     if (status == GL_FRAMEBUFFER_COMPLETE_OES) {

// invert everything, b/c glReadPixel() below will invert the FB
         glViewport(0, 0, sw, sh);
         glScissor(0, 0, sw, sh);
         glMatrixMode(GL_PROJECTION);
         glPushMatrix();
         glLoadIdentity();
         glOrthof(0, hw_w, 0, hw_h, 0, 1);
         glMatrixMode(GL_MODELVIEW);

// redraw the screen entirely...
         glClearColor(0,0,0,1);
         glClear(GL_COLOR_BUFFER_BIT);

const Vector< sp<LayerBase> >& layers(mVisibleLayersSortedByZ);
         const size_t count = layers.size();
         for (size_t i=0 ; i<count ; ++i) {
             const sp<LayerBase>& layer(layers[i]);
             layer->drawForSreenShot();
         }

// XXX: this is needed on tegra
         glScissor(0, 0, sw, sh);

// check for errors and return screen capture
         if (glGetError() != GL_NO_ERROR) {
             // error while rendering
             result = INVALID_OPERATION;
         } else {
             // allocate shared memory large enough to hold the
             // screen capture
             sp<MemoryHeapBase> base(
                     new MemoryHeapBase(size, 0, "screen-capture") );
             void* const ptr = base->getBase();
             if (ptr) {
                 // capture the screen with glReadPixels()
                 glReadPixels(0, 0, sw, sh, GL_RGBA, GL_UNSIGNED_BYTE, ptr);
                 if (glGetError() == GL_NO_ERROR) {
                     *heap = base;
                     *w = sw;
                     *h = sh;
                     *f = PIXEL_FORMAT_RGBA_8888;
                     result = NO_ERROR;
                 }
             } else {
                 result = NO_MEMORY;
             }
         }
         glEnable(GL_SCISSOR_TEST);
         glViewport(0, 0, hw_w, hw_h);
         glMatrixMode(GL_PROJECTION);
         glPopMatrix();
         glMatrixMode(GL_MODELVIEW);

} else {
         result = BAD_VALUE;
     }

// release FBO resources
     glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0);
     glDeleteRenderbuffersOES(1, &tname);
     glDeleteFramebuffersOES(1, &name);

hw.compositionComplete();

return result;
 }

status_t SurfaceFlinger::captureScreen(DisplayID dpy,
         sp<IMemoryHeap>* heap,
         uint32_t* width, uint32_t* height, PixelFormat* format,
         uint32_t sw, uint32_t sh)
 {
            LOGI("into captureScreen");          
     // only one display supported for now
     if (UNLIKELY(uint32_t(dpy) >= DISPLAY_COUNT))
         return BAD_VALUE;

if (!GLExtensions::getInstance().haveFramebufferObject())
         return INVALID_OPERATION;

class MessageCaptureScreen : public MessageBase {
         SurfaceFlinger* flinger;
         DisplayID dpy;
         sp<IMemoryHeap>* heap;
         uint32_t* w;
         uint32_t* h;
         PixelFormat* f;
         uint32_t sw;
         uint32_t sh;
         status_t result;
     public:
         MessageCaptureScreen(SurfaceFlinger* flinger, DisplayID dpy,
                 sp<IMemoryHeap>* heap, uint32_t* w, uint32_t* h, PixelFormat* f,
                 uint32_t sw, uint32_t sh)
             : flinger(flinger), dpy(dpy),
               heap(heap), w(w), h(h), f(f), sw(sw), sh(sh), result(PERMISSION_DENIED)
         {

}
         status_t getResult() const {
            LOGI("getResult()");          
          return result;
         }
         virtual bool handler() {

LOGI("handler()");
             Mutex::Autolock _l(flinger->mStateLock);

// if we have secure windows, never allow the screen capture
             if (flinger->mSecureFrameBuffer)
                 return true;

result = flinger->captureScreenImplLocked(dpy,
                     heap, w, h, f, sw, sh);

return true;
         }
     };
    LOGI("before messagecapturescreen");
     sp<MessageBase> msg = new MessageCaptureScreen(this,
             dpy, heap, width, height, format, sw, sh);
     status_t res = postMessageSync(msg);
     if (res == NO_ERROR) {
         res = static_cast<MessageCaptureScreen*>( msg.get() )->getResult();
     }
     return res;
 }

而这个函数关键又使用了opengl的几个函数去获得图片,然而opengl又去read framebuffer(这是我的理解)。如果你去用jni调用so的方法去截屏的话,就可以把screencap这个文件稍微修改一下然后做成so文件。

主要是补充一下怎么去存放文件与编译吧,当然我说的方法只是我做的方法不代表是很好用的。

存放:在eclipse新建一个android工程,保存后找到这个工程(如screencap)的存放位置 然后把这个文件放到android源代码的development文件里面,然后在你的那个工程文件里面新建一个文件夹,名字叫做jni(这个文件夹平行于src文件夹,screencap/jni),把上面博客提到的那个C++跟mk(screencap/jni/com_android_ScreenCap_ScreenCapNative.cpp和screencap/jni/Android.mk)文件放进去,最后在把编译的mk文件放在screencap目录下(screencap/Android.mk);

编译:编译是个很伟大的工程,需要你花大量的时间与精力。直接在终端进入工程存放的所在位置,我的是Administrator/Android.2.3.3/development,然后mm(Builds all of the modules in the current directory),如果成功,那么你运气比较好,在终端回提示你APK保存的位置。push进手机试一试。但是往往是不成功的。你可能会遇到一些问题,比如android.permission.ACCESS_SURFACE_FLINGER ,android.permission.READ_FRAME_BUFFER(因为capturescrren这个函数是surfaceflinger里面的函数,然而surfaceflinger里面的opengl截屏函数会去读取framebuffer),相关源代码是:


代码如下:

status_t SurfaceFlinger::onTransact(
     uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
 {

switch (code) {
         case CREATE_CONNECTION:
         case OPEN_GLOBAL_TRANSACTION:
         case CLOSE_GLOBAL_TRANSACTION:
         case SET_ORIENTATION:
         case FREEZE_DISPLAY:
         case UNFREEZE_DISPLAY:
         case BOOT_FINISHED:
         case TURN_ELECTRON_BEAM_OFF:
         case TURN_ELECTRON_BEAM_ON:
         {
             // codes that require permission check
             IPCThreadState* ipc = IPCThreadState::self();
             const int pid = ipc->getCallingPid();
             const int uid = ipc->getCallingUid();
             if ((uid != AID_GRAPHICS) && !mAccessSurfaceFlinger.check(pid, uid)) {
                 LOGE("Permission Denial: "
                         "can't access SurfaceFlinger pid=%d, uid=%d", pid, uid);
                 return PERMISSION_DENIED;
             }
             break;
         }
         case CAPTURE_SCREEN:
         {
             // codes that require permission check
             IPCThreadState* ipc = IPCThreadState::self();
             const int pid = ipc->getCallingPid();
             const int uid = ipc->getCallingUid();
             if ((uid != AID_GRAPHICS) && !mReadFramebuffer.check(pid, uid)) {

LOGE("Permission Denial: "
                         "can't read framebuffer pid=%d, uid=%d", pid, uid);
                 return PERMISSION_DENIED;
             }

break;
         }
     }

status_t err = BnSurfaceComposer::onTransact(code, data, reply, flags);
     if (err == UNKNOWN_TRANSACTION || err == PERMISSION_DENIED) {
         CHECK_INTERFACE(ISurfaceComposer, data, reply);
         if (UNLIKELY(!mHardwareTest.checkCalling())) {
             IPCThreadState* ipc = IPCThreadState::self();
             const int pid = ipc->getCallingPid();
             const int uid = ipc->getCallingUid();

LOGI("err");
             LOGE("Permission Denial: "
                     "can't access SurfaceFlinger pid=%d, uid=%d", pid, uid);
             return PERMISSION_DENIED;
         }
         int n;
         switch (code) {
             case 1000: // SHOW_CPU, NOT SUPPORTED ANYMORE
             case 1001: // SHOW_FPS, NOT SUPPORTED ANYMORE
                 return NO_ERROR;
             case 1002:  // SHOW_UPDATES
                 n = data.readInt32();
                 mDebugRegion = n ? n : (mDebugRegion ? 0 : 1);
                 return NO_ERROR;
             case 1003:  // SHOW_BACKGROUND
                 n = data.readInt32();
                 mDebugBackground = n ? 1 : 0;
                 return NO_ERROR;
             case 1004:{ // repaint everything
                 Mutex::Autolock _l(mStateLock);
                 const DisplayHardware& hw(graphicPlane(0).displayHardware());
                 mDirtyRegion.set(hw.bounds()); // careful that's not thread-safe
                 signalEvent();
                 return NO_ERROR;
             }
             case 1005:{ // force transaction
                 setTransactionFlags(eTransactionNeeded|eTraversalNeeded);
                 return NO_ERROR;
             }
             case 1006:{ // enable/disable GraphicLog
                 int enabled = data.readInt32();
                 GraphicLog::getInstance().setEnabled(enabled);
                 return NO_ERROR;
             }
             case 1007: // set mFreezeCount
                 mFreezeCount = data.readInt32();
                 mFreezeDisplayTime = 0;
                 return NO_ERROR;
             case 1010:  // interrogate.
                 reply->writeInt32(0);
                 reply->writeInt32(0);
                 reply->writeInt32(mDebugRegion);
                 reply->writeInt32(mDebugBackground);
                 return NO_ERROR;
             case 1013: {
                 Mutex::Autolock _l(mStateLock);
                 const DisplayHardware& hw(graphicPlane(0).displayHardware());
                 reply->writeInt32(hw.getPageFlipCount());
             }
             return NO_ERROR;
         }
     }
     return err;
 }

这个仅仅只是开始!  你会发现你即使在xml里面添加相应的权限仍然会有这个问题出现,为什么呢?在packageManger文件里面发现相关代码:


代码如下:

int checkSignaturesLP(Signature[] s1, Signature[] s2) {
        if (s1 == null) {
            return s2 == null
                    ? PackageManager.SIGNATURE_NEITHER_SIGNED
                    : PackageManager.SIGNATURE_FIRST_NOT_SIGNED;
        }
        if (s2 == null) {
            return PackageManager.SIGNATURE_SECOND_NOT_SIGNED;
        }
        HashSet<Signature> set1 = new HashSet<Signature>();
        for (Signature sig : s1) {
            set1.add(sig);
        }
        HashSet<Signature> set2 = new HashSet<Signature>();
        for (Signature sig : s2) {
            set2.add(sig);
        }
        // Make sure s2 contains all signatures in s1.
        if (set1.equals(set2)) {
            return PackageManager.SIGNATURE_MATCH;
        }
        return PackageManager.SIGNATURE_NO_MATCH;
    }

// Check for shared user signatures
        if (pkgSetting.sharedUser != null && pkgSetting.sharedUser.signatures.mSignatures != null) {
            if (checkSignaturesLP(pkgSetting.sharedUser.signatures.mSignatures,
                    pkg.mSignatures) != PackageManager.SIGNATURE_MATCH) {
                Slog.e(TAG, "Package " + pkg.packageName
                        + " has no signatures that match those in shared user "
                        + pkgSetting.sharedUser.name + "; ignoring!");
                mLastScanError = PackageManager.INSTALL_FAILED_SHARED_USER_INCOMPATIBLE;
                return false;
            }
        }
        return true;

private boolean verifySignaturesLP(PackageSetting pkgSetting,
            PackageParser.Package pkg) {

// Check for shared user signatures
        if (pkgSetting.sharedUser != null && pkgSetting.sharedUser.signatures.mSignatures != null) {

if (checkSignaturesLP(pkgSetting.sharedUser.signatures.mSignatures,
                    pkg.mSignatures) != PackageManager.SIGNATURE_MATCH) {

Slog.e(TAG, "Package " + pkg.packageName
                        + " has no signatures that match those in shared user "
                        + pkgSetting.sharedUser.name + "; ignoring!");
                mLastScanError = PackageManager.INSTALL_FAILED_SHARED_USER_INCOMPATIBLE;
                return false;

}
        }
        return true;
    }

你在终端输入adb logcat | grep PackageManager 你会发现这两个权限根本没有赋予给你的apk,我的理解是,程序需要权限,然后apk仍然需要权限。那怎么样给apk赋予权限呢,两个方法,一个是在我上面说的screencap/Android.mk里面添加platform一行,然后在回到mm。还有一个方法就是通过sign。这两个方法都是给apk赋予system权限,但是我试过这两种方法,都有问题,就是在adb install的时候会显示签名不兼容,查看源代码会发现uid跟gid不匹配。这些是我这段时间发现的问题,大家有问题可以交流交流。
再说说几个简单的应用层截屏吧,很简单,就是几个函数调用而已


代码如下:

View view = getWindow().getDecorView();  
       Display display = this.getWindowManager().getDefaultDisplay();  
       view.layout(0, 0, display.getWidth(), display.getHeight());  
       view.setDrawingCacheEnabled(true);//允许当前窗口保存缓存信息,这样  getDrawingCache()方法才会返回一个Bitmap  
       Bitmap bmp = Bitmap.createBitmap(view.getDrawingCache());

我对这个程序的理解就是,它仅仅只能截取当前的activity,也就是说如果你运行这个程序后它就截取你这个程序的当前屏幕的信息。我们假设你做成一个按钮,在点击按钮后sleep5秒再调用这个方法(假设你的activity叫做screen)。当你点击按钮以后,然后你再点击home或者返回按钮,等到5秒后你那个程序就会截取到你当前屏幕?不是!它只会截取那个运行于后台的screen这个activity。

这些只是我的一点小小的总结,而且肯定有不对的地方,希望大家一起来解决截屏的问题!

(0)

相关推荐

  • Android 屏幕截屏方法汇总

    1.直接使用getWindow().getDecorView().getRootView() 直接使用getWindow().getDecorView().getRootView()是获取当前屏幕的activity.然而对于系统状态栏的信息是截不了,出现一条空白的.如下图: 主要到没,有一条白色边就是系统状态栏.看一下代码,很简单都加了注释了. //这种方法状态栏是空白,显示不了状态栏的信息 private void saveCurrentImage() { //获取当前屏幕的大小 int wi

  • Android实现截屏并保存操作功能

    该篇文章是说明在Android手机或平板电脑中如何实现截取当前屏幕的功能,并把截取的屏幕保存到SDCard中的某个目录文件夹下面. 实现的代码如下: /** * 获取和保存当前屏幕的截图 */ private void GetandSaveCurrentImage() { //1.构建Bitmap WindowManager windowManager = getWindowManager(); Display display = windowManager.getDefaultDisplay(

  • Android编程之截屏实现方法(包括scrollview与listview)

    本文实例讲述了Android编程之截屏实现方法.分享给大家供大家参考,具体如下: public class ScreenShot { // 获取指定Activity的截屏,保存到png文件 public static Bitmap takeScreenShot(Activity activity) { // View是你需要截图的View View view = activity.getWindow().getDecorView(); view.setDrawingCacheEnabled(tr

  • Android 使用Shell脚本截屏并自动传到电脑上

    Android设备用久了,截屏是个麻烦事.更麻烦的是通过qq传到电脑上,倒腾半天.其实用adb命令就可以截屏,然后写个pull的语句就可以拉到电脑上了.文件名为capture.sh, 内容如下: #! /bin/bash adb shell screencap -p /sdcard/test.png #adb pull /sdcard/test.png ~/Desktop/test.png dir=~/Desktop/ curr=`date "+%Y-%m-%d %H:%M:%S"`

  • android截屏功能实现代码

    android开发中通过View的getDrawingCache方法可以达到截屏的目的,只是缺少状态栏! 原始界面 截屏得到的图片 代码实现 1. 添加权限(AndroidManifest.xml文件里) 复制代码 代码如下: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 2. 添加1个Button(activity_main.xml文件) <RelativeL

  • 使用python编写android截屏脚本双击运行即可

    测试的过程中经常需要截取屏幕,通常的做法是使用手机自带的截屏功能,然后将截屏文件复制出来,这种方法的优点是不需要连接数据线就可截屏,缺点则是生成的截屏文件命名是随机命名的,复制出来也比较麻烦.另一种方法是使用PC端的手机助手类软件. 这里使用python编写一个截屏的脚本,双击运行脚本就OK,截屏成功后会将截屏文件已当前时间命名,并保存在存放脚本的当前路径的screenshot文件夹下: #!/usr/bin/env python import os import time PATH = lam

  • Android 实现截屏功能的实例

    Android 实现截屏功能的实例 实现代码: public class ScreenShot { // 获取指定Activity的截屏,保存到png文件 private static Bitmap takeScreenShot(Activity activity) { // View是你需要截图的View View view = activity.getWindow().getDecorView(); view.setDrawingCacheEnabled(true); view.buildD

  • 解析android截屏问题

    我是基于android2.3.3系统之上的,想必大家应该知道在android源码下面有个文件叫做screencap吧,位于frameworks\base\services\surfaceflinger\tests\screencap\screencap.cpp,你直接在linux下编译(保存在 /system/bin/test-screencap),然后push到手机上再通过电脑去敲命令test-screencap /mnt/sdcard/scapxx.png就可以实现截屏. 复制代码 代码如下

  • Android截屏方案实现原理解析

    Android截屏的原理:获取具体需要截屏的区域的Bitmap,然后绘制在画布上,保存为图片后进行分享或者其它用途 在截屏功能中,有时需要截取全屏的内容,有时需要截取超过一屏的内容(比如:Listview,Scrollview,RecyclerView).下面介绍各种场景获取Bitmap的方法 普通截屏的实现 获取当前Window的DrawingCache的方式,即decorView的DrawingCache /** * shot the current screen ,with the sta

  • Android源码解析之截屏事件流程

    今天这篇文章我们主要讲一下Android系统中的截屏事件处理流程.用过android系统手机的同学应该都知道,一般的android手机按下音量减少键和电源按键就会触发截屏事件(国内定制机做个修改的这里就不做考虑了).那么这里的截屏事件是如何触发的呢?触发之后android系统是如何实现截屏操作的呢?带着这两个问题,开始我们的源码阅读流程. 我们知道这里的截屏事件是通过我们的按键操作触发的,所以这里就需要我们从android系统的按键触发模块开始看起,由于我们在不同的App页面,操作音量减少键和电

  • Android截屏分享功能

    最近项目需要实现Android截屏分享功能,包括Android截屏获取图片.将图片保存到本地.通知系统相册更新.通过微信.QQ.微博分享截屏图片,本篇文章作为总结回顾.     一.Android截屏获取图片 通过对view进行绘制,得到bitmap,可以对Activity.Fragment进行绘制,也可以对其他的View进行绘制.    1 Activity截图(带空白的状态栏) public Bitmap shotScreen(Activity activity) { View view =

  • Android截屏截图的几种方法总结

    Android截屏 Android截屏的原理:获取具体需要截屏的区域的Bitmap,然后绘制在画布上,保存为图片后进行分享或者其它用途 一.Activity截屏 1.截Activity界面(包含空白的状态栏) /** * 根据指定的Activity截图(带空白的状态栏) * * @param context 要截图的Activity * @return Bitmap */ public static Bitmap shotActivity(Activity context) { View vie

  • 浅谈Android截屏和指定View生成截图

    当前页面截图(截取整个屏幕) 截取当前Activity页面的截图,可以通过窗体最底层的decorView进行缓存,然后根据这个缓存对象生成一张图片.有的需要不需要状态栏,也可以指定生成图片的宽高,把状态栏去除. /** * 截取当前窗体的截图,根据[isShowStatusBar]判断是否包含当前窗体的状态栏 * 原理是获取当前窗体decorView的缓存生成图片 */ fun captureWindow(activity: Activity, isShowStatusBar: Boolean)

  • Android截屏保存png图片的实例代码

    复制代码 代码如下: import java.io.FileNotFoundException;import java.io.FileOutputStream;import java.io.IOException; import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Rect;import android.util.Log;import android.view.View; publ

  • 详解Android截屏事件监听

    1. 前言 Android系统没有直接对截屏事件监听的接口,也没有广播,只能自己动手来丰衣足食,一般有三种方法. 利用FileObserver监听某个目录中资源变化情况 利用ContentObserver监听全部资源的变化 监听截屏快捷按键 由于厂商自定义Android系统的多样性,再加上快捷键的不同以及第三方应用,监听截屏快捷键这事基本不靠谱,可以直接忽略. 本文使用的测试手机,一加2(One Plus 2). 2. FileObserver 添加权限: <uses-permission an

随机推荐