Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

#!/usr/bin/env python 

# -*- coding: utf-8 -*- 

''' 

 

Pull variables from db, if any variable contains data then set corresponding  

variable equal to one. follow through till all  

 

''' 

import sys 

import logging 

import sqlite3 

import datetime 

import appdirs 

import time 

import multiprocessing as mp 

''' 

# Fix kivy's logging 

import antikythera.kivylogs 

from kivy.logger import Logger 

 

from kivy.app import App 

from kivy.lang import Builder 

from kivy.factory import Factory 

from kivy.uix.button import Button 

from kivy.animation import Animation 

from kivy.clock import Clock, mainthread 

from kivy.uix.gridlayout import GridLayout 

from multiprocessing import Queue 

from time import sleep 

 

 

from antikythera import __version__ 

from antikythera.antikythera import Anti, create_parser 

''' 

 

 

_logger = logging.getLogger(__name__) 

 

__author__= "TeamAwesome" 

 

TMSI = 1 

IMSI = 1 

LAC = 0 

CID = 1 

MCC = 0 

MNC = 1 

IMEISV = 0 

 

#defcon = 0 

 

def check_defcon(TMSI, IMSI, LAC, CID, MCC, MNC, IMEISV): 

temp = TMSI + IMSI + LAC + CID + MCC + MNC + IMEISV 

if temp > 7: 

defcon = 1 

elif temp > 5 and temp <= 7: 

defcon = 2 

elif temp > 3 and temp <= 5: 

defcon = 3 

elif temp > 1 and temp <= 3: 

defcon = 4 

elif temp <= 1: 

defcon = 5 

else: 

print('Defcon either undetermined or already at lowest level') 

return defcon 

 

#print (defcon) 

 

def print_defcon(defcon): 

if defcon == 1: 

#insert command to flash defcon 1 button gui 

print("""Defcon level 1 has been set, you are advised turn 

all devices off and vacate the area immediately""") 

elif defcon == 2: 

print("""Defcon level 2 has been set, you are advised turn 

all devices off and take countermeasures for an attack""") 

elif defcon == 3: 

print("""Defcon level 3 has been set, you are advised to analyze  

your surroindings and take precautonary procedures""") 

elif defcon == 4: 

print("""Defcon level 4 has been set, you are in the vacinity 

of a StingRay and susceptible to an attack""") 

elif defcon == 5: 

print("""Defcon level 5 has been set, you are not in any 

immediate danger or threat of a StingRay""") 

else: 

print('No Stingrays Detected') 

 

#print_defcon(defcon) 

 

def start(): 

#_logger.info("GUI: Starting GUI App") 

#MetricDisplay().run() 

defcon = check_defcon(TMSI, IMSI, LAC, CID, MCC, MNC, IMEISV) 

print_defcon(defcon) 

 

if __name__ == "__main__": 

start()