0

i happened to encounter some wired compiled bytecode which i believe both sharing the same source code like below

class SomeWebView extends WebView {
   SomeWebView() {
      this.getSettings();      
   }
}

version 1 (above code write in app a) emits code like:

invoke-virtual **WebView**->getSettings() WebSettings, p0

version 2 (with same code copied to app b) emits code like:

invoke-virtual **SomeWebView**->getSettings() WebSettings, p0

although this changes nothing in correctness(?), but i want to know which step introduced this change and its official optimization name (like devirtualization? but i'm sure it's not)

notice SomeWebView DOES NOT override getSettings

Minami
  • 963
  • 6
  • 21
  • Most likely, compileSdk was changed, or the version of the library from dependencies, from which WebView is imported. – Aleksey Voko Jul 05 '22 at 11:09
  • Can you give more context here? If this an R8 compilation there are optimizations to reduce the number of method refs to make the code smaller. – sgjesse Aug 04 '22 at 07:00

0 Answers0