ios*_*ios 26 iphone objective-c iphone-privateapi ios4 ios
在iPhone中我们是否可以通过编程方式设置锁屏,壁纸和铃声?
如果是,那么请告诉我如何设置它们?
Wri*_*sCS 37
这一切都可以轻松完成,但Apple会拒绝.
可以通过改变com.apple.SpringBoard.plist,特别是ringtone键来改变铃声.
以下代码可用于读取自定义铃声的实际铃声标题(由iTunes同步).
NSMutableDictionary *custDict = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/private/var/mobile/Media/iTunes_Control/iTunes/Ringtones.plist"];
NSMutableDictionary *dictionary = [custDict objectForKey:@"Ringtones"];
NSArray *keys = [dictionary allKeys];
id key = [keys objectAtIndex:indexPath.row];
NSMutableDictionary *customRingtone = [dictionary objectForKey:key];
NSString *name = [customRingtone objectForKey:@"Name"];
cell.textLabel.text = name;
Run Code Online (Sandbox Code Playgroud)
壁纸可以覆盖:
NSString *homePath1 = @"/private/var/mobile/Library/SpringBoard/HomeBackground.jpg";
NSString *homePath2 = @"/private/var/mobile/Library/SpringBoard/HomeBackgroundPortrait.jpg";
NSString *lockPath1 = @"/private/var/mobile/Library/SpringBoard/LockBackground.jpg";
NSString *lockPath2 = @"/private/var/mobile/Library/SpringBoard/LockBackgroundPortrait.jpg";
Run Code Online (Sandbox Code Playgroud)
这些示例用于我的一个Cydia应用程序中.对他们来说并不是更多,但这些应该让你朝着正确的方向前进.
| 归档时间: |
|
| 查看次数: |
19479 次 |
| 最近记录: |