alibaba / dexposed

dexposed enable 'god' mode for single android application.
4.51k stars 1.07k forks source link

method循环调用 #70

Open w5678912345 opened 8 years ago

w5678912345 commented 8 years ago

hi,你好,我在使用dexposed在art中的时候出现了循环调用的现象。 在hook完之后 正常的调用逻辑应该是:before -> original -> after 但是当我调用如下函数的时候,又会hook住。 com_taobao_android_dexposed_DexposedBridge_invokeOriginalMethodNative

最终变成了这样: before -> original -> before -> original .... .... 请问这个是目前已知的问题么?

kplong commented 8 years ago

最终怎么解决的,我这边也出现这个问题了

w5678912345 commented 8 years ago
  // Create a backup of the ArtMethod object
  ArtMethod* backup_method = down_cast<ArtMethod*>(art_method->Clone(soa.Self()));
  // Set private flag to avoid virtual table lookups during invocation
  **backup_method->SetAccessFlags(backup_method->GetAccessFlags() /*| kAccXposedOriginalMethod*/);**

参照xposed对backup_mothod的修改 backup_method->SetAccessFlags(backup_method->GetAccessFlags() | kAccPrivate /* | kAccXposedOriginalMethod */);

hwjump commented 7 years ago

I change the hook core for art, you can refer the dev_art branch.