0

I am doing a reverse-engineering work related to Android fragments. I found out in many apks (decompiled with apktool, dexToJar, ...), the androidx.fragment.app.Fragment class is obfuscated. In most of the cases the class members are obfuscated, while in some minor cases, the class name is even obfuscated. I am wondering in these cases, how can the Android OS identify AndroidX fragments in an app at runtime?

Richard Hu
  • 811
  • 5
  • 18
  • I don't think Android requires to know which class a Fragment [implementation] is. It just loads the class the the Fragment manager (which is also included in the app and thus knows which classes to use) does the rest. – Robert May 24 '22 at 09:12
  • @Robert I see your points, but what if the `FragmentManager` class is also obfuscated (which is also very common)? – Richard Hu May 24 '22 at 09:15
  • As long as it is inside the app all class references are still the same even if they have obfuscated names. So the FragmentManager knows which class is now the `androidx.fragment.app.Fragment` class no matter what name it has and in which package it is located. – Robert May 24 '22 at 09:25
  • @Robert thanks for your answer. I see your points but I am now again wondering how Android accesses the obfuscated `FragmentManager`...Anyway, I guess there are some mechanisms. Your answer already solves the question, thanks. – Richard Hu May 24 '22 at 09:31

0 Answers0