Android Tutorial Code Obfuscation

ondesic

Active Member
Licensed User
Longtime User
That's great!

1) Can the license sub's name be changed to something besides _Allow, _Error and _DontAllow? These subs are among the most important to obfuscate.

2) I just ran into a bug. My license object is named "trl". I have the following code:

trl.SetVariableAndValue("tester","1356")

If I obfuscate, b4a gives me a bug and says there is no field named "_tester". I am assuming b4a is removing _tester. If I don't obfuscate it runs fine.
 
Last edited:

ondesic

Active Member
Licensed User
Longtime User
In the Map file it shows variables renamed to things like "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv5" and "vvvvvvvvvvvvvvvvvvvvvv7"

If there is a crash it is going to take forever counting v's. Isn't there a shorter way to change names so we can more easily find the appropriate variable?
 

nad

Active Member
Licensed User
Longtime User
"...
- LicenseChecker.SetVariableAndValue
This method references a variable using a string. This method will fail if the variable name doesn't include an underscore.
..."

I am compiling one time, checking after the obfuscation txt file to see the equivalence name i.e vvvvvv4 and then writing it directly

licensechecker.setvariableandvalue("vvvvvv4" ...

after that all the next compiles it works great.
I think it adds a higher level of security as is ofuscated aswell.

Hope is not a mistake?
 

moster67

Expert
Licensed User
Longtime User

Erel,

Just wondering if above issue has been fixed in the current beta (1.90) although it shouldn't really be a problem?
 

mcmanu

Active Member
Licensed User
Longtime User
Hi Erel

It seems to me that this issue is not fixed :-(
I get an error when i use release obfuscated
because i use a code modul which contains this -->

Sub Ltrim(Text As String) As String
Do While Left(Text, 1) =" " <-- thats the problem
Text = Right(Text, Len(Text)-1)
Loop
Return Text
End Sub
Sub Rtrim(Text As String) As String
Do While Right(Text, 1) =" "
Text = Left(Text, Len(Text)-1)
Loop
Return Text
End Sub

its the code module from String Functions
for example s.proper

Will this be fixed?
 

mcmanu

Active Member
Licensed User
Longtime User
Hi Erel

Thank you so what could i do to Release my app Obfuscate?
I need the code module which i was talking about
 

mcmanu

Active Member
Licensed User
Longtime User
This is my error in the log

Compiling code. 2.12

ObfuscatorMap.txt file created in Objects folder.
Compiling layouts code. 0.06
Generating R file. 0.02
Compiling generated Java code. Error
B4A line: 33
Do While Left(Text, 1) =\
javac 1.6.0_26
src\testapp\mcmanu\android\s.java:161: cannot find symbol
symbol : variable _ba
location: class testapp.mcmanu.android.s
while ((_vvvvvvv3(_ba,_text,(long)(1))).equals(" ")) {
^
1 error
 

mc73

Well-Known Member
Licensed User
Longtime User

In the 's' module, except from 'sub proccess_globals' do you have 'sub globals' too? If yes, try to remove it, and please inform if this helped.
 

mcmanu

Active Member
Licensed User
Longtime User
Nice

You solved one of my biggest Problem
Thank you very very much Thats Awesome

Removing sub globals solved it
 
Last edited:

peacemaker

Expert
Licensed User
Longtime User
Strange problem.
B4A 2.01 (beta).
Old project with HttpUtils v.1.04.

Variables:
B4X:
   Dim CallbackActivity As String 'Name of Activity that handles the callbacks.
   Dim CallbackJobDoneSub As String 'Name of the JobDone callback sub.
   Dim CallbackUrlDoneSub As String 'Name of the UrlDone callback sub.
   Dim CallbackIgnoredSub As String   'Name of the callback sub, if service is already running and new job was ignored.

CallbackIgnoredSub is used

B4X:
Sub internalCheckIfCanStart(JobName As String) As Boolean
   If Working Then
      Log("Already working. Request ignored (" & JobName & ")")
      'Raise URL done event
      If CallbackIgnoredSub <> "" Then
         CallSub2(CallbackActivity, CallbackIgnoredSub, JobName)
      End If
      Return False
   End If
...

Sub name is: HttpUtils.CallbackIgnoredSub = "ReSyncSet".

Compilation with obfuscation is OK, but during running (real devices) there is error:

** Service (inet) Start **

Sub name was changed - no use. And debug or non-obfuscated release - no such error.
What's wrong ?
 

mcmanu

Active Member
Licensed User
Longtime User
same problem

I have the same Problem, my functions with httputils dont work anymore with release obfuscate. is it fixed in b4a 2.0?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…