Android Question [Solved] String Obfuscation Question

hatzisn

Expert
Licensed User
Longtime User
Hello everyone,

I have a question about string obfuscation. In this thread:
https://www.b4x.com/android/forum/threads/obfuscation.37699/#content

Erel has made the following posts:

Post#1
Yes. Any string that appears in Process_Globals sub will be obfuscated.
B4X:
Sub Process_Globals
 Dim Keys() As String = Array As String("These", "strings", "will", "be", "obfuscated")
 Dim k As String = "This will also be obfuscated"
 Dim b() As Byte = "this too".GetBytes("UTF8")

Post#2
The string in the main activity will not be included in the compiled library. You cannot obfuscate strings in libraries. You will need to put the string in one of the project modules.

I suppose that if I have 3 activities every string that I put in Process_Globals in each and every activity will be obfuscated... Am I correct? Is this valid also for the Starter service?

Cheers
 
Last edited:

hatzisn

Expert
Licensed User
Longtime User
Never mind. Since I can't delete this thread I have just to say that I figured that out by myself. I placed a different string in each and every activity in Process_Globals as well as in the Starter service. I compiled the app with obfuscation and checked the classes.dex with a Hex Editor. None of the strings that were to be obfuscated were found in the search. On the contrary strings in subs of the activities or the starter service were located by the Hex Editor.

Cheers
 
Upvote 0
Top