// 相关头文件 @interface SBUserAgent : XXUnknownSuperclass <SBUIUserAgent> { } +(id)sharedUserAgent; -(void)setIdleText:(id)text; // 在屏幕顶端显示一段文字 -(BOOL)isScreenOn; // 屏幕是否点亮 -(BOOL)lockScreenIsShowing; // 是否出现锁屏画面 -(BOOL)deviceIsLocked; // 是否锁定状态 -(BOOL)deviceIsPasscodeLocked; // 是否需要密码解锁 -(void)lockAndDimDevice; // 锁定并黑屏 -(void)undimScreen; // 点亮屏幕 -(void)dimScreen:(BOOL)screen; // 设置是否黑屏 @end 实验: PiaoYuns-iPad:~ root# cycript -p SpringBoard cy# [userAgent lockScreenIsShowing ] false cy# [userAgent lockScreenIsShowing ] true cy# [userAgent deviceIsLocked ] false cy# [userAgent deviceIsLocked ] true cy# [userAgent deviceIsPasscodeLocked] true cy# [userAgent deviceIsPasscodeLocked] false cy# [userAgent isScreenOn ] false cy# [userAgent isScreenOn ] true cy# [userAgent undimScreen ] cy# [userAgent dimScreen: YES]
发表评论