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 +4 -4
- data/Gemfile.lock +1 -1
- data/docs/unity_version.md +8 -0
- data/lib/headdesk/apk.rb +17 -0
- data/lib/headdesk/checks/unity_version.rb +17 -0
- data/lib/headdesk/cli_commands/analyze.rb +1 -1
- data/lib/headdesk/cli_commands/blame.rb +1 -1
- data/lib/headdesk/cli_commands/unpack.rb +1 -1
- data/lib/headdesk/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ffbd38c12b42f3040a9ed8fe1a352902bf446da77c780c2d1bc0634296c19c96
|
4
|
+
data.tar.gz: 208004bf2fe7733cc44466522e9dbc93d9e6b92e5edf5e5148ad676cc608a57f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee39e258d6dd3dfb55beaa4c3fc92b59993c27a396aebba1872bc4a0f861acb83f23c1c3fd3cb380ddff904a83b11d5f53d8a471a1d53621068c3a5e43d31da
|
7
|
+
data.tar.gz: edabb82c74a6cdaabf39dc2aa74944db21929e5f2fecd98b4ad85f62799b722c1820d963bf82532890b1ec9c0a031f4cd8c694f3ec0463634af25529eac34f84
|
data/Gemfile.lock
CHANGED
data/lib/headdesk/apk.rb
CHANGED
@@ -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
|
-
|
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
|
@@ -49,7 +49,7 @@ module Headdesk
|
|
49
49
|
# analyze if requested
|
50
50
|
Headdesk::Analyze.at(output_path) if options[:analyze]
|
51
51
|
|
52
|
-
|
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')
|
data/lib/headdesk/version.rb
CHANGED
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.
|
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
|
+
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
|