<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi all,</div><div id="isForwardContent"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="line-height: 1.7;"><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">I tried to use the flowdroid to detect an apk, there is  a class extends AppWidgetProvider in the apk  and I found <span style="color: rgb(255, 0, 0);">no any edge</span> in the class found in call graph. </div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">I made some try but did not work, here is the detailed information that I really expect to get your help: </div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">the subClass is :</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">public class WidgetProvider extends BaseWidgetProvider{</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">       ....</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">       ....</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">       onReceive() ...</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">}</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">the parentClass is :</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">public abstract class BaseWidgetProvider extends AppWidgetProvider{</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">     ...</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">     @overide</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">     public void onUpdate(Context context,AppWidgetManager appWidgetManager,int[] appWidegtIds){</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">                ...</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">                new BulkUpdateAsyncTask(....).execute((Void[]) null);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">     }</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">}</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><b>I want to find the implicit call chain : WidgetProvider::onUpdate()--> BulkUpdateAsyncTask::execute --> BulkUpdateAsyncTask::doInbackground</b>, but I could not find the call chain, so I try to look at the source code of flowDroid , the following is my analysis of the possible reasons:  </div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">           "when FlowDroid constructed the dummyMain ,  The WidgetProvider is only considered to be the normal <span style="font-family: arial; font-size: 13px;">BroadcastReceiver , </span><font face="arial" size="2"> only invoked 'onReceive()' in the dummyMain.  "</font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><font face="arial" size="2"><br></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><font face="arial" size="2">So I try to add the stmt in </font><span style="color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 12px; white-space: pre;">generateBroadcastReceiverLifecycle()</span><span style="font-family: arial; font-size: small;"> at </span><font face="arial" size="2">AndroidEntryPointCreator.java</font><span style="font-family: arial; font-size: small;">:</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><table class="highlight tab-size js-file-line-container" data-tab-size="8" style="box-sizing: border-box; border-spacing: 0px; border-collapse: collapse; tab-size: 8; color: rgb(36, 41, 46); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'; font-size: 14px;"><tbody style="box-sizing: border-box;"><tr style="box-sizing: border-box;"></tr><tr style="box-sizing: border-box;"><td id="LC494" class="blob-code blob-code-inner js-file-line" style="font-family: SFMono-Regular, Consolas, 'Liberation Mono', Menlo, Courier, monospace; line-height: 20px; box-sizing: border-box; padding: 0px 10px; position: relative; vertical-align: top; overflow: visible; font-size: 12px; word-wrap: normal; white-space: pre;"><span class="pl-smi" style="box-sizing: border-box; color: rgb(51, 51, 51);"> Stmt</span> onReceiveStmt <span class="pl-k" style="box-sizing: border-box; color: rgb(167, 29, 93);">=</span> searchAndBuildMethod(<span class="pl-smi" style="box-sizing: border-box; color: rgb(51, 51, 51);">AndroidEntryPointConstants</span><span class="pl-c1" style="box-sizing: border-box; color: rgb(0, 134, 179);"><span class="pl-k" style="">.</span>BROADCAST_ONRECEIVE</span>, currentClass, entryPoints, classLocal);</td></tr></tbody></table></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><span style="font-family: arial; font-size: small;">  +Stmt onUpdateStmt = searchAndBuildMethod(AndroidEntryPointConstants.AppWIDGETPROVIDER_ONUPDATE£¬currentClass, entryPoints) </span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><span style="font-family: arial; font-size: small;">AndroidEntryPointConstants.AppWIDGETPROVIDER_ONUPDATE is "void onUpdate(android.content.Context,android.appwidget.AppWidgetManager,int[])"</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><span style="font-family: arial; font-size: small;"><br></span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><font face="arial" size="2">Unfortunately, </font>The above changes have no other effect ¡£I still did not find  any edge about the update() through the code £ºcalligraph.edgesInto(m)  ¡¢calligraph.edgesOutOf(m)</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">More perplexing £¬I also did not find any edge about the BaseWidgetProvider::onReceive() through calligraph Whether or not I added the above <span style="font-family: arial; font-size: small;">onUpdateStmt.</span></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><font face="arial" size="2">Finally£¬I tried to look the dummymain , and find an important fact:</font></div><div><font face="arial" size="2"><font color="#ff0000"><span style="font-family: Arial; font-size: 14px;">In the previous constructs, there are widgetProvider local value.</span></font><font color="#ff0000" face="Arial"><span style="font-size: 14px;"> but in the last construct dummymain, no the local value.  </span></font></font></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">What is the reason for this?  Could you give me some advice about solving the problem?</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">I am looking forward to your reply! </div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">ps: the option is below:</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">------------------------------------------------------------------------------------------------------------------------------------------------------</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">soot.G.reset();</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().set_keep_line_number(true);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">SetupApplication app = new SetupApplication(androidJar, fileName);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">try{</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">   app.calculateSourcesSinksEntrypoints(.\\SourcesAndSinks.txt);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">}catch(Exception e){</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">  e.printStackTrace();</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">}</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().set_src_prec(Options.src_prec_apk);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().set_process_dir(Collections.singletonList(fileName));</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().set_force_android_jar("D:\\SDK\\Android\\android-sdk\\platforms\\android-24");</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().set_whole_program(true);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().set_allow_phantom_refs(true);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().set_output_format(Options.output_format_none);</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().setPhaseOption("cg.spark verbose:true","on");</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Options.v().setPhaseOption("cg.spark","vta:true");</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">List<String> excludeList = new LinkedList<String>();</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">excludeList.add("java.*");</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><div>excludeList.add("sun.*");</div><div><div>excludeList.add("android.*");</div></div><div><div>excludeList.add("org.apache.*");</div></div><div><div>excludeList.add("soot.*");</div></div><div><div>excludeList.add("javax.servlet.*");</div></div><div>Options.v().set_exclude(excludeList);</div><div>Options.v().set_no_bodies_for_excluded(true);</div><div>app.getConfig().setEnableImplicitFlows(false);</div><div><br></div><div>Scene.v().loadNecessaryClasses();</div><div>SootMethod entryPoint = app.getEntryPointCreator().createDummyMain();</div><div>Options.v().set_main_class(entryPoint.getSignature());</div><div>Scene.v().setEntryPoints(Collections.singletonList(entryPoint));</div><div>PackManager.v().runPacks(</div><div><div>------------------------------------------------------------------------------------------------------------------------------------------------------</div></div></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;"><br></div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">thanks,</div><div style="color: rgb(0, 0, 0); font-family: Arial; font-size: 14px;">Jia</div></div></div></div></div></div></div>