headdesk 0.16.0 → 0.16.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 43122fb0ed6467db6c61fd068aefcf8a66134cd07a281f5dd82cc11b416ec96d
4
- data.tar.gz: ee42b2fd9dc5b4ff5e37435709d97ce2b2cd3a0075471377e6be85dde5d48b7f
3
+ metadata.gz: ffbd38c12b42f3040a9ed8fe1a352902bf446da77c780c2d1bc0634296c19c96
4
+ data.tar.gz: 208004bf2fe7733cc44466522e9dbc93d9e6b92e5edf5e5148ad676cc608a57f
5
5
  SHA512:
6
- metadata.gz: b2db44040e759c6d6866adab9012405b790d935f3ccab7b45bbbe722d389f041c8740756a030501f5a6b4b607a05afd8e23cffe2e840d1820388314d228f0b30
7
- data.tar.gz: ff9a2c645296db69e4b5ca9b0aa1e3361c6e517d0d3e154e6cd83998135ef22b759ae7dc7724923c9b34f534768c8125bb8738fce3ab2645af90ce8d5d40bdd3
6
+ metadata.gz: fee39e258d6dd3dfb55beaa4c3fc92b59993c27a396aebba1872bc4a0f861acb83f23c1c3fd3cb380ddff904a83b11d5f53d8a471a1d53621068c3a5e43d31da
7
+ data.tar.gz: edabb82c74a6cdaabf39dc2aa74944db21929e5f2fecd98b4ad85f62799b722c1820d963bf82532890b1ec9c0a031f4cd8c694f3ec0463634af25529eac34f84
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- headdesk (0.15.1)
4
+ headdesk (0.16.0)
5
5
  awesome_print (~> 1.8)
6
6
  gems (~> 1.1)
7
7
  nokogiri (~> 1.10)
@@ -0,0 +1,8 @@
1
+ # unity_version
2
+ Checks to see if the APK is built with Unity.
3
+
4
+ ## Will Skip If
5
+ * The APK does not include any files in `assets/bin/Data`
6
+
7
+ ## Exports
8
+ The version of Unity that was used to compile the APK
@@ -52,6 +52,23 @@ module Headdesk
52
52
  report
53
53
  end
54
54
 
55
+ def unity_version
56
+ unity_assets = File.join(@path, 'assets', 'bin', 'Data').freeze
57
+ return nil unless Dir.exist?(unity_assets)
58
+
59
+ asset_file = Dir[File.join(unity_assets, '/*')].first
60
+ return nil unless asset_file
61
+
62
+ version_bytes = []
63
+ File.open(asset_file, 'rb') do |file|
64
+ file.read(16) # Throw the first 16 bytes away
65
+ file.read(16).each_byte do |byte|
66
+ version_bytes << byte if byte > 0
67
+ end
68
+ return version_bytes.pack('c*')
69
+ end
70
+ end
71
+
55
72
  def target_sdk_version
56
73
  sdk_info['targetSdkVersion'].to_i
57
74
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Headdesk
4
+ module Checks
5
+ class UnityVersion
6
+ include Check::APK
7
+
8
+ check_name 'unity_version'
9
+ describe 'Check Unity version'
10
+ def call
11
+ describe "Built with Unity"
12
+ skip_check unless: -> { apk.unity_version }
13
+ export unity_version: apk.unity_version
14
+ end
15
+ end
16
+ end
17
+ end
@@ -48,7 +48,7 @@ module Headdesk
48
48
  STDOUT.puts report.to_json
49
49
  else
50
50
  STDOUT.puts report.to_s
51
- CLI.print_update_message unless Headdesk::Versions.latest_version?
51
+ print_update_message unless Headdesk::Versions.latest_version?
52
52
  end
53
53
  rescue CliError => cli_err
54
54
  STDERR.puts cli_err.message
@@ -61,7 +61,7 @@ module Headdesk
61
61
  end
62
62
  end
63
63
 
64
- CLI.print_update_message unless Headdesk::Versions.latest_version?
64
+ print_update_message unless Headdesk::Versions.latest_version?
65
65
 
66
66
  exit !all_matches.empty?
67
67
  end
@@ -49,7 +49,7 @@ module Headdesk
49
49
  # analyze if requested
50
50
  Headdesk::Analyze.at(output_path) if options[:analyze]
51
51
 
52
- CLI.print_update_message unless Headdesk::Versions.latest_version?
52
+ print_update_message unless Headdesk::Versions.latest_version?
53
53
  rescue CliError => cli_err
54
54
  STDERR.puts cli_err.message
55
55
  CLI.command_help(Thor::Base.shell.new, 'unpack')
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Headdesk
4
- VERSION = '0.16.0'
4
+ VERSION = '0.16.1'
5
5
  APKTOOL_VERSION = '2.3.4'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: headdesk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.16.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Wilson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-11 00:00:00.000000000 Z
11
+ date: 2020-02-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -233,6 +233,7 @@ files:
233
233
  - docs/target_sdk_version.md
234
234
  - docs/teak/api21_icon.md
235
235
  - docs/teak/configuration.md
236
+ - docs/unity_version.md
236
237
  - exe/headdesk
237
238
  - ext/apktool_2.3.4.jar
238
239
  - headdesk.gemspec
@@ -253,6 +254,7 @@ files:
253
254
  - lib/headdesk/checks/teak.rb
254
255
  - lib/headdesk/checks/teak/api21_icon.rb
255
256
  - lib/headdesk/checks/teak/teak.rb
257
+ - lib/headdesk/checks/unity_version.rb
256
258
  - lib/headdesk/cli.rb
257
259
  - lib/headdesk/cli_commands/analyze.rb
258
260
  - lib/headdesk/cli_commands/blame.rb