[WIP] shadowsocks implementation added
This commit is contained in:
parent
40996888c9
commit
6583090d4f
2259 changed files with 417734 additions and 92 deletions
55
client/scripts/ss_project_patcher.rb
Normal file
55
client/scripts/ss_project_patcher.rb
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'xcodeproj'
|
||||
|
||||
class SSPatcher
|
||||
attr :project
|
||||
attr :target_main
|
||||
|
||||
def run(file)
|
||||
open_project file
|
||||
open_target_main
|
||||
|
||||
patch_main_target
|
||||
|
||||
@project.save
|
||||
end
|
||||
|
||||
def open_project(file)
|
||||
@project = Xcodeproj::Project.open(file)
|
||||
die 'Failed to open the project file: ' + file if @project.nil?
|
||||
end
|
||||
|
||||
def open_target_main
|
||||
@target_main = @project.native_targets
|
||||
.select { |target| target.name == 'ShadowSocks' }
|
||||
.first
|
||||
return @target_main if not @target_main.nil?
|
||||
|
||||
die 'Unable to open ShadowSocks target'
|
||||
end
|
||||
|
||||
def patch_main_target
|
||||
@target_main.resources_build_phase.files.each do |f|
|
||||
puts f.display_name
|
||||
if f.display_name === "LICENSE"
|
||||
f.remove_from_project
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def die(msg)
|
||||
print $msg
|
||||
exit 1
|
||||
end
|
||||
end
|
||||
|
||||
if ARGV.length < 1
|
||||
puts "Usage: <script> project_file"
|
||||
exit 1
|
||||
end
|
||||
|
||||
|
||||
r = SSPatcher.new
|
||||
r.run ARGV[0]
|
||||
exit 0
|
||||
Loading…
Add table
Add a link
Reference in a new issue