Skip to content

Commit

Permalink
Merge pull request #20 from DeployGate/fix/adaptive_icon
Browse files Browse the repository at this point in the history
Fixed a flag to detect if an icon is an adaptive icon
  • Loading branch information
jmatsu authored Dec 6, 2019
2 parents e740f7d + 68e70fd commit 266058f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/android_apk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,8 @@ def self.read_adaptive_icon(apk, filepath)
return unless apk.icon.end_with?(".xml") && apk.icon.start_with?("res/mipmap-anydpi-v26/")

# invalid xml file may throw an error
apk.adaptive_icon = File.open(apk.icon) do |f|
f.each_line.any? { |l| l.include?("adaptive-icon") }
apk.adaptive_icon = !!Zip::File.open(filepath) do |zip_file|
zip_file.find_entry(apk.icon)&.get_input_stream&.read&.include?("adaptive-icon")
end
rescue StandardError => _e
apk.adaptive_icon = false # ensure
Expand Down
Binary file removed res/mipmap-anydpi-v26/ic_launcher.xml
Binary file not shown.

0 comments on commit 266058f

Please sign in to comment.