codeobscure 0.1.7.0 → 0.1.7.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f1b01768fb2baf4d35749fd2eec703cb75894129880cc7fd1f9173d90fd9076
4
- data.tar.gz: c54a646d78044c0bf807a5f427943b2cab510b462a400ccb47db77b190742556
3
+ metadata.gz: 986bb36e0be56d60b586b367c496d739701956872b9fd753a6e12e6cf34fcd30
4
+ data.tar.gz: e753ae869c4525db8298c1680d3cb5e8d56f3c0e5ecafc843e25725bc6d34d4e
5
5
  SHA512:
6
- metadata.gz: 14473fb52cb52f8e0f307ef02110056e6276658f6ee791509e5c54e1507ca25e8cf8a4f7614bc94d43c8cbcc7836e2b99c8ff1acb15896e03969cee19aedcffe
7
- data.tar.gz: 13801f1937b282ca68011811338f415ea7ba4d5ece518043c57d89b2758fb36318eb294a495e74b97ce62c3a7c000037180e89c3867c5f306e903d91daa1aed5
6
+ metadata.gz: 44ab20b1efc7d5e7e23a52570a61752230c4c2fce9248974215a9e4f1d81007c6b2aabbaf204c0ad45b50eb7daffce2e29b1c8c5946e436e910ecc5147be25a5
7
+ data.tar.gz: 853c6035e6d2dc77e197b7b3eae0ed010b5520a67b8235319cf8952798ee1c4d10c0a491debac6a971932cb8d529606575292f70869f5ef11a2241206e47ab2b
@@ -49,7 +49,7 @@ module Codeobscure
49
49
  options[:type] = v
50
50
  end
51
51
 
52
- opts.on("-s", "--strict", "strict mode. It will filter all string") do |v|
52
+ opts.on("-s", "--strict", "strict mode. It will filter all string. If there are many kvo in code, please add -s.") do |v|
53
53
  options[:strict] = true
54
54
  end
55
55
 
@@ -12,9 +12,12 @@ module Obscure
12
12
 
13
13
  @@STRING_SYMBOL_FILE="func.list"
14
14
  @@IGNORE_NAME="ignoresymbols"
15
+ #保留项目特征,避免过度混淆被识别
16
+ @@PROJECT_TRAIT = ["Model", "View", "Field", "Label", "Item", "ViewModel", "Cell", "Button", "ViewController", "TableView", "CollectionView", "Control", "Entity", "Delegate"]
15
17
 
16
18
  #type 1 :随机字符, 2 : 随机单词, 3 : 自定义单词替换
17
- def self.ramdomString(var_type , replace_type = 1)
19
+ #reference_content 原来准备替换的内容, 避免过度混淆
20
+ def self.ramdomString(var_type , replace_type = 1, reference_content = nil)
18
21
  result = ""
19
22
  case replace_type
20
23
  when 1
@@ -38,6 +41,14 @@ module Obscure
38
41
  raise "c选项功能暂未实现,下一版本中加入!"
39
42
  end
40
43
 
44
+ for trait in @@PROJECT_TRAIT do
45
+ if reference_content
46
+ if reference_content.end_with? trait
47
+ result += trait
48
+ break
49
+ end
50
+ end
51
+ end
41
52
 
42
53
  result
43
54
  end
@@ -90,7 +101,7 @@ module Obscure
90
101
  line_content = line.rstrip.split(":").last
91
102
  result = FiltSymbols.query(line_content)
92
103
  if result.nil? || result.empty?
93
- ramdom = ramdomString line_type , replace_type
104
+ ramdom = ramdomString line_type , replace_type, line_content
94
105
  if line_type == "p"
95
106
  result = FiltSymbols.query("set#{line_content.upcase_first_letter}")
96
107
  if result.nil? || result.empty?
@@ -1,3 +1,3 @@
1
1
  module Codeobscure
2
- VERSION = "0.1.7.0"
2
+ VERSION = "0.1.7.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: codeobscure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7.0
4
+ version: 0.1.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kaich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-13 00:00:00.000000000 Z
11
+ date: 2018-12-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler