@@ -35,50 +35,50 @@ class SCTest {
35
35
}
36
36
37
37
@Test
38
- fun `terminal verification` () {
38
+ fun `1 - terminal verification` () {
39
39
" echo $extensionName " .runCommand { command, result ->
40
40
assert (command.contains(result.removeNewLines()))
41
41
}
42
42
}
43
43
44
44
@Test
45
- fun `gradlew signingReport` () {
45
+ fun `2 - gradlew signingReport` () {
46
46
signingReportTask.runCommand { _, report ->
47
47
assert (report.contains(" SHA1" ) && report.contains(" BUILD SUCCESSFUL" ))
48
48
}
49
49
}
50
50
51
51
@Test
52
- fun `fingerprint extraction` () {
52
+ fun `3 - fingerprint extraction` () {
53
53
signingReportTask.runCommand { _, report ->
54
54
assert (report.extractFingerprint().split(" :" ).size == 20 )
55
55
}
56
56
}
57
57
58
58
@Test
59
- fun `locate string files for default configuration` () {
59
+ fun `4 - locate string files for default configuration` () {
60
60
prepareTask.runCommand { _, _ ->
61
61
assert (locateFiles(projectName, defaultConfig()).isNotEmpty())
62
62
}
63
63
}
64
64
65
65
@Test
66
- fun `backup string files` () {
66
+ fun `5 - backup string files` () {
67
67
prepareTask.runCommand { _, _ ->
68
68
assert (backupFiles(projectName, defaultConfig()).isNotEmpty())
69
69
}
70
70
}
71
71
72
72
@Test
73
- fun `restore string files` () {
73
+ fun `6 - restore string files` () {
74
74
prepareTask.runCommand { _, _ ->
75
75
assert (backupFiles(projectName, defaultConfig()).isNotEmpty())
76
76
assert (restoreFiles(projectName).isNotEmpty())
77
77
}
78
78
}
79
79
80
80
@Test
81
- fun `xml parsing` () {
81
+ fun `7 - xml parsing` () {
82
82
prepareTask.runCommand { _, _ ->
83
83
val files = backupFiles(projectName, defaultConfig())
84
84
files.forEach {
@@ -89,7 +89,7 @@ class SCTest {
89
89
90
90
91
91
@Test
92
- fun `obfuscate string files ` () {
92
+ fun `8 - obfuscate string values ` () {
93
93
signingReportTask.runCommand { _, report ->
94
94
val files = backupFiles(projectName, defaultConfig())
95
95
files.forEach { file ->
@@ -98,13 +98,33 @@ class SCTest {
98
98
val obfuscated = obfuscate(
99
99
" $projectName${File .separator}$mainModuleTest " ,
100
100
report.extractFingerprint(),
101
- entity)
101
+ entity
102
+ )
103
+ assert (obfuscated.value != entity.value)
104
+ }
105
+ }
106
+ }
107
+ }
108
+
109
+ @Test
110
+ fun `9 - obfuscate and reveal string values` () {
111
+ signingReportTask.runCommand { _, report ->
112
+ val files = backupFiles(projectName, defaultConfig())
113
+ files.forEach { file ->
114
+ val entities = parseXML(file, mainModuleTest, true )
115
+ entities.forEach { entity ->
116
+ val obfuscated = obfuscate(
117
+ " $projectName${File .separator}$mainModuleTest " ,
118
+ report.extractFingerprint(),
119
+ entity
120
+ )
102
121
assert (obfuscated.value != entity.value)
103
122
104
123
val original = reveal(
105
124
" $projectName${File .separator}$mainModuleTest " ,
106
125
report.extractFingerprint(),
107
- obfuscated)
126
+ obfuscated
127
+ )
108
128
109
129
assert (original.value == entity.value)
110
130
0 commit comments