以编程方式设置iOS背景/锁屏图像?

Eig*_*ght 9 iphone jailbreak uikit lockscreen ios

我希望能够以编程方式设置锁屏背景图像.我知道这只适用于越狱的iOS设备.

以下是我尝试过的一些事情:

  1. 将LockBackground.png放在/ private/var/mobile/Library/SpringBoard /中.这可行,但需要一个坚硬的呼吸.notify_post("com.apple.language.changed");不适用于柔软的呼吸.

  2. class-dump倾倒的UIKit的私有方法.4.2中的UIKit曾经有一个被调用的方法,+ (void)setDesktopImageData:(id)fp8;但它似乎在4.3及以上版本中缺失.

有什么我想念的吗?

Emi*_*aez 12

我在SpringBoard转储中找到了这个,我觉得它对你有用:

在SBWallpaperView.h中:

- (void)replaceWallpaperWithImage:(id)image;
Run Code Online (Sandbox Code Playgroud)

在SBUIController.h中:

- (id)wallpaperView;
Run Code Online (Sandbox Code Playgroud)

所以你可以这样做:

[(SBWallpaperView *)[SBUIController sharedInstance] wallpaperView] replaceWallpaperWithImage:anImage];
Run Code Online (Sandbox Code Playgroud)

这是一种方式.

我找到的另一个是使用SBWallpaperView + (void)noteWallpaperPreferencesChanged;,我对这个不太确定,但看起来如果你做了你尝试的第一件事,然后使用它而不是一个respring,它可能会工作.