简体   繁体   English

获取当前壁纸绝对路径?

[英]Get current wallpaper absolute path?

How do we get a current wallpaper absolute path我们如何获得当前壁纸的absolute path

On Android 4.2 the wallpaper is located at: 在Android 4.2上,壁纸位于:

/data/system/users/0/wallpaper

Replace the 0 with your user id (take a look in /data/system/users ). 用您的用户ID替换0 (查看/data/system/users )。

Make sure you are looking in the phone's root directory to start, NOT on the SDcard. 确保您正在查看手机的根目录以启动,而不是在SD卡上。 Once you get to the right subdirectory the wallpaper file will just be called "wallpaper" and until you copy it to the SDcard and rename it to "YourName.jpg" the picture viewers may not recognize it as an image file. 一旦到达正确的子目录,壁纸文件将被称为“壁纸”,直到您将其复制到SD卡并将其重命名为“YourName.jpg”,图片查看器可能无法将其识别为图像文件。

I tried both ES File Explorer and Root Explorer (download from Marketplace) to copy the file from the phone root area., ie phone ROOT/data/data/com.android.settings/files/wallpaper.. .it's the lowest level of the phone storage itself, similar to "computer" in windows. 我尝试了ES文件浏览器和Root Explorer(从Marketplace下载)从手机根区域复制文件。即手机ROOT/data/data/com.android.settings/files/wallpaper..是最低级别的手机存储本身,类似于Windows中的“电脑”。

Probably the File Explorer on your phone won't let you access the root (your phone shouldn't need ROOT privileges just to copy the file) 可能手机上的文件资源管理器不允许您访问根目录(您的手机不需要ROOT权限只是为了复制文件)

use wallpaperManager and call getWallpaperInfo . 使用wallpaperManager并调用getWallpaperInfo This will return you a wallpaperinfo object which contains all the info about the wallpaper. 这将返回一个wallpaperinfo对象,其中包含有关壁纸的所有信息。 Read more about the wallpapernfo here. 在这里阅读更多关于wallpapernfo的信息。

I would imagine that the current wallpaper will be stored in a private system folder. 我想,当前的壁纸将存储在私人系统文件夹中。

On Android Oreo and using one of the provided wallpapers from the system, the wallpaper I wanted wasn't on the path mentioned by the accepted answer but I found the apk that had it on a system folder. 在Android Oreo上并使用系统中提供的壁纸之一,我想要的壁纸不在接受的答案提到的路径上,但我发现在系统文件夹上有它的apk。

I got it from the path: system/framework/framework-res.apk I had to open the apk and extract: /res/drawable-nodpi-v4/default_wallpaper.png. 我从路径中得到它:system / framework / framework-res.apk我必须打开apk并解压缩:/res/drawable-nodpi-v4/default_wallpaper.png。

Android Oreo is not in the place from other comments Android Oreo不在其他评论的位置

Internal Storage/Android/data/com.android.systemui/files/backupwallpapers 内部存储/ Android / data / com.android.systemui / files / backupwallpapers

I just had to find a wallpaper that I deleted from my downloads folder. 我只需要找到一个从我的下载文件夹中删除的壁纸。

Download the apk file ... 下载apk文件...

go to this path...you can find it here 走这条路......你可以在这里找到它

Download\\com.amber.launcher.skin.samsung.galaxy_2018-08-24\\res\\drawable-nodpi-v4\\bg_wallpaper.jpg 下载\\ com.amber.launcher.skin.samsung.galaxy_2018-08-24 \\水库\\绘制-nodpi-V4 \\ bg_wallpaper.jpg

On Android 4.2 the wallpaper is located at: 在Android 4.2上,壁纸位于:

/data/system/users/0/wallpaper

Replace the 0 with your user id (take a look in /data/system/users). 用您的用户ID替换0(查看/ data / system / users)。

Make sure you are looking in the phone's root directory to start, NOT on the SDcard. 确保您正在查看手机的根目录以启动,而不是在SD卡上。 Once you get to the right subdirectory the wallpaper file will just be called "wallpaper" and until you copy it to the SDcard and rename it to "YourName.jpg" the picture viewers may not recognize it as an image file. 一旦到达正确的子目录,壁纸文件将被称为“壁纸”,直到您将其复制到SD卡并将其重命名为“YourName.jpg”,图片查看器可能无法将其识别为图像文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM