@@ -123,6 +123,10 @@ public String getSplit(){
123123 }
124124 return getAndroidManifestBlock ().getSplit ();
125125 }
126+ public FrameworkApk initializeAndroidFramework (Integer version ) throws IOException {
127+ TableBlock tableBlock = getTableBlock (false );
128+ return initializeAndroidFramework (tableBlock , version );
129+ }
126130 public FrameworkApk initializeAndroidFramework (TableBlock tableBlock , Integer version ) throws IOException {
127131 if (tableBlock == null || isAndroid (tableBlock )){
128132 return null ;
@@ -131,10 +135,13 @@ public FrameworkApk initializeAndroidFramework(TableBlock tableBlock, Integer ve
131135 for (TableBlock frameWork :frameWorkList ){
132136 if (isAndroid (frameWork )){
133137 ApkFile apkFile = frameWork .getApkFile ();
134- if (apkFile instanceof FrameworkApk ){
135- return (FrameworkApk ) apkFile ;
138+ if (!(apkFile instanceof FrameworkApk )){
139+ continue ;
140+ }
141+ FrameworkApk frameworkApk = (FrameworkApk ) apkFile ;
142+ if (frameworkApk .getVersionCode () == version ){
143+ return frameworkApk ;
136144 }
137- return null ;
138145 }
139146 }
140147 logMessage ("Initializing android framework ..." );
@@ -148,7 +155,8 @@ public FrameworkApk initializeAndroidFramework(TableBlock tableBlock, Integer ve
148155 }
149156 FrameworkTable frameworkTable = frameworkApk .getTableBlock ();
150157 tableBlock .addFramework (frameworkTable );
151- logMessage ("Initialized framework: " +frameworkApk .getName ());
158+ logMessage ("Initialized framework: " + frameworkApk .getName ()
159+ + " (" + frameworkApk .getVersionName () + ")" );
152160 return frameworkApk ;
153161 }
154162 private boolean isAndroid (TableBlock tableBlock ){
0 commit comments