@@ -23,7 +23,7 @@ public void OnClickSetVersion()
2323
2424 if ( updateVersion <= 0 )
2525 {
26- string error = Bootstrap . use_data_dir ( "" ) ;
26+ string error = Bootstrap . use_data_dir ( "" , "" ) ;
2727 if ( ! string . IsNullOrEmpty ( error ) )
2828 {
2929 messageBox . Show ( "use failed. empty path error:" + error , "ok" , ( ) => { messageBox . Close ( ) ; } ) ;
@@ -68,7 +68,16 @@ private IEnumerator PreparePatchAndRestart()
6868 ZipHelper . UnZip ( zipLibil2cppPath , runtimePatchPath , "" , true ) ;
6969
7070 //4. tell libboostrap.so to use the right patch after reboot
71- string error = Bootstrap . use_data_dir ( runtimePatchPath ) ;
71+ //jar:file:///data/app/x.x.x/base.apk!/assets/
72+ int apkPathStart = Application . streamingAssetsPath . IndexOf ( "/data" ) ;
73+ int apkPathEnd = Application . streamingAssetsPath . IndexOf ( "!" ) ;
74+ string apkPath = Application . streamingAssetsPath . Substring ( apkPathStart , apkPathEnd - apkPathStart ) ;
75+ if ( string . IsNullOrEmpty ( apkPath ) )
76+ {
77+ messageBox . Show ( "use failed. apk path not found in [" + Application . streamingAssetsPath + "]" , "ok" , ( ) => { messageBox . Close ( ) ; } ) ;
78+ yield break ;
79+ }
80+ string error = Bootstrap . use_data_dir ( runtimePatchPath , apkPath ) ;
7281 if ( ! string . IsNullOrEmpty ( error ) )
7382 {
7483 messageBox . Show ( "use failed. path:" + zipLibil2cppPath + ", error:" + error , "ok" , ( ) => { messageBox . Close ( ) ; } ) ;
0 commit comments