SlideShare uma empresa Scribd logo
1 de 29
Baixar para ler offline
ロック画面ハック
してみた
田村 航弥

@tamotamago
田村 航弥 @tamotamago
2014年 02 月 株式会社ミクシィを退職しました
mixi for iPhone

PoPolly
初級∼中級者向け 電子書籍 only 2 月発売予定
ロックスクリーンハック

on Android

youtube 動画
PoPolly for Android
iOS でごりってみた

youtube 動画
iOS でごりってみた
BackGround で

動きましょう
音楽ボタンのイベント
を拾いましょう

アートワークを

いじりましょう
BackGround で

動きましょう
音楽ボタンのイベント
を拾いましょう

アートワークを
いじりましょう
Background Modes
Background Modes
MPMoviePlayerController
MPMoviePlayerController
•

無音 MP3 をエンドレスループ

_moviePlayerController = [[MPMoviePlayerController alloc]
initWithContentURL:[[NSBundle mainBundle]
URLForResource:@"Silent3sec" withExtension:@“mp3"]];
!
_moviePlayerController.repeatMode = MPMovieRepeatModeOne;
AVAudioSession
AVAudioSession
•

バックグラウンドに移ったときの振る舞いを設
定

[[AVAudioSession sharedInstance] setDelegate: self];
NSError *error;
// Initialize the AVAudioSession here.
if (![[AVAudioSession sharedInstance]
setCategory:AVAudioSessionCategoryPlayback error:&error]) {
// Handle the error here.
NSLog(@"Audio Session error %@, %@", error, [error
userInfo]);
}

AVAudioSessionCategoryPlayback : ロックスクリーンに行っても出力の
みし続ける
BackGround
動きましょう
音楽ボタンのイベント
を拾いましょう

アートワークを
いじりましょう
RemoteControlEvents
RemoteControlEvents
これ
RemoteControlEvents
•

イベント受け取ります宣言

[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
RemoteControlEvents
•

イベント受け取り

- (void)remoteControlReceivedWithEvent:(UIEvent *)event
{
switch (event.subtype) {
case UIEventSubtypeRemoteControlPlay:
case UIEventSubtypeRemoteControlPause:
case UIEventSubtypeRemoteControlStop:
case UIEventSubtypeRemoteControlTogglePlayPause:
NSLog(@"pushed center button");
break;
case UIEventSubtypeRemoteControlNextTrack:
NSLog(@"pushed right button");
break;
case UIEventSubtypeRemoteControlPreviousTrack:
NSLog(@"pushed left button");
break;
default:
break;
}
}
RemoteControlEvents
// for UIEventTypeRemoteControl, available in iOS
UIEventSubtypeRemoteControlPlay
=
UIEventSubtypeRemoteControlPause
=
UIEventSubtypeRemoteControlStop
=
UIEventSubtypeRemoteControlTogglePlayPause
=
UIEventSubtypeRemoteControlNextTrack
=
UIEventSubtypeRemoteControlPreviousTrack
=
UIEventSubtypeRemoteControlBeginSeekingBackward =
UIEventSubtypeRemoteControlEndSeekingBackward
=
UIEventSubtypeRemoteControlBeginSeekingForward =
UIEventSubtypeRemoteControlEndSeekingForward
=

4.0
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
BackGround
動きましょう
音楽ボタンのイベント
を拾いましょう

アートワークを

いじりましょう
MPNowPlayingInfoCenter
MPNowPlayingInfoCenter
•

Now Playing な Information をセットできる

MPMediaItemArtwork *artwork = [[MPMediaItemArtwork alloc] initWithImage:[UIImage
imageNamed:@"question"]];
// set NowPlaying.
Class playingInfoCenter = NSClassFromString(@"MPNowPlayingInfoCenter");
if (playingInfoCenter) {
MPNowPlayingInfoCenter *center = [MPNowPlayingInfoCenter defaultCenter];
center.nowPlayingInfo = @{};

!

}

NSDictionary *songInfo
= @{MPMediaItemPropertyTitle:@"どっちがすき?",
MPMediaItemPropertyArtwork:artwork,
MPMediaItemPropertyPlaybackDuration:[NSNumber numberWithDouble:20.0],
MPNowPlayingInfoPropertyElapsedPlaybackTime:[NSNumber numberWithDouble:0.0],
MPNowPlayingInfoPropertyPlaybackRate:[NSNumber numberWithDouble:1.0]
};
center.nowPlayingInfo = songInfo;

userInfo の key はMPNowPlayingInfoCenter.h に書いてあります
ボタンが押されたら

アートワークを変更する
みなさん何か忘れていませんか?
Apple Review Guideline
Apple Review Guideline

•

2.16 Multitasking Apps may only use
background services for their intended
purposes: VoIP, audio playback, location,
task completion, local notifications, etc.
結び
結び
作る前に(レビューガイドラインを)読む!

Mais conteúdo relacionado

Destaque

Conference withdevelopers 第二版
Conference withdevelopers 第二版Conference withdevelopers 第二版
Conference withdevelopers 第二版Tamura Koya
 
Parse introduction
Parse introductionParse introduction
Parse introductionTamura Koya
 
第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話
第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話
第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話Ryo Shibayama
 
WordPress on PHP7 on CentOS7 on Saraku-VPS
WordPress on PHP7 on CentOS7 on Saraku-VPSWordPress on PHP7 on CentOS7 on Saraku-VPS
WordPress on PHP7 on CentOS7 on Saraku-VPSRyo Shibayama
 
Amazon inspector で自動セキュリティ診断
Amazon inspector で自動セキュリティ診断Amazon inspector で自動セキュリティ診断
Amazon inspector で自動セキュリティ診断Ryo Shibayama
 
Security Advisories Checker on Travis/Circle CI
Security Advisories Checker on Travis/Circle CISecurity Advisories Checker on Travis/Circle CI
Security Advisories Checker on Travis/Circle CIRyo Shibayama
 
ElasticBeanstalk で新規事業を爆速ローンチする
ElasticBeanstalk で新規事業を爆速ローンチするElasticBeanstalk で新規事業を爆速ローンチする
ElasticBeanstalk で新規事業を爆速ローンチするRyo Shibayama
 

Destaque (8)

Conference withdevelopers 第二版
Conference withdevelopers 第二版Conference withdevelopers 第二版
Conference withdevelopers 第二版
 
Parse introduction
Parse introductionParse introduction
Parse introduction
 
第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話
第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話
第87回PHP勉強会 LT 知って得するかもしれないテキスト処理コマンドのお話
 
WordPress on PHP7 on CentOS7 on Saraku-VPS
WordPress on PHP7 on CentOS7 on Saraku-VPSWordPress on PHP7 on CentOS7 on Saraku-VPS
WordPress on PHP7 on CentOS7 on Saraku-VPS
 
Amazon inspector で自動セキュリティ診断
Amazon inspector で自動セキュリティ診断Amazon inspector で自動セキュリティ診断
Amazon inspector で自動セキュリティ診断
 
Severfield AGM Presentation
Severfield  AGM PresentationSeverfield  AGM Presentation
Severfield AGM Presentation
 
Security Advisories Checker on Travis/Circle CI
Security Advisories Checker on Travis/Circle CISecurity Advisories Checker on Travis/Circle CI
Security Advisories Checker on Travis/Circle CI
 
ElasticBeanstalk で新規事業を爆速ローンチする
ElasticBeanstalk で新規事業を爆速ローンチするElasticBeanstalk で新規事業を爆速ローンチする
ElasticBeanstalk で新規事業を爆速ローンチする
 

Último

LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイスCRI Japan, Inc.
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Gamesatsushi061452
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルCRI Japan, Inc.
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsWSO2
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptxsn679259
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...Toru Tamaki
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video UnderstandingToru Tamaki
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。iPride Co., Ltd.
 

Último (10)

LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 

Lock Screen Hack