@@ -212,16 +212,24 @@ private void runLuaFile(final LuaView luaView, final String luaName, final Objec
212212 if (TextUtils .isEmpty (luaName )) {
213213 return ;
214214 }
215+ String miniAppId = "" ;
216+ if (valueData instanceof HashMap ) {
217+ if (((HashMap ) valueData ).containsKey ("miniAppId" )) {
218+ miniAppId = ((HashMap ) valueData ).get ("miniAppId" ).toString ();
219+ } else if (((HashMap ) valueData ).containsKey ("appletId" )) {
220+ miniAppId = ((HashMap ) valueData ).get ("appletId" ).toString ();
221+ }
222+ }
215223 if (sScriptBundle == null ) {
216224 sScriptBundle = initScriptBundle (VenvyFileUtil .getCachePath (VideoOSLuaView .this .getContext ()) + PreloadLuaUpdate .LUA_CACHE_PATH );
217225 if (sScriptBundle != null ) {
218- luaView .loadScriptBundle (sScriptBundle , luaName ,
226+ luaView .loadScriptBundle (sScriptBundle , TextUtils . isEmpty ( miniAppId ) ? luaName : miniAppId + File . separator + luaName ,
219227 new LuaCallbackImpl (valueData ));
220228 } else {
221229 runLua (luaView , luaName , valueData );
222230 }
223231 } else {
224- luaView .loadScriptBundle (sScriptBundle , luaName , new LuaCallbackImpl (valueData ));
232+ luaView .loadScriptBundle (sScriptBundle , TextUtils . isEmpty ( miniAppId ) ? luaName : miniAppId + File . separator + luaName , new LuaCallbackImpl (valueData ));
225233 }
226234 }
227235
@@ -293,8 +301,9 @@ private ScriptBundle initScriptBundle(String luaPath) {
293301 for (File childFile : file .listFiles ()) {
294302 if (TextUtils .equals ("lua" , VenvyFileUtil .getExtension (childFile .getName ()))) {
295303 byte [] data = getBytes (childFile .getPath ());
304+ String fileAbsolutePath = file .getAbsolutePath ();
296305 ScriptFile scriptFile = new ScriptFile (null ,
297- file . getAbsolutePath (), childFile .getName (), data );
306+ fileAbsolutePath , fileAbsolutePath . substring ( fileAbsolutePath . lastIndexOf ( "/" ) + 1 , fileAbsolutePath . length ()) + File . separator + childFile .getName (), data );
298307 scriptBundle .addScript (scriptFile );
299308 }
300309 }
0 commit comments