Class: Pindo::DeviceInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/pindo/base/deviceinfo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configfile: nil) ⇒ DeviceInfo

Returns a new instance of DeviceInfo.



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
# File 'lib/pindo/base/deviceinfo.rb', line 28

def initialize(configfile:nil)

    @timezone = 28800
    @xcdev = false
    @region_code = "US"
    @language_code = "en"
    @system_version = "16.4"
    @network_type = "WIFI"
    @name = "iPhone 14"
    @machine = "x86_64"


    @device_id = "PINDO000-0000-0000-0000-0000DEVICEID"
    @idfa = "PINDO000-0000-0000-0000-00000000IDFA"
    @sbsid = "PINDO000-0000-0000-0000-0000000SBSID"
    @sutid = "PINDO000-0000-0000-0000-0000000SUTID"
    @tzlid = "PINDO000-0000-0000-0000-0000000TZLID"
    @idfv = "PINDO000-0000-0000-0000-00000000IDFV"

    @carriers = []

    if !configfile.nil? && File.exist?(configfile)

        default_data = JSON.parse(File.read(configfile))
        if !default_data.nil?

            reset_with_config(device_config:default_data)
                
        end

    end


end

Instance Attribute Details

#carriersObject

Returns the value of attribute carriers.



24
25
26
# File 'lib/pindo/base/deviceinfo.rb', line 24

def carriers
  @carriers
end

#device_idObject

Returns the value of attribute device_id.



17
18
19
# File 'lib/pindo/base/deviceinfo.rb', line 17

def device_id
  @device_id
end

#idfaObject

Returns the value of attribute idfa.



18
19
20
# File 'lib/pindo/base/deviceinfo.rb', line 18

def idfa
  @idfa
end

#idfvObject

Returns the value of attribute idfv.



19
20
21
# File 'lib/pindo/base/deviceinfo.rb', line 19

def idfv
  @idfv
end

#language_codeObject

Returns the value of attribute language_code.



10
11
12
# File 'lib/pindo/base/deviceinfo.rb', line 10

def language_code
  @language_code
end

#machineObject

Returns the value of attribute machine.



14
15
16
# File 'lib/pindo/base/deviceinfo.rb', line 14

def machine
  @machine
end

#nameObject

Returns the value of attribute name.



13
14
15
# File 'lib/pindo/base/deviceinfo.rb', line 13

def name
  @name
end

#network_typeObject

Returns the value of attribute network_type.



12
13
14
# File 'lib/pindo/base/deviceinfo.rb', line 12

def network_type
  @network_type
end

#region_codeObject

Returns the value of attribute region_code.



9
10
11
# File 'lib/pindo/base/deviceinfo.rb', line 9

def region_code
  @region_code
end

#sbsidObject

Returns the value of attribute sbsid.



22
23
24
# File 'lib/pindo/base/deviceinfo.rb', line 22

def sbsid
  @sbsid
end

#sutidObject

Returns the value of attribute sutid.



21
22
23
# File 'lib/pindo/base/deviceinfo.rb', line 21

def sutid
  @sutid
end

#system_versionObject

Returns the value of attribute system_version.



11
12
13
# File 'lib/pindo/base/deviceinfo.rb', line 11

def system_version
  @system_version
end

#timezoneObject

Returns the value of attribute timezone.



7
8
9
# File 'lib/pindo/base/deviceinfo.rb', line 7

def timezone
  @timezone
end

#tzlidObject

Returns the value of attribute tzlid.



20
21
22
# File 'lib/pindo/base/deviceinfo.rb', line 20

def tzlid
  @tzlid
end

#xcdevObject

Returns the value of attribute xcdev.



8
9
10
# File 'lib/pindo/base/deviceinfo.rb', line 8

def xcdev
  @xcdev
end

Instance Method Details

#reset_with_config(device_config: nil) ⇒ Object



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
# File 'lib/pindo/base/deviceinfo.rb', line 63

def reset_with_config(device_config:nil)


    if !device_config.nil?
        
            @timezone = device_config["timezone"] || 28800
            @xcdev = device_config["xcdev"] || false
            @region_code = device_config["region_code"] || "US"
            @language_code = device_config["language_code"] || "en"
            @system_version = device_config["system_version"] || "16.4"
            @network_type = device_config["network_type"] || "WIFI"
            @name = device_config["name"] || "iPhone 14"
            @machine = device_config["machine"] || "x86_64"

            @device_id = device_config["device_id"] || "PINDO000-0000-0000-0000-0000DEVICEID"
            @idfa = device_config["idfa"] || "PINDO000-0000-0000-0000-00000000IDFA"
            @sbsid = device_config["sbsid"] || "PINDO000-0000-0000-0000-0000000SBSID"
            @sutid = device_config["sutid"] || "PINDO000-0000-0000-0000-0000000SUTID"
            @tzlid = device_config["tzlid"] || "PINDO000-0000-0000-0000-0000000TZLID"
            @idfv = device_config["idfv"] || "PINDO000-0000-0000-0000-00000000IDFV"

            @carriers = device_config["carriers"] || []

    end
end