Skip to content

Commit

Permalink
patch framework to prevent extension verification (forced webstore only)
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanKoppenhaver-NCC committed Jan 16, 2018
1 parent 1bdafac commit 1e7fb69
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/processor/macosx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class ChromeProcessor::MacOSX < ChromeProcessor::UNIX
FinalAppName = "Chromium.app"
BinDirectory = "Contents/MacOS"
AppBinary = "Chromium"
FrameworkBinaryGlob = 'Contents/Versions/*/Chromium Framework.framework/Versions/A/Chromium Framework'
DefaultFilesystemLocation = File.expand_path("~/Applications/")

ChromeLocation = "/Applications/Google Chrome.app"
Expand All @@ -24,6 +25,15 @@ def tweak_install
# move the Chromium binary
FileUtils.mv(newbin, origbin)

# patch out unoverridable flags for webstore-only extensions
framework_glob = File.expand_path(FrameworkBinaryGlob, @extdir)
framework_fn = Dir.glob(framework_glob).first
raise "Can't find framework file at #{framework_glob} to patch" unless File.exist? framework_fn
framework_bin = File.read(framework_fn)
framework_bin.sub! 'ExtensionInstallVerification', 'ExtensionInstallVerificati_1'
framework_bin.sub! 'ExtensionInstallVerification', 'ExtensionInstallVerificati_2'
File.write(framework_fn, framework_bin)

# create Ruby shim script
open(newbin, "w", 0755) do |f|
f.write(<<-EOF)
Expand Down

0 comments on commit 1e7fb69

Please sign in to comment.