instruction for Android developers on how to unobfuscate an APK file

Mobile Testing, Android App Testing.
Bassem.Ibrahim
Posts: 20
Joined: Tue Nov 06, 2018 9:14 pm

instruction for Android developers on how to unobfuscate an APK file

Post by Bassem.Ibrahim » Tue Oct 19, 2021 12:38 am

We have a new developer that is not able to properly unobfuscate the APK files. Are there written down instructions I can give him to help with that process? He is using Android Studio. Thanks in advance.

The issue is when I instrument the new APK file, the ResourceID's/RID's are not visible. From past experience, that is a symptom of an obfuscated APK. He is saying that he is unobfuscating the APK, but I guess he may be doing something incorrectly.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: instruction for Android developers on how to unobfuscate an APK file

Post by odklizec » Tue Oct 19, 2021 7:11 am

Hi,

Basically, it should be enough to set this "minifyEnabled false" in build.gradle file. Just ask the developer to examine the state of this flag. Eventually, check this post with steps, how to tell the apk is obfuscated or not:
https://stackoverflow.com/questions/277 ... has-worked
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Bassem.Ibrahim
Posts: 20
Joined: Tue Nov 06, 2018 9:14 pm

Re: instruction for Android developers on how to unobfuscate an APK file

Post by Bassem.Ibrahim » Tue Oct 19, 2021 9:06 pm

Thank you for the response. I have verified that settings in the build.gradle file and they appear to be correct for the unobfuscated build ( see attachment) I guess next step is to open a support ticket.
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: instruction for Android developers on how to unobfuscate an APK file

Post by odklizec » Thu Oct 21, 2021 7:47 am

Hi,

Aside of the minifyEnabled state, have you actually checked if the APK is obfuscated?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Bassem.Ibrahim
Posts: 20
Joined: Tue Nov 06, 2018 9:14 pm

Re: instruction for Android developers on how to unobfuscate an APK file

Post by Bassem.Ibrahim » Fri Oct 22, 2021 10:12 pm

There was nothing else to do to un-obfuscate the APK.
The issue was that the new developer added build flavors (production and staging). Ranorex was looking for the ID's using the <staging>.R package name which was not correct. When I instrumented the app with the <production>.R in the Custom R.ID field, I was able to see the ID's.
Note: we are using the staging build for testing, but the instrumentation needed the production package name set instead.