headdesk 0.4.0 → 0.5.0

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
  SHA1:
3
- metadata.gz: 684f9db7853042da5d0dc68f50c3e877659095a0
4
- data.tar.gz: f50419d5e71a6780ddcddcbb8e53d058aac43fce
3
+ metadata.gz: baa239641bcf15d4fada12d0909b5f9e6e3bf006
4
+ data.tar.gz: '082b47e0e4093a7deffda1ad64034f41e091f718'
5
5
  SHA512:
6
- metadata.gz: afe0253dbdfc88f878e745127e2e72d04194b4ce0256d8548f559b7cb50cd360ae3853214b0914d75347fbd10156f5f0e3c93035a38ec0d0e49f8f4079f696f5
7
- data.tar.gz: 333dec843afb4976d39d766450dacbaa665f4d78a4a963d6e97deeef9ea0a44a6d41cd9789a32daf45c8a6bdeafca3eddd8a818e260d0cbc64dc1e64dad49088
6
+ metadata.gz: b9a255eda983eac233626efd5edd88cc72b027200937abf7466e7cccaf8f2b54f2f7663543f57a22f078396197eb2b2d39f53f8ac8a44c0e532b364d296c4c26
7
+ data.tar.gz: 4af639f3ac6e3cc687b8d810eba3f1854b124ecc718215d377fd2ae8ac7e4f9a81a79cf5188695f58119dd3b6bed8cec6a002b9dd6e0a02669052d5cf5404540
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- headdesk (0.3.0)
4
+ headdesk (0.5.0)
5
5
  awesome_print (~> 1.8)
6
6
  nokogiri (~> 1.10)
7
7
  thor (~> 0.20)
@@ -27,7 +27,7 @@ GEM
27
27
  jaro_winkler (1.5.1)
28
28
  kwalify (0.7.2)
29
29
  mini_portile2 (2.4.0)
30
- nokogiri (1.10.0)
30
+ nokogiri (1.10.1)
31
31
  mini_portile2 (~> 2.4.0)
32
32
  parallel (1.12.1)
33
33
  parser (2.5.3.0)
data/README.md CHANGED
@@ -15,6 +15,14 @@ This is output from the check that ensures that the version of the Facebook SDK
15
15
 
16
16
  `headdesk` can also output to JSON.
17
17
 
18
+ ## Checks
19
+ * [api26](docs/api26.md)
20
+ * [facebook](docs/facebook.md)
21
+ * [receiver](docs/receiver.md)
22
+ * [teak/api21_icon](docs/teak/api21_icon.md)
23
+ * [teak/caching](docs/teak/caching.md)
24
+ * [teak/configuration](docs/teak/configuration.md)
25
+
18
26
  ## Installation
19
27
 
20
28
  Add this line to your application's Gemfile:
data/docs/api26.md ADDED
@@ -0,0 +1,14 @@
1
+ # api26
2
+ Ensures that the APK is built with `targetSdkVersion` at least 26.
3
+
4
+ ## Will Fail If
5
+ * `targetSdkVersion` is less than 26.
6
+
7
+ ## Exports
8
+ None.
9
+
10
+ ## Reason
11
+ As of November 1, 2018 Google Play requires that all apps, and app updates, target Android 8 (API 26).
12
+
13
+ > Google Play will require that new apps target at least Android 8.0 (API level 26) from August 1, 2018, and that app updates target Android 8.0 from November 1, 2018.
14
+ Source: https://developer.android.com/distribute/best-practices/develop/target-sdk
data/docs/facebook.md ADDED
@@ -0,0 +1,30 @@
1
+ # facebook
2
+ Ensure that the version of the Facebook SDK in use has been released in the last two years.
3
+
4
+ ## Will Skip If
5
+ * The APK does not include the Facebook SDK (`com.facebook.FacebookSdk` class is not present).
6
+
7
+ ## Will Fail If
8
+ * The Facebook SDK version was not released in the last two years.
9
+
10
+ ## Exports
11
+ The version information of the included Facebook SDK.
12
+
13
+ ### Example
14
+ ```json
15
+ {
16
+ "facebook_sdk": {
17
+ "major": 4,
18
+ "minor": 33,
19
+ "patch": 0,
20
+ "version": "4.33.0",
21
+ "date": "2018-05-01"
22
+ }
23
+ }
24
+ ```
25
+
26
+ ## Reason
27
+ Facebook deprecates their SDKs two years after release.
28
+
29
+ > Core APIs and SDKs are central to the Facebook Platform offered to developers. These elements are subject to a version system, and guarantee that anything considered a core API node, field, edge, dialog, SDK or SDK method will remain available and unchanged for at least two years from the launch of that version.
30
+ Source: https://developers.facebook.com/docs/apps/versions/
data/docs/receiver.md ADDED
@@ -0,0 +1,28 @@
1
+ # receiver
2
+ Ensures that each `<receiver>` declared in the `AndroidManifest.xml` points to a Java class which is present in the APK.
3
+
4
+ ## Will Fail If
5
+ * Any `<receiver>` points to a Java class that does not exist in the APK.
6
+
7
+ ## Exports
8
+ The recievers present in `AndroidManifest.xml`
9
+
10
+ ### Example
11
+ ```json
12
+ {
13
+ "receivers": [
14
+ {
15
+ "name": "com.amazon.device.iap.ResponseReceiver"
16
+ },
17
+ {
18
+ "name": "io.teak.sdk.Teak"
19
+ },
20
+ {
21
+ "name": "com.facebook.CurrentAccessTokenExpirationBroadcastReceiver"
22
+ }
23
+ ]
24
+ }
25
+ ```
26
+
27
+ ## Reason
28
+ Frequently, during app updates, build settings will change, or an SDK will be removed but the `<receiver>` inside of the `AndroidManifest.xml` will not get updated or removed. This causes the app to crash.
@@ -0,0 +1,24 @@
1
+ # teak/api21_icon
2
+ Ensures that the APK contains a notification icon for both Android 5+ (API 21+) as well as pre-Android 5, and that these are different icons.
3
+
4
+ ## Will Skip If
5
+ * The Teak SDK is not present.
6
+
7
+ ## Will Fail If
8
+ * There is no drawable resource for `io_teak_small_notification_icon`.
9
+ * There is no v21 drawable resource for `io_teak_small_notification_icon`
10
+ * The drawable resources point to the same image.
11
+
12
+ ## Exports
13
+ The values for `io_teak_small_notification_icon` for less than v21, and v21+.
14
+
15
+ ### Example
16
+ ```json
17
+ {
18
+ "icon": null,
19
+ "icon_v21": "@drawable/icon_white"
20
+ }
21
+ ```
22
+
23
+ ## Reason
24
+ Android 5+ uses [Material Design](https://material.io/design/iconography/#notification) and needs a white and transparant icon for proper display of notification icons in the tray.
@@ -0,0 +1,18 @@
1
+ # teak/caching
2
+ Ensures that the APK contains a notification icon for both Android 5+ (API 21+) as well as pre-Android 5, and that these are different icons.
3
+
4
+ ## Will Skip If
5
+ * The Teak SDK is not present.
6
+ * The version of the Teak SDK is greater or equal to 2.0.0.
7
+
8
+ ## Will Fail If
9
+ * `io_teak_enable_caching` is not specified.
10
+ * `io_teak_enable_caching` is not set to `true`.
11
+
12
+ ## Exports
13
+ None.
14
+
15
+ ## Reason
16
+ The Teak SDK uses [Android HTTP Caching](https://developer.android.com/training/efficient-downloads/redundant_redundant#ResponseCache) to prevent downloading redundant Notification assets.
17
+
18
+ The `io_teak_enable_caching` setting allows you to disable this behavior, however it should be enabled unless your app, or an SDK that you use, makes uncommon assumptions.
@@ -0,0 +1,29 @@
1
+ # teak/configuration
2
+ Ensures that the APK properly configures the Teak SDK.
3
+
4
+ ## Will Skip If
5
+ * The Teak SDK is not present.
6
+
7
+ ## Will Fail If
8
+ * `io_teak_app_id` is not specified.
9
+ * `io_teak_api_key` is not specified.
10
+ * `gcm_defaultSenderId` or `io_teak_gcm_sender_id` are not specified.
11
+ * `gcm_defaultSenderId` and `io_teak_gcm_sender_id` are specified, and set to different values.
12
+ * The version of the Teak SDK is greater or equal to 2.0.0 and...
13
+ * `google_app_id` or `io_teak_firebase_app_id` are not specified.
14
+ * `google_app_id` and `io_teak_firebase_app_id` are specified, and set to different values.
15
+
16
+ ## Exports
17
+ The configuration values for the Teak SDK.
18
+
19
+ ### Example
20
+ ```json
21
+ {
22
+ "teak_app_id": "1234567890123456",
23
+ "teak_api_key": "abcdef1234567890abcdef1234567890",
24
+ "gcm_sender_id": "123456789012"
25
+ }
26
+ ```
27
+
28
+ ## Reason
29
+ Build configuration errors can cause
@@ -35,6 +35,10 @@ module Headdesk
35
35
  @check_name = cname if cname
36
36
  @check_name
37
37
  end
38
+
39
+ def doc
40
+ "#{check_name}.md"
41
+ end
38
42
  end
39
43
 
40
44
  def initialize(bundle)
@@ -46,6 +50,7 @@ module Headdesk
46
50
  export: {}
47
51
  }
48
52
  @report[:name] = self.class.check_name if self.class.respond_to?(:check_name)
53
+ @report[:doc] = "https://github.com/GoCarrot/headdesk/blob/#{Headdesk::VERSION}/docs/#{self.class.doc}" if self.class.respond_to?(:check_name)
49
54
  @status = :skip
50
55
  end
51
56
 
@@ -25,7 +25,7 @@ module Headdesk
25
25
  end
26
26
 
27
27
  def check_name(cname = nil)
28
- cname = "teak.#{cname}" if cname
28
+ cname = "teak/#{cname}" if cname
29
29
  super(cname)
30
30
  end
31
31
  end
@@ -34,12 +34,16 @@ module Headdesk
34
34
  }
35
35
  end
36
36
 
37
+ def link
38
+ "\e[37;4m%s\e[0m"
39
+ end
40
+
37
41
  def to_s
38
42
  ERB.new(<<~DESCRIPTION, nil, '>').result(binding)
39
43
  Bundle Id: <%= bundle_id %>\n
40
44
  <%= describe %>\n
41
45
  <% for @check in checks %>
42
- <%= color_for_status[@check[:status]] % icon_for_status[@check[:status]] %> <%= color_for_status[@check[:status]] % (@check[:description] + " (" + @check[:name] + ")") %>\n
46
+ <%= color_for_status[@check[:status]] % icon_for_status[@check[:status]] %> <%= color_for_status[@check[:status]] % @check[:description] %> (<%= link % @check[:doc] %>)\n
43
47
  <% for @step in @check[:steps] %>
44
48
  ↳ <%= color_for_status[@step[:status]] % icon_for_status[@step[:status]] %> <%= color_for_status[@step[:status]] % @step[:description] %>\n
45
49
  <% end %>
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Headdesk
4
4
  APKTOOL_VERSION = '2.3.4'
5
- VERSION = '0.4.0'
5
+ VERSION = '0.5.0'
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.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pat Wilson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-15 00:00:00.000000000 Z
11
+ date: 2019-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -128,6 +128,12 @@ files:
128
128
  - bin/console
129
129
  - bin/facebook_sdk_versions
130
130
  - bin/setup
131
+ - docs/api26.md
132
+ - docs/facebook.md
133
+ - docs/receiver.md
134
+ - docs/teak/api21_icon.md
135
+ - docs/teak/caching.md
136
+ - docs/teak/configuration.md
131
137
  - exe/headdesk
132
138
  - ext/apktool_2.3.4.jar
133
139
  - headdesk.gemspec