Skip to content

Commit

Permalink
fixed documentation for new policies (#121)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbehr committed Nov 4, 2022
1 parent 58eaef6 commit 66d0c67
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 26 deletions.
16 changes: 10 additions & 6 deletions docs/task_documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -1458,12 +1458,14 @@ in the following path and name adjustments:
<dd class="plain-dd">
<pre><code class="language-plaintext">A/A/A/MyClass.properties
A/A/A/SomeResource.txt
com/mycompany/shared/SharedResource.txt
A/A/shared/SharedResource.txt
META-INF/services/com.mycompany.myproduct.MyClass
META-INF/services/com.mycompany.shared.SharedService</code></pre>
<p>
The path <code class="plain-code">com/mycompany/shared</code> does not match
any package name in the code base and thus is not changed.
any package name, but its path fragments
<code class="plain-code">com/mycompany</code> match the package name
<code class="plain-code">com.mycompany</code> and thus are changed.
<br>
The two service provider configuration files are not adjusted.
</p>
Expand Down Expand Up @@ -1502,12 +1504,14 @@ META-INF/services/com.mycompany.shared.SharedService</code></pre>
<dd class="plain-dd">
<pre><code class="language-plaintext">A/A/A/A.properties
A/A/A/SomeResource.txt
com/mycompany/shared/SharedResource.txt
A/A/shared/SharedResource.txt
META-INF/services/A.A.A.A
META-INF/services/com.mycompany.shared.SharedService</code></pre>
<p>
The path <code class="plain-code">com/mycompany/shared</code> does not match
any package name in the code base and thus is not changed.
any package name, but its path fragments
<code class="plain-code">com/mycompany</code> match the package name
<code class="plain-code">com.mycompany</code> and thus are changed.
<br>
The name <code class="plain-code">com.mycompany.shared.SharedService</code>
does not match any qualified class name and thus is not changed.
Expand All @@ -1521,8 +1525,8 @@ A/A/shared/SharedResource.txt
META-INF/services/A.A.A.A
META-INF/services/A.A.shared.SharedService</code></pre>
<p>
The path <code class="plain-code">com/mycompany/shared</code> does
not match any package name, but its path fragments
The path <code class="plain-code">com/mycompany/shared</code> does not match
any package name, but its path fragments
<code class="plain-code">com/mycompany</code> match the package name
<code class="plain-code">com.mycompany</code> and thus are changed.
<br>
Expand Down
40 changes: 20 additions & 20 deletions src/main/java/com/yworks/yguard/ObfuscatorTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -2748,17 +2748,17 @@ public enum ReplaceContentPolicy {
none,
/**
* If class obfuscation yields
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
* then text in resource files will be adjusted as follows
* com.yworks.SampleStuff -> A.A.SampleStuff
* com.other.OtherStuff -> A.other.OtherStuff
* com.yworks.SampleStuff -&gt; A.A.SampleStuff
* com.other.OtherStuff -&gt; A.other.OtherStuff
*/
lenient,
/**
* If class obfuscation yields
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
* then text in resource files will be adjusted as follows
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
*/
strict;
}
Expand All @@ -2774,42 +2774,42 @@ public enum ReplacePathPolicy {
none, // replaceName = false, replacePath = false
/**
* If class obfuscation yields
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
* then resource files will be renamed as follows
* com/yworks/SampleStuff.properties -> A/A/SampleStuff.properties
* com/other/OtherStuff.properties -> com/other/OtherStuff.properties
* com/yworks/SampleStuff.properties -&gt; A/A/SampleStuff.properties
* com/other/OtherStuff.properties -&gt; A/other/OtherStuff.properties
*/
path, // replaceName = false, replacePath = true, default
/**
* If class obfuscation yields
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
* then resource files will be renamed as follows
* com/yworks/SampleStuff.properties -> com/yworks/A.properties
* com/other/OtherStuff.properties -> com/other/OtherStuff.properties
* com/yworks/SampleStuff.properties -&gt; com/yworks/A.properties
* com/other/OtherStuff.properties -&gt; com/other/OtherStuff.properties
*/
name, // replaceName = true, replacePath = false
/**
* If class obfuscation yields
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
* then resource files will be renamed as follows
* com/yworks/SampleStuff.properties -> A/A/A.properties
* com/other/OtherStuff.properties -> com/other/OtherStuff.properties
* com/yworks/SampleStuff.properties -&gt; A/A/A.properties
* com/other/OtherStuff.properties -&gt; com/other/OtherStuff.properties
*/
file, // replaceName = true, replacePath = true
/**
* If class obfuscation yields
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
* then resource files will be renamed as follows
* com/yworks/SampleStuff.properties -> A/A/A.properties
* com/yworks/OtherStuff.properties -> A/A/OtherStuff.properties
* com/yworks/SampleStuff.properties -&gt; A/A/A.properties
* com/other/OtherStuff.properties -&gt; A/other/OtherStuff.properties
*/
fileorpath,
/**
* If class obfuscation yields
* com.yworks.SampleClass -> A.A.A
* com.yworks.SampleClass -&gt; A.A.A
* then resource files will be renamed as follows
* com/yworks/SampleStuff.properties -> A/A/A.properties
* com/other/OtherStuff.properties -> A/other/OtherStuff.properties
* com/yworks/SampleStuff.properties -&gt; A/A/A.properties
* com/other/OtherStuff.properties -&gt; A/other/OtherStuff.properties
*/
lenient
}
Expand Down

0 comments on commit 66d0c67

Please sign in to comment.