{"action":"created","issue":{"url":"https://api.github.com/repos/Sable/soot/issues/1024","repository_url":"https://api.github.com/repos/Sable/soot","labels_url":"https://api.github.com/repos/Sable/soot/issues/1024/labels{/name}","comments_url":"https://api.github.com/repos/Sable/soot/issues/1024/comments","events_url":"https://api.github.com/repos/Sable/soot/issues/1024/events","html_url":"https://github.com/Sable/soot/issues/1024","id":362351489,"node_id":"MDU6SXNzdWUzNjIzNTE0ODk=","number":1024,"title":"Library package not excluded ?","user":{"login":"Jacoppy","id":22714008,"node_id":"MDQ6VXNlcjIyNzE0MDA4","avatar_url":"https://avatars3.githubusercontent.com/u/22714008?v=4","gravatar_id":"","url":"https://api.github.com/users/Jacoppy","html_url":"https://github.com/Jacoppy","followers_url":"https://api.github.com/users/Jacoppy/followers","following_url":"https://api.github.com/users/Jacoppy/following{/other_user}","gists_url":"https://api.github.com/users/Jacoppy/gists{/gist_id}","starred_url":"https://api.github.com/users/Jacoppy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jacoppy/subscriptions","organizations_url":"https://api.github.com/users/Jacoppy/orgs","repos_url":"https://api.github.com/users/Jacoppy/repos","events_url":"https://api.github.com/users/Jacoppy/events{/privacy}","received_events_url":"https://api.github.com/users/Jacoppy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-09-20T20:25:00Z","updated_at":"2018-09-21T14:38:43Z","closed_at":null,"author_association":"NONE","body":"Hi all,\r\nI'm using soot for instrumenting an Android application. The weird this is that the instrumented apk in the end includes also packages as  java , javax, dalvik etc... \r\nI paste here my configs : \r\n\r\n`\r\nprotected static List<String> excludePackagesList = new ArrayList<String>();\r\n   static\r\n    {\r\n        excludePackagesList.add(\"java.\");\r\n        excludePackagesList.add(\"android.\");\r\n        excludePackagesList.add(\"javax.\");\r\n        excludePackagesList.add(\"android.support.\");\r\n        excludePackagesList.add(\"sun.\");\r\n        excludePackagesList.add(\"com.google.\");\r\n        excludePackagesList.add(\"com.android.\");\r\n        excludePackagesList.add(\"dalvik.\");\r\n    }\r\n`\r\n\r\n\r\n\r\n\r\n        Options.v().set_src_prec(Options.src_prec_apk_c_j);\r\n        \r\n        Options.v().set_process_dir(Collections.singletonList(apkPath));\r\n\r\n        Options.v().set_output_format(Options.output_format_dex);\r\n\r\n        String androidJarPath = Scene.v().getAndroidJarPath(jarsPath, apkPath);\r\n\r\n        List<String> pathList = new ArrayList<String>();\r\n\r\n        pathList.add(apkPath);\r\n\r\n        pathList.add(androidJarPath);\r\n\r\n        for(File i : jimplePath) {\r\n\r\n            pathList.add(i.getAbsolutePath());\r\n\r\n        }\r\n        Options.v().set_process_dir(pathList);\r\n\r\n        Options.v().set_force_android_jar(apkPath);\r\n\r\n        Options.v().set_keep_line_number(true);\r\n\r\n        Options.v().set_process_multiple_dex(true);\r\n\r\n        Options.v().set_allow_phantom_refs(true);\r\n\r\n        Options.v().set_whole_program(true);\r\n\r\n        Options.v().set_wrong_staticness(Options.wrong_staticness_ignore);\r\n\r\n        Options.v().set_exclude(excludePackagesList);\r\n\r\n        Options.v().set_no_bodies_for_excluded(true);\r\n\r\n\r\n        Scene.v().addBasicClass(\"java.lang.Object\", SootClass.SIGNATURES);\r\n\r\n        Scene.v().loadNecessaryClasses();\r\n\r\n        PackManager.v().runPacks();\r\n\r\n\r\n\r\n\r\n\r\n\r\nand for output the apk i just call the ' PackManager.v().writeOutput(); '\r\nThere is something wrong in them?"},"comment":{"url":"https://api.github.com/repos/Sable/soot/issues/comments/423554835","html_url":"https://github.com/Sable/soot/issues/1024#issuecomment-423554835","issue_url":"https://api.github.com/repos/Sable/soot/issues/1024","id":423554835,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzU1NDgzNQ==","user":{"login":"mbenz89","id":7669513,"node_id":"MDQ6VXNlcjc2Njk1MTM=","avatar_url":"https://avatars0.githubusercontent.com/u/7669513?v=4","gravatar_id":"","url":"https://api.github.com/users/mbenz89","html_url":"https://github.com/mbenz89","followers_url":"https://api.github.com/users/mbenz89/followers","following_url":"https://api.github.com/users/mbenz89/following{/other_user}","gists_url":"https://api.github.com/users/mbenz89/gists{/gist_id}","starred_url":"https://api.github.com/users/mbenz89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mbenz89/subscriptions","organizations_url":"https://api.github.com/users/mbenz89/orgs","repos_url":"https://api.github.com/users/mbenz89/repos","events_url":"https://api.github.com/users/mbenz89/events{/privacy}","received_events_url":"https://api.github.com/users/mbenz89/received_events","type":"User","site_admin":false},"created_at":"2018-09-21T14:38:43Z","updated_at":"2018-09-21T14:38:43Z","author_association":"CONTRIBUTOR","body":"While `BufferedInputStream` is indeed part of the Java standard lib, for Android, all required classes are packed into the APK, even standard library classes...\r\n\r\nI think there might be more options, but this should be the easiest for you. For each application class, check if it in your exclusion list and if so, set it to library class.  You can basically just leave your options as they are and check use `soot.Scene#isExcluded` to check if a class matches your exclusion pattern."}}
{"actor":{"display_login":"mbenz89"}}