René's URL Explorer Experiment


Title: GitHub - tracymac7/ScreenCapture: 不root实现Android屏幕截图 · GitHub

Open Graph Title: GitHub - tracymac7/ScreenCapture: 不root实现Android屏幕截图

X Title: GitHub - tracymac7/ScreenCapture: 不root实现Android屏幕截图

Description: 不root实现Android屏幕截图. Contribute to tracymac7/ScreenCapture development by creating an account on GitHub.

Open Graph Description: 不root实现Android屏幕截图. Contribute to tracymac7/ScreenCapture development by creating an account on GitHub.

X Description: 不root实现Android屏幕截图. Contribute to tracymac7/ScreenCapture development by creating an account on GitHub.

Opengraph URL: https://github.com/tracymac7/ScreenCapture

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository
route-controllerfiles
route-actiondisambiguate
fetch-noncev2:7c9beb1a-3ad2-a49d-1d3e-1c1af06fa3d9
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-id9056:2B9CDD:84D435B:B518557:6A5E915F
html-safe-nonce20613107c82642073582f90528fccb18858e37fc6c081208d75c554a90e88fad
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MDU2OjJCOUNERDo4NEQ0MzVCOkI1MTg1NTc6NkE1RTkxNUYiLCJ2aXNpdG9yX2lkIjoiODQ2MzM1MDk3MjU4NDcyNjg3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac86a463601a0d8ee182c3255d7a987a4deeba2a344c592d5281abad9fbadbc26e
hovercard-subject-tagrepository:163377336
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location//
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/tracymac7/ScreenCapture
twitter:imagehttps://opengraph.githubassets.com/cc18c64278bb7d47aeb7f98916d55779b5ee4b88bec1731425b3d82fb6c263b9/tracymac7/ScreenCapture
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/cc18c64278bb7d47aeb7f98916d55779b5ee4b88bec1731425b3d82fb6c263b9/tracymac7/ScreenCapture
og:image:alt不root实现Android屏幕截图. Contribute to tracymac7/ScreenCapture development by creating an account on GitHub.
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None7c7e31acb6a895494e518b880f5ccf39604f7fa9a8f2f3c64145efc3b776256d
turbo-cache-controlno-cache
go-importgithub.com/tracymac7/ScreenCapture git https://github.com/tracymac7/ScreenCapture.git
octolytics-dimension-user_id4425422
octolytics-dimension-user_logintracymac7
octolytics-dimension-repository_id163377336
octolytics-dimension-repository_nwotracymac7/ScreenCapture
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id63745169
octolytics-dimension-repository_parent_nwogoodbranch/ScreenCapture
octolytics-dimension-repository_network_root_id63745169
octolytics-dimension-repository_network_root_nwogoodbranch/ScreenCapture
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2d2ac9bdd71d5f53f2b731c9330677e38624e301
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/tracymac7/ScreenCapture#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftracymac7%2FScreenCapture
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ftracymac7%2FScreenCapture
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=tracymac7%2FScreenCapture
Reloadhttps://github.com/tracymac7/ScreenCapture
Reloadhttps://github.com/tracymac7/ScreenCapture
Reloadhttps://github.com/tracymac7/ScreenCapture
tracymac7 https://github.com/tracymac7
ScreenCapturehttps://github.com/tracymac7/ScreenCapture
goodbranch/ScreenCapturehttps://github.com/goodbranch/ScreenCapture
Notifications https://github.com/login?return_to=%2Ftracymac7%2FScreenCapture
Fork 0 https://github.com/login?return_to=%2Ftracymac7%2FScreenCapture
Star 0 https://github.com/login?return_to=%2Ftracymac7%2FScreenCapture
Code https://github.com/tracymac7/ScreenCapture
Pull requests 0 https://github.com/tracymac7/ScreenCapture/pulls
Actions https://github.com/tracymac7/ScreenCapture/actions
Projects https://github.com/tracymac7/ScreenCapture/projects
Security and quality 0 https://github.com/tracymac7/ScreenCapture/security
Insights https://github.com/tracymac7/ScreenCapture/pulse
Code https://github.com/tracymac7/ScreenCapture
Pull requests https://github.com/tracymac7/ScreenCapture/pulls
Actions https://github.com/tracymac7/ScreenCapture/actions
Projects https://github.com/tracymac7/ScreenCapture/projects
Security and quality https://github.com/tracymac7/ScreenCapture/security
Insights https://github.com/tracymac7/ScreenCapture/pulse
https://github.com/tracymac7/ScreenCapture
Brancheshttps://github.com/tracymac7/ScreenCapture/branches
Tagshttps://github.com/tracymac7/ScreenCapture/tags
https://github.com/tracymac7/ScreenCapture/branches
https://github.com/tracymac7/ScreenCapture/tags
2 Commitshttps://github.com/tracymac7/ScreenCapture/commits/master/
https://github.com/tracymac7/ScreenCapture/commits/master/
.ideahttps://github.com/tracymac7/ScreenCapture/tree/master/.idea
.ideahttps://github.com/tracymac7/ScreenCapture/tree/master/.idea
apphttps://github.com/tracymac7/ScreenCapture/tree/master/app
apphttps://github.com/tracymac7/ScreenCapture/tree/master/app
gradle/wrapperhttps://github.com/tracymac7/ScreenCapture/tree/master/gradle/wrapper
gradle/wrapperhttps://github.com/tracymac7/ScreenCapture/tree/master/gradle/wrapper
.gitignorehttps://github.com/tracymac7/ScreenCapture/blob/master/.gitignore
.gitignorehttps://github.com/tracymac7/ScreenCapture/blob/master/.gitignore
LICENSEhttps://github.com/tracymac7/ScreenCapture/blob/master/LICENSE
LICENSEhttps://github.com/tracymac7/ScreenCapture/blob/master/LICENSE
README.mdhttps://github.com/tracymac7/ScreenCapture/blob/master/README.md
README.mdhttps://github.com/tracymac7/ScreenCapture/blob/master/README.md
build.gradlehttps://github.com/tracymac7/ScreenCapture/blob/master/build.gradle
build.gradlehttps://github.com/tracymac7/ScreenCapture/blob/master/build.gradle
gradle.propertieshttps://github.com/tracymac7/ScreenCapture/blob/master/gradle.properties
gradle.propertieshttps://github.com/tracymac7/ScreenCapture/blob/master/gradle.properties
gradlewhttps://github.com/tracymac7/ScreenCapture/blob/master/gradlew
gradlewhttps://github.com/tracymac7/ScreenCapture/blob/master/gradlew
gradlew.bathttps://github.com/tracymac7/ScreenCapture/blob/master/gradlew.bat
gradlew.bathttps://github.com/tracymac7/ScreenCapture/blob/master/gradlew.bat
settings.gradlehttps://github.com/tracymac7/ScreenCapture/blob/master/settings.gradle
settings.gradlehttps://github.com/tracymac7/ScreenCapture/blob/master/settings.gradle
READMEhttps://github.com/tracymac7/ScreenCapture
Apache-2.0 licensehttps://github.com/tracymac7/ScreenCapture
https://github.com/tracymac7/ScreenCapture#在android-50api-21--之前想要截图系统屏幕必须root才能完成50之后开放了接口下面看我们是怎么实现的
https://github.com/tracymac7/ScreenCapture#1-涉及到的相关类
https://github.com/tracymac7/ScreenCapture#1-mediaprojectionmanager
https://github.com/tracymac7/ScreenCapture#2-mediaprojection
https://github.com/tracymac7/ScreenCapture#3-imagereader
https://github.com/tracymac7/ScreenCapture#2-上面三个类就可以完成我们截取屏幕图片的操作那么下面我们将解释他们是怎么合作完成的
https://github.com/tracymac7/ScreenCapture#1-首先获取用户授权截图屏幕需要用户手动授权后才能操作
https://raw.githubusercontent.com/goodbranch/AndroidNote/master/note/screenshot/screenshot_permission.png
https://github.com/tracymac7/ScreenCapture#这里我是用floatwindowsservice在桌面上显示一个悬浮按钮点击截屏下面我们看在floatwindowsservice-是如何实现截图
https://github.com/tracymac7/ScreenCapture#2-截取屏幕内容生成bitmap
https://github.com/tracymac7/ScreenCapture#首先创建imagereader实例
https://github.com/tracymac7/ScreenCapture#然后点击事件中触发startscreenshot
https://github.com/tracymac7/ScreenCapture#在startvirtual-方法中我们做一件事就是获取当前屏幕内容
https://github.com/tracymac7/ScreenCapture#与此同时需要获取mediaprojection-实例而mresultdata-是授权后返回的结果
https://github.com/tracymac7/ScreenCapture#最终得到当前屏幕的内容注意这里mimagereadergetsurface被传入屏幕的数据也将会在imagereader中的surface中
https://github.com/tracymac7/ScreenCapture#最后把mimagereader得到的屏幕内容数据转换成图片在asynctask中处理
https://github.com/tracymac7/ScreenCapture#imageplane中的-buffer-数据并不是完全是bitmap所需要的需要注意下面3点
https://github.com/tracymac7/ScreenCapture#1-image-设置的图片格式与bitmap设置的必须一致
https://github.com/tracymac7/ScreenCapture#2-缓冲数据存在行间距所以我们必须去除这些间距
https://github.com/tracymac7/ScreenCapture#3-image-使用后必须调用imageclose关闭否则再次使用会报错
https://github.com/tracymac7/ScreenCapture#最后把生成的bitmap保存起来就ok了
源码https://github.com/goodbranch/ScreenCapture
APKhttps://raw.githubusercontent.com/goodbranch/AndroidNote/master/note/screenshot/ScreenCapture.apk
Readme https://github.com/tracymac7/ScreenCapture#readme-ov-file
Apache-2.0 license https://github.com/tracymac7/ScreenCapture#Apache-2.0-1-ov-file
Please reload this pagehttps://github.com/tracymac7/ScreenCapture
Activityhttps://github.com/tracymac7/ScreenCapture/activity
0 forkshttps://github.com/tracymac7/ScreenCapture/forks
Report repository https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Ftracymac7%2FScreenCapture&report=tracymac7+%28user%29
Releaseshttps://github.com/tracymac7/ScreenCapture/releases
Packages 0https://github.com/users/tracymac7/packages?repo_name=ScreenCapture
Please reload this pagehttps://github.com/tracymac7/ScreenCapture
Contributorshttps://github.com/tracymac7/ScreenCapture/graphs/contributors
Please reload this pagehttps://github.com/tracymac7/ScreenCapture
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.