pindo 4.9.3 → 4.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,127 +0,0 @@
1
- require 'highline/import'
2
- require 'xcodeproj'
3
- require 'find'
4
- require 'fileutils'
5
-
6
- module Pindo
7
- class Command
8
- class Dev < Command
9
- class Confusecode < Dev
10
-
11
- include Command::DeployOptions
12
-
13
- include CommonConfuseProj
14
-
15
- self.summary = '设置混淆编译第一步'
16
-
17
- self.description = <<-DESC
18
- 目前该混淆方法已经废弃。设置混淆编译第一步.用法: pindo dev confusecode --type=class_method_variable_protocol_property_category_pods
19
-
20
- DESC
21
-
22
- self.arguments = [
23
- CLAide::Argument.new('path/to/config.json', true),
24
- ]
25
-
26
- def self.options
27
- [
28
-
29
- ].concat(super)
30
- end
31
-
32
- def initialize(argv)
33
- super
34
- end
35
-
36
- def validate!
37
- super
38
- end
39
-
40
- def run
41
-
42
- current_dir = Dir.pwd
43
- current_project_dir = current_dir
44
- app_config_dir = clong_buildconfig_repo(repo_name: @deploy_repo_name)
45
-
46
- clang_repo_dir = clone_devclang_repo
47
- # if !File.exist?(clang_repo_dir)
48
- puts "#{clang_repo_dir}"
49
- puts "There is no clang tool !!! dev confusecode"
50
- # return
51
- # end
52
-
53
- symash_type = confuse_version_type(path:current_project_dir, default_type:"symash2")
54
- if @newconfuse_flag
55
- symash_type = "symash2"
56
- end
57
- confuse_tool_path = File.join(clang_repo_dir, symash_type)
58
- puts "Confuse Tool Path: #{confuse_tool_path}"
59
-
60
- meaning_tool = File.join(clang_repo_dir, "MeaningfulTools/MeaningfulName")
61
-
62
- if symash_type == "symash1"
63
-
64
- base_db = File.join(clang_repo_dir, "MeaningfulTools/confuse.db")
65
- meaning_db = File.join(current_project_dir, "SymashCache/app_confuse.db")
66
- origin_json_dir = File.join(current_project_dir, "SymashCache/Original")
67
- output_dir = File.join(current_project_dir, "SymashCache")
68
- confuse_type= @confuse_type
69
-
70
- if File.exist?(File.join(output_dir, "Replaced.json"))
71
- FileUtils.rm_rf(File.join(output_dir, "Replaced.json"))
72
- end
73
-
74
- puts "Tool: #{meaning_tool}"
75
- puts "Base DB: #{base_db}"
76
- puts "DB: #{meaning_db}"
77
- puts "Origin Dir: #{origin_json_dir}"
78
- puts "Output Dir: #{output_dir}"
79
- puts "Project Dir: #{current_project_dir}"
80
- puts "Confuse Type: #{confuse_type}"
81
-
82
- if File.exist?(origin_json_dir)
83
- command = meaning_tool + " -r -p 100 -i 100 -b " + @bundle_id + " -d " + origin_json_dir + " -o " + base_db + " -m " + meaning_db + " -t " + output_dir + " -f " + current_project_dir + " -z " + confuse_type
84
- puts "Command: #{command}"
85
- system command
86
- end
87
-
88
- text = File.read(File.join(current_project_dir, "Symash.json"))
89
- new_contents = text.gsub(/\"IMPORT\".*/, "\"IMPORT\":true,")
90
- File.open(File.join(current_project_dir, "Symash.json"), "w") {|file| file.puts new_contents }
91
-
92
- text = File.read(File.join(current_project_dir, "Symash.json"))
93
- new_contents = text.gsub(/\"STRICT\".*/, "\"STRICT\":true,")
94
- File.open(File.join(current_project_dir, "Symash.json"), "w") {|file| file.puts new_contents }
95
- else
96
-
97
-
98
- puts "Tool: #{meaning_tool}"
99
-
100
- puts "+++++++"
101
- puts "+++++++"
102
- puts "+++++++"
103
- service_path = File.join(confuse_tool_path, "/Applications/SymashX.app/Contents/MacOS/symashctl")
104
- command1 = "cd #{current_project_dir} && " + service_path + " stop"
105
- puts "Command: #{command1}"
106
- system command1
107
- puts "+++++++"
108
- puts "+++++++"
109
- puts "+++++++"
110
-
111
- if File.exist?(File.join(current_project_dir, "SymashData/export-sympkg.plist"))
112
- command = meaning_tool + " -q -f " + current_project_dir
113
- puts "Command: #{command}"
114
- system command
115
- end
116
-
117
- command2 = "cd #{current_project_dir} && " + service_path + " start -backend"
118
- puts "Command: #{command2}"
119
- system command2
120
- puts "Done !"
121
-
122
- end
123
- end
124
- end
125
- end
126
- end
127
- end
@@ -1,111 +0,0 @@
1
- require 'highline/import'
2
- require 'xcodeproj'
3
- require 'find'
4
- require 'fileutils'
5
-
6
-
7
- module Pindo
8
- class Command
9
- class Dev < Command
10
- class Confuseproj < Dev
11
-
12
- require 'pindo/deploy/confuseproj'
13
-
14
- include Command::DeployOptions
15
-
16
- include CommonConfuseProj
17
-
18
- self.summary = '设置混淆编译第一步'
19
-
20
- self.description = <<-DESC
21
- 设置混淆编译第一步. 用法:\n
22
- pindo dev confuseproj --type=class_method_variable_protocol_property_category
23
-
24
- for example: --type=class_method
25
-
26
- class: confuse class
27
- method: confuse method
28
-
29
- ...
30
- DESC
31
-
32
- self.arguments = [
33
-
34
- ]
35
-
36
- def self.options
37
- [
38
- ].concat(super)
39
- end
40
-
41
- def initialize(argv)
42
- super
43
- end
44
-
45
- def validate!
46
- super
47
- end
48
-
49
- def run
50
-
51
- current_dir = Dir.pwd
52
- current_project_dir = current_dir
53
- puts "+++++ #{current_project_dir}"
54
-
55
- app_config_dir = clong_buildconfig_repo(repo_name: @deploy_repo_name)
56
- clang_repo_dir = clone_devclang_repo
57
- # if !File.exist?(clang_repo_dir)
58
- puts "#{clang_repo_dir}"
59
- puts "There is no clang tool !!! dev confuseproj"
60
- # return
61
- # end
62
-
63
- symash_type = confuse_version_type(path:app_config_dir, default_type:"symash2")
64
- if @newconfuse_flag
65
- symash_type = "symash2"
66
- end
67
- confuse_tool_path = File.join(clang_repo_dir, symash_type)
68
- puts "Confuse Tool Path: #{confuse_tool_path}"
69
-
70
- puts "Clang Path: #{confuse_tool_path}"
71
- install_symash(clang_path:confuse_tool_path)
72
-
73
- current_project_fullname = ""
74
- Dir.foreach(current_dir) do |file|
75
- if file =~ /(.*).xcodeproj/
76
- current_project_fullname = file
77
- break;
78
- end
79
- end
80
-
81
- old_proj_name = File.basename(current_project_fullname, ".xcodeproj")
82
-
83
- config_confuse_project(clang_path:confuse_tool_path, project_name:old_proj_name, project_path:current_project_dir, default_type:symash_type)
84
- config_symash(clang_path:confuse_tool_path, project_path:current_project_dir, confuse_type:@confuse_type, default_type:symash_type)
85
-
86
- force_config = nil
87
- force_config = {}
88
- # force_config['BACKEND_SYMASH_DISABLE_SPL'] = true
89
- force_config['BACKEND_SYMASH_DISABLE_BCF_PROB'] = 50
90
-
91
- update_symash_config(app_config_dir:app_config_dir, project_path:current_project_dir, confuse_type:@confuse_type, force_config: force_config)
92
-
93
- if symash_type == "symash2"
94
- Dir.chdir(current_project_dir)
95
- puts "+++++ #{current_project_dir}"
96
- service_path = File.join(confuse_tool_path, "/Applications/SymashX.app/Contents/MacOS/symashctl")
97
- command1 = "cd #{current_project_dir} && " + service_path + " stop"
98
- command2 = "cd #{current_project_dir} && " + service_path + " start -export"
99
- puts "Command: #{command1}"
100
- system command1
101
- puts "Command: #{command2}"
102
- system command2
103
- Dir.chdir(current_project_dir)
104
- puts "Done !"
105
- end
106
-
107
- end
108
- end
109
- end
110
- end
111
- end
@@ -1,156 +0,0 @@
1
- require 'fileutils'
2
- require 'pindo/client/giteeclient'
3
-
4
- module Pindo
5
- class Command
6
- class Dev < Command
7
- class Createbuild < Dev
8
-
9
- include Appselect
10
-
11
- self.summary = '创建工程编译选项'
12
-
13
- self.description = <<-DESC
14
-
15
- 创建工程编译选项, 用法:pindo dev createbuild,按照提示填写。创建完成之后, 使用pindo dev autobuild编译时可以选择创建好的编译选项
16
-
17
- DESC
18
-
19
- self.arguments = [
20
-
21
- ]
22
-
23
- def self.options
24
- [
25
- ['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id来重签名, 用法: --deploy'],
26
- ].concat(super)
27
- end
28
-
29
- def initialize(argv)
30
- @args_deploy_flag = argv.flag?('deploy', false)
31
- super
32
- end
33
-
34
- def validate!
35
- super
36
-
37
- @app_type = ask('App的代号(必填): ')
38
- help! '需要一个唯一的代号' if @app_type.nil? || @app_type.empty?
39
-
40
- @platform_name = ask('使用的Boss平台名称(必填): ')
41
- help! '需要指定Boss平台' if @platform_name.nil? || @platform_name.empty?
42
- @git_repo_name = @platform_name
43
-
44
- @app_desc = ask('请填写App代号的描述(可不填): ')
45
-
46
-
47
-
48
- @selected_bundleid= nil
49
- if @args_deploy_flag
50
- @selected_bundleid = get_selected_deploy_bundleid()
51
- else
52
- @selected_bundleid = get_selected_dev_bundleid()
53
- end
54
-
55
- puts "选择使用的bundle id: #{@selected_bundleid}"
56
-
57
- end
58
-
59
- def run
60
-
61
- @gitee_client = GiteeClient.new(access_token:pindo_single_config.gitee_api_key)
62
- pindo_setting_dir = pindo_single_config.pindo_env_configdir
63
-
64
- setting_file = 'dev_build_setting.json'
65
- if @args_deploy_flag
66
- setting_file = 'deploy_build_setting.json'
67
- end
68
-
69
- setting_file_fullname = File.join(pindo_setting_dir, setting_file)
70
- setting_file_json = JSON.parse(File.read(setting_file_fullname))
71
- if setting_file_json[@app_type]
72
- answer = agree("输入的App代号已存,重新创建?(Y/n):")
73
- unless answer
74
- raise Informative, "输入的App代号已存在!!!"
75
- end
76
- end
77
-
78
- puts "========================="
79
- puts "========================="
80
- puts
81
- puts
82
- puts "App的代号: #{@app_type}"
83
- puts "Boss平台名称: #{@platform_name}"
84
- puts "App选择的bundle id: #{@selected_bundleid}"
85
- puts "仓库名称: #{@git_repo_name}"
86
- puts "App的描述: #{@app_desc}"
87
- puts
88
-
89
- answer = agree("请确认上面信息是否正确(Y/n):")
90
- unless answer
91
- raise Informative, "重新输入 !!!"
92
- end
93
-
94
- args_temp = [@git_repo_name]
95
- args_temp << "--test"
96
- Pindo::Command::Deploy::Initconfig::run(args_temp)
97
-
98
- modify_build_setting
99
-
100
- modify_build_config_json
101
-
102
- end
103
-
104
-
105
-
106
- def modify_build_setting
107
-
108
- pindo_setting_dir = clone_pindo_env_config_repo(force_delete:false)
109
- setting_file = 'dev_build_setting.json'
110
- if @args_deploy_flag
111
- setting_file = 'deploy_build_setting.json'
112
- end
113
- setting_file_fullname = File.join(pindo_setting_dir, setting_file)
114
- setting_file_json = JSON.parse(File.read(setting_file_fullname))
115
- setting_file_json[@app_type] = {}
116
- setting_file_json[@app_type]['git_repo_name'] = @git_repo_name
117
- setting_file_json[@app_type]['build_desc'] = @app_desc
118
- setting_file_json = Hash[setting_file_json.sort]
119
- File.open(setting_file_fullname, "w") do |f|
120
- f.write(JSON.pretty_generate(setting_file_json))
121
- end
122
-
123
- git_addpush_repo(path:pindo_setting_dir, message:"add app_type: #{@app_type}", commit_file_params:[setting_file])
124
- end
125
-
126
- def modify_build_config_json
127
-
128
- pindo_dir = pindo_single_config.pindo_dir
129
- app_config_dir = File.join(pindo_dir, @git_repo_name)
130
-
131
- selected_config_dir = clong_buildconfig_repo(repo_name: @selected_bundleid)
132
- if File.exist?(File.join(selected_config_dir, "config.json"))
133
- FileUtils.cp_r(File.join(selected_config_dir, "config.json"), app_config_dir)
134
- end
135
-
136
- app_config_file = File.join(app_config_dir, "config.json")
137
- app_config_json = JSON.parse(File.read(app_config_file))
138
-
139
- app_config_json = app_config_json || {}
140
- app_config_json["project_info"]["app_type"] = @app_type
141
- app_config_json["project_info"]["app_desc"] = @app_desc
142
- app_config_json["app_setting"]["kGUKeyAppPlatform"] = @platform_name
143
-
144
- File.open(app_config_file, "w") do |f|
145
- f.write(JSON.pretty_generate(app_config_json))
146
- end
147
- git_addpush_repo(path:app_config_dir, message:"更新配置")
148
- end
149
-
150
-
151
-
152
- end
153
- end
154
- end
155
- end
156
-
@@ -1,75 +0,0 @@
1
- require 'fileutils'
2
-
3
- module Pindo
4
- class Command
5
- class Dev < Command
6
- class Pgyercert < Dev
7
-
8
- include Appselect
9
-
10
- include XcodeCertHelper
11
-
12
- self.summary = '生成pgyer需要的证书,上传个pgyer重签名用'
13
-
14
- self.description = <<-DESC
15
-
16
- 生成pgyer需要的证书,上传个pgyer重签名用。
17
-
18
- DESC
19
-
20
- self.arguments = [
21
-
22
- ]
23
-
24
- def self.options
25
- [
26
- ['--deploy', '默认用开发的bundle id,使用--deploy设置使用发布bundle id'],
27
- ['--adhoc', '默认用dev证书,使用--adhoc设置使用adhoc证书'],
28
- ].concat(super)
29
- end
30
-
31
- def initialize(argv)
32
- @args_adhoc_flag = argv.flag?('adhoc', false)
33
- @args_deploy_flag = argv.flag?('deploy', false)
34
- super
35
- end
36
-
37
-
38
- def run
39
-
40
- mainapp_bundleid= nil
41
- if @args_deploy_flag
42
- mainapp_bundleid = get_selected_deploy_bundleid()
43
- else
44
- mainapp_bundleid = get_selected_dev_bundleid()
45
- end
46
- puts "选择使用的bundle id: #{mainapp_bundleid}"
47
-
48
- args_temp = []
49
- args_temp << mainapp_bundleid
50
- Pindo::Command::Deploy::Pullconfig::run(args_temp)
51
-
52
-
53
- # project_dir = Dir.pwd
54
- # Dir.chdir(project_dir)
55
- # config_json_file = File.join(project_dir,"config.json")
56
- # Debug::modify_cert_with_project(project_dir:project_dir, config_file:config_json_file)
57
-
58
- args_temp = []
59
- if @args_adhoc_flag
60
- args_temp << "--adhoc"
61
- else
62
- args_temp << "--dev"
63
- end
64
-
65
- Pindo::Command::Deploy::Cert::run(args_temp)
66
-
67
- end
68
-
69
-
70
-
71
- end
72
- end
73
- end
74
- end
75
-