10.07.2015 Views

dissertation

dissertation

dissertation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

index 25 a37f4 . . 5 4 0 9 d88 100644−−− read−from−fake −database / s r c /com/ android / p r o v i d e r s / c o n t a c t s / ContactsProvider2 . java+++ delayed−r e s t o r a t i o n / s r c /com/ android / p r o v i d e r s / c o n t a c t s / ContactsProvider2 . java@@ −31,6 +31 ,8 @@ import java . u t i l . L i s t ;import java . u t i l . Locale ;import java . u t i l . Map ;import java . u t i l . Set ;+import java . u t i l . Timer ;+import java . u t i l . TimerTask ;import java . u t i l . c o n c u r r e n t . CountDownLatch ;import android . accounts . Account ;@@ −1910 ,10 +1912 ,54 @@ p u b l i c c l a s s ContactsProvider2 extends SQLiteContentProvider implements OnAccoun}}− p r i v a t e boolean isDebugging ;+ p r i v a t e boolean isDebugging = f a l s e ; // True w h i l e the c a b l e i s attached and USB debugging switched on118− p r i v a t e void onUSBDebug( boolean a c t i v e ) {+ p r i v a t e enum Fakes {+ NONE, CELLEBRITE, XRY, GENERIC+ }++ p r i v a t e Fakes currentFake = Fakes .NONE; // Set w h i l e isDebugging and a f t e r w a r d s u n t i l the timer e x p i r e s+ Timer fakeAfterDebug = n u l l ; // Timer f o r f a k i n g a f t e r debugging has stopped+ TimerTask currentTask = n u l l ;++ p r i v a t e s y n c h r o n i z e d void onUSBDebug( boolean a c t i v e ) {isDebugging = a c t i v e ;++ // Something happened , so c a n c e l any running t i m e r s+ i f ( currentTask != n u l l ) {+ currentTask . c a n c e l ( ) ;+ fakeAfterDebug . purge ( ) ;+ }++ i f ( ( currentFake != Fakes .NONE) && ! isDebugging ) {+ // We were debugging , which has now stopped .+ // Set a timer to turn f a k i n g o f f i n the f u t u r e .

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!