da_funk 3.25.1 → 3.28.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c51a5629c6bb3c16b5c95f9f75c31fbdd0c4dad7ab85853b90f22b31c51ac07d
4
- data.tar.gz: 0ec037b370257e24893d21e642144b63c94298d066d4539a7deface8906c82c2
3
+ metadata.gz: b4d0d54c5c119b8292581b762890e56ac8236cfaba00da8a7771b7cbd7bb4e86
4
+ data.tar.gz: 010a769cea5606eb804a641d1608ee0eb26ee9284d987606b4654fde8a7c4dcf
5
5
  SHA512:
6
- metadata.gz: 01332cd3a315619a08a7011d41b7d2a94d5c8ac4d9331a928a585a968eda3c5e05fb40f56776a4d7bed7b10db36072e5ba1314d71c08add652c653ffd01f1892
7
- data.tar.gz: 2e0b2aff3a95c7e7e47b5b0c804e0011d218c42ed9a36ce114b6bf0194ecdf8b1aa52d06c84cdabd638055b19520a9c8e516facf535425d6cb2018509406ba45
6
+ metadata.gz: b395196c638fc69b56609d90eb1e460b1db746eca86d641964c7efb38106a154ba303aa4aa49b9e01134ea8658930630516fd7959a657d208f3787674ec145d1
7
+ data.tar.gz: c8f3818542777f7b5c2338913a6fe760a6f81532640a6b7e79e712f6ed76297f1c813071b4a5beb987b4c3830e023741ae84844811439e26423bb26e3e08f05c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- da_funk (3.25.1)
4
+ da_funk (3.28.2)
5
5
  archive-zip (~> 0.5)
6
6
  bundler
7
7
  cloudwalk_handshake
@@ -18,7 +18,7 @@ GEM
18
18
  cloudwalk (1.15.0)
19
19
  bundler
20
20
  rake
21
- cloudwalk_handshake (1.14.0)
21
+ cloudwalk_handshake (1.20.0)
22
22
  funky-simplehttp (~> 0.6)
23
23
  funky-emv (1.4.1)
24
24
  funky-tlv (~> 0.2)
@@ -35,17 +35,17 @@ GEM
35
35
  rake (13.0.1)
36
36
  regexp_parser (1.7.1)
37
37
  rexml (3.2.4)
38
- rubocop (0.86.0)
38
+ rubocop (0.90.0)
39
39
  parallel (~> 1.10)
40
- parser (>= 2.7.0.1)
40
+ parser (>= 2.7.1.1)
41
41
  rainbow (>= 2.2.2, < 4.0)
42
42
  regexp_parser (>= 1.7)
43
43
  rexml
44
- rubocop-ast (>= 0.0.3, < 1.0)
44
+ rubocop-ast (>= 0.3.0, < 1.0)
45
45
  ruby-progressbar (~> 1.7)
46
46
  unicode-display_width (>= 1.4.0, < 2.0)
47
- rubocop-ast (0.0.3)
48
- parser (>= 2.7.0.1)
47
+ rubocop-ast (0.4.0)
48
+ parser (>= 2.7.1.4)
49
49
  ruby-progressbar (1.10.1)
50
50
  unicode-display_width (1.7.0)
51
51
  yard (0.9.25)
@@ -1,5 +1,31 @@
1
1
  # DaFunk
2
2
 
3
+ ### 3.28.2 - 2020-10-07
4
+
5
+ - Added support of params.dat file restore if it was corrupted;
6
+ - Wait 3 seconds before restart after main update;
7
+ - Fixed method_missing exception;
8
+
9
+ ### 3.28.1 - 2020-09-26
10
+
11
+ - Close socket in case of ssl exceptions;
12
+ - Do not assign nil to PaymentChannel#current and client on error because this is already being done on PaymentChannel#close.
13
+
14
+ ### 3.28.0 - 2020-09-25
15
+
16
+ - Check if system update file is present after device restart in order to continue with system update process;
17
+ - Implemented block to write and break line if message has '\n'.
18
+
19
+ ### 3.27.0 - 2020-09-25
20
+
21
+ - Print bitmap if exists on DaFunk::ParamsDat#restart;
22
+ - Add main application version on config.dat file.
23
+
24
+ ### 3.26.0 - 2020-09-14
25
+
26
+ - Fixed error on virtual keyboard, chars y and Y were duplicated;
27
+ - Update cloudwalk_handshake (1.20.0).
28
+
3
29
  ### 3.25.1 - 2020-08-28
4
30
 
5
31
  - Set DaFunk::Helper::StatusBar#connected as false on system update process so it will cache again.
@@ -1,8 +1,13 @@
1
1
  module DaFunk
2
2
  class Engine
3
3
  def self.check
4
- DaFunk::EventListener.check
5
- ThreadScheduler.keep_alive
4
+ if Device::Setting.boot == '1'
5
+ DaFunk::EventListener.check(:file_exists) #to check if system update is in progress
6
+ Device::Setting.boot = '0'
7
+ else
8
+ DaFunk::EventListener.check
9
+ ThreadScheduler.keep_alive
10
+ end
6
11
  end
7
12
 
8
13
  def self.app_loop(&block)
@@ -73,7 +73,11 @@ class I18n
73
73
 
74
74
  def self.pt(symbol, options = {})
75
75
  if options[:line] || options[:column]
76
- Device::Display.print_line(t(symbol, options), options[:line] || 0, options[:column] || 0)
76
+ line = options[:line] || 0
77
+ t(symbol, options).split("\n").each do |message|
78
+ Device::Display.print_line(message, line, options[:column] || 0)
79
+ line+=1
80
+ end
77
81
  else
78
82
  puts(t(symbol, options))
79
83
  end
@@ -5,7 +5,7 @@ module DaFunk
5
5
  include DaFunk::Helper
6
6
 
7
7
  class << self
8
- attr_accessor :file, :apps, :valid, :files
8
+ attr_accessor :file, :apps, :valid, :files, :checksum
9
9
  end
10
10
 
11
11
  self.apps = Array.new
@@ -20,9 +20,19 @@ module DaFunk
20
20
  end
21
21
 
22
22
  def self.setup
23
+ @checksum = calculate_checksum
23
24
  @file = FileDb.new(FILE_NAME)
24
25
  end
25
26
 
27
+ def self.calculate_checksum
28
+ Device::Crypto.crc16_hex(File.read(FILE_NAME)) if exists?
29
+ end
30
+
31
+ def self.corrupted?
32
+ return true unless exists?
33
+ @checksum != calculate_checksum
34
+ end
35
+
26
36
  def self.exists?
27
37
  File.exists?(FILE_NAME)
28
38
  end
@@ -151,10 +161,15 @@ module DaFunk
151
161
 
152
162
  def self.restart
153
163
  Device::Display.clear
154
- I18n.pt(:admin_main_update_message)
155
- 3.times do |i|
156
- Device::Display.print("REBOOTING IN #{3 - i}",3,3)
157
- sleep(1)
164
+ if File.exists?('./shared/init_reboot.bmp')
165
+ Device::Display.print_bitmap('./shared/init_reboot.bmp')
166
+ getc(3000)
167
+ else
168
+ I18n.pt(:admin_main_update_message)
169
+ 3.times do |i|
170
+ Device::Display.print("REBOOTING IN #{3 - i}",3,3)
171
+ sleep(1)
172
+ end
158
173
  end
159
174
  Device::System.restart
160
175
  end
@@ -231,8 +231,7 @@ module DaFunk
231
231
  if Context.development?
232
232
  ContextLog.exception(exception, exception.backtrace, "PaymentChannel error")
233
233
  end
234
- PaymentChannel.current = nil
235
- @client = nil
234
+ self.close
236
235
  end
237
236
 
238
237
  def handshake
@@ -1,4 +1,4 @@
1
1
  module DaFunk
2
- VERSION="3.25.1"
2
+ VERSION="3.28.2"
3
3
  end
4
4
 
@@ -67,7 +67,8 @@ class Device
67
67
  "transaction_http_host" => HTTP_HOST_PRODUCTION,
68
68
  "transaction_http_port" => HTTP_PORT,
69
69
  "emv_contactless_amount" => "0",
70
- "network_init" => ""
70
+ "network_init" => "",
71
+ "main_app_version" => ""
71
72
  }
72
73
 
73
74
  class << self
@@ -151,16 +152,16 @@ class Device
151
152
 
152
153
  # Custom Attributes
153
154
  def self.tcp_recv_timeout
154
- DaFunk::ParamsDat.file["tcp_recv_timeout"] || method_missing(:tcp_recv_timeout)
155
+ DaFunk::ParamsDat.file["tcp_recv_timeout"] || @file&.dig("tcp_recv_timeout")
155
156
  end
156
157
 
157
158
  def self.attach_gprs_timeout
158
- value = (DaFunk::ParamsDat.file["attach_gprs_timeout"] || method_missing(:attach_gprs_timeout))
159
+ value = (DaFunk::ParamsDat.file["attach_gprs_timeout"] || @file&.dig("attach_gprs_timeout"))
159
160
  value.to_s.empty? ? nil : value.to_s.to_i
160
161
  end
161
162
 
162
163
  def self.heartbeat
163
- DaFunk::ParamsDat.file["heartbeat"] || method_missing(:heartbeat)
164
+ DaFunk::ParamsDat.file["heartbeat"] || @file&.dig("heartbeat")
164
165
  end
165
166
 
166
167
  def self.logical_number
@@ -28,7 +28,7 @@ class Device
28
28
  { x: 0..201, y: 223..241, char: 'k' },
29
29
  { x: 0..230, y: 223..241, char: 'l' },
30
30
  { x: 0..30, y: 223..273, char: :keyboard_uppercase },
31
- { x: 0..56, y: 223..273, char: 'y' },
31
+ { x: 0..56, y: 223..273, char: 'z' },
32
32
  { x: 0..82, y: 223..273, char: 'x' },
33
33
  { x: 0..109, y: 223..273, char: 'c' },
34
34
  { x: 0..130, y: 223..273, char: 'v' },
@@ -65,7 +65,7 @@ class Device
65
65
  { x: 0..201, y: 223..241, char: 'K' },
66
66
  { x: 0..230, y: 223..241, char: 'L' },
67
67
  { x: 0..30, y: 223..273, char: :keyboard_capital },
68
- { x: 0..56, y: 223..273, char: 'Y' },
68
+ { x: 0..56, y: 223..273, char: 'Z' },
69
69
  { x: 0..82, y: 223..273, char: 'X' },
70
70
  { x: 0..109, y: 223..273, char: 'C' },
71
71
  { x: 0..130, y: 223..273, char: 'V' },
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: da_funk
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.25.1
4
+ version: 3.28.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thiago Scalone
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-29 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake