commit da57afae2f97da4dec3f32ae50811c828e676041
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Tue Apr 4 23:51:27 2023 +0200

    Move opening local files to the OSInterface

diff --git a/src/main/java/org/distorted/main/RubikActivity.java b/src/main/java/org/distorted/main/RubikActivity.java
index f4f74ce6..5c23d48e 100644
--- a/src/main/java/org/distorted/main/RubikActivity.java
+++ b/src/main/java/org/distorted/main/RubikActivity.java
@@ -40,6 +40,7 @@ import org.distorted.library.main.DistortedLibrary;
 
 import org.distorted.library.main.DistortedScreen;
 import org.distorted.messaging.RubikInAppMessanging;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.InitAssets;
 import org.distorted.objectlib.main.ObjectControl;
 import org.distorted.objectlib.main.TwistyObject;
@@ -51,6 +52,7 @@ import org.distorted.external.RubikScores;
 import org.distorted.external.RubikNetwork;
 import org.distorted.objects.RubikObject;
 import org.distorted.objects.RubikObjectList;
+import org.distorted.os.OSInterface;
 import org.distorted.purchase.PurchaseActivity;
 import org.distorted.screens.RubikScreenSolving;
 import org.distorted.screens.ScreenList;
@@ -613,7 +615,9 @@ public class RubikActivity extends AppCompatActivity
       InputStream jsonStream = object==null ? null : object.getObjectStream(this);
       InputStream meshStream = object==null ? null : object.getMeshStream(this);
       String name = object==null ? "NULL" : object.getUpperName();
-      InitAssets asset = new InitAssets(jsonStream,meshStream,getResources());
+      RubikSurfaceView view = findViewById(R.id.rubikSurfaceView);
+      OSInterface os = view.getInterface();
+      InitAssets asset = new InitAssets(jsonStream,meshStream,os);
 
       control.changeIfDifferent(ordinal,name,meshState,iconMode,asset);
       }
@@ -736,8 +740,10 @@ public class RubikActivity extends AppCompatActivity
           int iconMode  = TwistyObject.MODE_NORM;
           InputStream jsonStream = object.getObjectStream(this);
           InputStream meshStream = object.getMeshStream(this);
-          InitAssets asset       = new InitAssets(jsonStream,meshStream,getResources());
-          ObjectControl control = getControl();
+          RubikSurfaceView view  = findViewById(R.id.rubikSurfaceView);
+          OSInterface os         = view.getInterface();
+          InitAssets asset       = new InitAssets(jsonStream,meshStream,os);
+          ObjectControl control  = getControl();
           control.changeObject(-1,meshState,iconMode,asset);
           }
         }
@@ -757,4 +763,11 @@ public class RubikActivity extends AppCompatActivity
       return mSolverIndex;
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+   public OperatingSystemInterface getInterface()
+     {
+     RubikSurfaceView view  = findViewById(R.id.rubikSurfaceView);
+     return view.getInterface();
+     }
 }
diff --git a/src/main/java/org/distorted/main/RubikSurfaceView.java b/src/main/java/org/distorted/main/RubikSurfaceView.java
index 9279b40b..eb22b58b 100644
--- a/src/main/java/org/distorted/main/RubikSurfaceView.java
+++ b/src/main/java/org/distorted/main/RubikSurfaceView.java
@@ -91,6 +91,13 @@ public class RubikSurfaceView extends GLSurfaceView
       return mRenderer;
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    OSInterface getInterface()
+      {
+      return mInterface;
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
     ObjectControl getObjectControl()
diff --git a/src/main/java/org/distorted/screens/RubikScreenSolver.java b/src/main/java/org/distorted/screens/RubikScreenSolver.java
index 8e74c430..9220ee90 100644
--- a/src/main/java/org/distorted/screens/RubikScreenSolver.java
+++ b/src/main/java/org/distorted/screens/RubikScreenSolver.java
@@ -318,7 +318,7 @@ public class RubikScreenSolver extends RubikScreenAbstract
           {
           mSolving = true;
           TwistyObject object = act.getObject();
-          SolverMain solver = new SolverMain( act.getResources(), object );
+          SolverMain solver = new SolverMain( act.getInterface(), act.getResources(), object );
           solver.start();
           }
         }
diff --git a/src/main/java/org/distorted/solvers/SolverCube2.java b/src/main/java/org/distorted/solvers/SolverCube2.java
index 059158ef..4b7840d0 100644
--- a/src/main/java/org/distorted/solvers/SolverCube2.java
+++ b/src/main/java/org/distorted/solvers/SolverCube2.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -140,9 +141,9 @@ public class SolverCube2 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverCube2(Resources res, TwistyObject object)
+  public SolverCube2(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     mFaceColors = new int[6];
     }
 
@@ -283,11 +284,11 @@ public class SolverCube2 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res,ObjectSignatures.CUBE_2);
+      mSolver = ImplementedTablebasesList.createPacked(os,ObjectSignatures.CUBE_2);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverCuboid232.java b/src/main/java/org/distorted/solvers/SolverCuboid232.java
index c5aa766c..dbb3b7e8 100644
--- a/src/main/java/org/distorted/solvers/SolverCuboid232.java
+++ b/src/main/java/org/distorted/solvers/SolverCuboid232.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -222,9 +223,9 @@ public class SolverCuboid232 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverCuboid232(Resources res, TwistyObject object)
+  public SolverCuboid232(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     mFaceColors = new int[6];
     }
 
@@ -404,11 +405,11 @@ public class SolverCuboid232 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.CU_232);
+      mSolver = ImplementedTablebasesList.createPacked(os, ObjectSignatures.CU_232);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverDino4.java b/src/main/java/org/distorted/solvers/SolverDino4.java
index 52eb5fbe..4d1a21e3 100644
--- a/src/main/java/org/distorted/solvers/SolverDino4.java
+++ b/src/main/java/org/distorted/solvers/SolverDino4.java
@@ -14,6 +14,7 @@ import static org.distorted.objectlib.main.TwistyObject.*;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.shape.ShapeHexahedron;
@@ -31,9 +32,9 @@ public class SolverDino4 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverDino4(Resources res, TwistyObject object)
+  public SolverDino4(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os, res,object);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -172,11 +173,11 @@ public class SolverDino4 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res,ObjectSignatures.DIN4_3);
+      mSolver = ImplementedTablebasesList.createPacked(os,ObjectSignatures.DIN4_3);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverDino6.java b/src/main/java/org/distorted/solvers/SolverDino6.java
index 71236352..80a9c7c8 100644
--- a/src/main/java/org/distorted/solvers/SolverDino6.java
+++ b/src/main/java/org/distorted/solvers/SolverDino6.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -42,9 +43,9 @@ public class SolverDino6 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverDino6(Resources res, TwistyObject object)
+  public SolverDino6(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     mFaceColors = new int[6];
     }
 
@@ -437,11 +438,11 @@ public class SolverDino6 extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res,ObjectSignatures.DINO_3);
+      mSolver = ImplementedTablebasesList.createPacked(os,ObjectSignatures.DINO_3);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverIvyCube.java b/src/main/java/org/distorted/solvers/SolverIvyCube.java
index 961c399d..53d35d64 100644
--- a/src/main/java/org/distorted/solvers/SolverIvyCube.java
+++ b/src/main/java/org/distorted/solvers/SolverIvyCube.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -172,9 +173,9 @@ public class SolverIvyCube extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverIvyCube(Resources res, TwistyObject object)
+  public SolverIvyCube(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -240,11 +241,11 @@ public class SolverIvyCube extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.IVY_2);
+      mSolver = ImplementedTablebasesList.createPacked(os, ObjectSignatures.IVY_2);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverJing.java b/src/main/java/org/distorted/solvers/SolverJing.java
index 2a4f4b2f..4f15b710 100644
--- a/src/main/java/org/distorted/solvers/SolverJing.java
+++ b/src/main/java/org/distorted/solvers/SolverJing.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -51,9 +52,9 @@ public class SolverJing extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverJing(Resources res, TwistyObject object)
+  public SolverJing(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -522,11 +523,11 @@ public class SolverJing extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res,ObjectSignatures.JING_2);
+      mSolver = ImplementedTablebasesList.createPacked(os,ObjectSignatures.JING_2);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverMain.java b/src/main/java/org/distorted/solvers/SolverMain.java
index 92dba019..b6128c3a 100644
--- a/src/main/java/org/distorted/solvers/SolverMain.java
+++ b/src/main/java/org/distorted/solvers/SolverMain.java
@@ -11,6 +11,7 @@ package org.distorted.solvers;
 
 import android.content.res.Resources;
 
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 
@@ -23,14 +24,16 @@ import org.distorted.screens.RubikScreenSolver;
 public class SolverMain implements Runnable
 {
   private final Resources mRes;
+  private final OperatingSystemInterface mOS;
   private final long mSignature;
   private final TwistyObject mObject;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverMain(Resources res, TwistyObject object)
+  public SolverMain(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
     mRes       = res;
+    mOS        = os;
     mObject    = object;
     long[] sig = object.getSignature().getArray();
     mSignature = sig[sig.length-1];
@@ -78,57 +81,57 @@ public class SolverMain implements Runnable
       }
     else if( mSignature==ObjectSignatures.PDUO_2 )
       {
-      SolverTablebase solver = new SolverPyraminxDuo(mRes,mObject);
+      SolverTablebase solver = new SolverPyraminxDuo(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.IVY_2 )
       {
-      SolverTablebase solver = new SolverIvyCube(mRes,mObject);
+      SolverTablebase solver = new SolverIvyCube(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.CU_232 )
       {
-      SolverTablebase solver = new SolverCuboid232(mRes,mObject);
+      SolverTablebase solver = new SolverCuboid232(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.PYRA_3 )
       {
-      SolverTablebase solver = new SolverPyraminx(mRes,mObject);
+      SolverTablebase solver = new SolverPyraminx(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.DIAM_2 )
       {
-      SolverTablebase solver = new SolverSkewbDiamond(mRes,mObject);
+      SolverTablebase solver = new SolverSkewbDiamond(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.CUBE_2 )
       {
-      SolverTablebase solver = new SolverCube2(mRes,mObject);
+      SolverTablebase solver = new SolverCube2(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.JING_2 )
       {
-      SolverTablebase solver = new SolverJing(mRes,mObject);
+      SolverTablebase solver = new SolverJing(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.SKEW_2 )
       {
-      SolverTablebase solver = new SolverSkewb(mRes,mObject);
+      SolverTablebase solver = new SolverSkewb(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.DINO_3 )
       {
-      SolverTablebase solver = new SolverDino6(mRes,mObject);
+      SolverTablebase solver = new SolverDino6(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.DIN4_3 )
       {
-      SolverTablebase solver = new SolverDino4(mRes,mObject);
+      SolverTablebase solver = new SolverDino4(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else if( mSignature==ObjectSignatures.PDIA_3 )
       {
-      SolverTablebase solver = new SolverPyraminxDiamond(mRes,mObject);
+      SolverTablebase solver = new SolverPyraminxDiamond(mOS,mRes,mObject);
       solver.solve(screen);
       }
     else
diff --git a/src/main/java/org/distorted/solvers/SolverPyraminx.java b/src/main/java/org/distorted/solvers/SolverPyraminx.java
index 20f83305..3ed97aff 100644
--- a/src/main/java/org/distorted/solvers/SolverPyraminx.java
+++ b/src/main/java/org/distorted/solvers/SolverPyraminx.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -245,9 +246,9 @@ public class SolverPyraminx extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverPyraminx(Resources res, TwistyObject object)
+  public SolverPyraminx(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -535,11 +536,11 @@ public class SolverPyraminx extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.PYRA_3);
+      mSolver = ImplementedTablebasesList.createPacked(os, ObjectSignatures.PYRA_3);
       }
 
     return mSolver!=null ? mSolver.solution(index,mCornerTwist) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverPyraminxDiamond.java b/src/main/java/org/distorted/solvers/SolverPyraminxDiamond.java
index 9f3e9264..bfd6c380 100644
--- a/src/main/java/org/distorted/solvers/SolverPyraminxDiamond.java
+++ b/src/main/java/org/distorted/solvers/SolverPyraminxDiamond.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -46,9 +47,9 @@ public class SolverPyraminxDiamond extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverPyraminxDiamond(Resources res, TwistyObject object)
+  public SolverPyraminxDiamond(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     mFaceColors = new int[8];
     }
 
@@ -361,11 +362,11 @@ android.util.Log.e("D", "ret="+(total_twist + 2048*centers_perm_num) );
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res,ObjectSignatures.PDIA_3);
+      mSolver = ImplementedTablebasesList.createPacked(os,ObjectSignatures.PDIA_3);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java b/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
index c2b8d2e4..8c394309 100644
--- a/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
+++ b/src/main/java/org/distorted/solvers/SolverPyraminxDuo.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -195,9 +196,9 @@ public class SolverPyraminxDuo extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverPyraminxDuo(Resources res, TwistyObject object)
+  public SolverPyraminxDuo(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -285,11 +286,11 @@ public class SolverPyraminxDuo extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.PDUO_2);
+      mSolver = ImplementedTablebasesList.createPacked(os, ObjectSignatures.PDUO_2);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverSkewb.java b/src/main/java/org/distorted/solvers/SolverSkewb.java
index 18fe27f0..779253ca 100644
--- a/src/main/java/org/distorted/solvers/SolverSkewb.java
+++ b/src/main/java/org/distorted/solvers/SolverSkewb.java
@@ -14,6 +14,7 @@ import static org.distorted.objectlib.tablebases.TBSkewb.FREE;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -51,9 +52,9 @@ public class SolverSkewb extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverSkewb(Resources res, TwistyObject object)
+  public SolverSkewb(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     mFaceColors = new int[6];
     }
 
@@ -384,11 +385,11 @@ public class SolverSkewb extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res,ObjectSignatures.SKEW_2);
+      mSolver = ImplementedTablebasesList.createPacked(os,ObjectSignatures.SKEW_2);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverSkewbDiamond.java b/src/main/java/org/distorted/solvers/SolverSkewbDiamond.java
index ad4b0bb0..33fd9aeb 100644
--- a/src/main/java/org/distorted/solvers/SolverSkewbDiamond.java
+++ b/src/main/java/org/distorted/solvers/SolverSkewbDiamond.java
@@ -12,6 +12,7 @@ package org.distorted.solvers;
 import android.content.res.Resources;
 
 import org.distorted.main.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.objectlib.tablebases.ImplementedTablebasesList;
@@ -50,9 +51,9 @@ public class SolverSkewbDiamond extends SolverTablebase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverSkewbDiamond(Resources res, TwistyObject object)
+  public SolverSkewbDiamond(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
-    super(res,object);
+    super(os,res,object);
     mFaceColors = new int[8];
     }
 
@@ -486,11 +487,11 @@ android.util.Log.e("D", "corn twist: "+corners_twist[0]+" "+corners_twist[1]+" "
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public int[][] solution(int index, Resources res)
+  public int[][] solution(int index, OperatingSystemInterface os)
     {
     if( mSolver==null )
       {
-      mSolver = ImplementedTablebasesList.createPacked(res, ObjectSignatures.DIAM_2);
+      mSolver = ImplementedTablebasesList.createPacked(os, ObjectSignatures.DIAM_2);
       }
 
     return mSolver!=null ? mSolver.solution(index,null) : null;
diff --git a/src/main/java/org/distorted/solvers/SolverTablebase.java b/src/main/java/org/distorted/solvers/SolverTablebase.java
index 43963739..aa54aa3c 100644
--- a/src/main/java/org/distorted/solvers/SolverTablebase.java
+++ b/src/main/java/org/distorted/solvers/SolverTablebase.java
@@ -11,6 +11,7 @@ package org.distorted.solvers;
 
 import android.content.res.Resources;
 
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.TwistyObject;
 import org.distorted.screens.RubikScreenSolver;
 
@@ -18,6 +19,7 @@ import org.distorted.screens.RubikScreenSolver;
 
 public abstract class SolverTablebase
 {
+  private final OperatingSystemInterface mOS;
   private final Resources mRes;
   private final TwistyObject mObject;
 
@@ -25,14 +27,15 @@ public abstract class SolverTablebase
 
   public abstract int tablebaseIndex(TwistyObject object);
   public abstract String error(int index, Resources res);
-  public abstract int[][] solution(int index, Resources res);
+  public abstract int[][] solution(int index, OperatingSystemInterface os);
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public SolverTablebase(Resources res, TwistyObject object)
+  public SolverTablebase(OperatingSystemInterface os, Resources res, TwistyObject object)
     {
+    mOS    = os;
     mRes   = res;
     mObject= object;
     }
@@ -45,7 +48,7 @@ public abstract class SolverTablebase
 
     if( index>=0 )
       {
-      int[][] moves = solution(index,mRes);
+      int[][] moves = solution(index,mOS);
       screen.setSolved(moves);
       }
     else
diff --git a/src/main/java/org/distorted/tutorials/TutorialActivity.java b/src/main/java/org/distorted/tutorials/TutorialActivity.java
index 0cd0d350..186bba4f 100644
--- a/src/main/java/org/distorted/tutorials/TutorialActivity.java
+++ b/src/main/java/org/distorted/tutorials/TutorialActivity.java
@@ -33,6 +33,7 @@ import org.distorted.main.R;
 import org.distorted.dialogs.RubikDialogError;
 import org.distorted.objects.RubikObject;
 import org.distorted.objects.RubikObjectList;
+import org.distorted.os.OSInterface;
 import org.distorted.purchase.PurchaseActivity;
 
 import static org.distorted.objectlib.main.TwistyObject.MESH_NICE;
@@ -226,7 +227,9 @@ public class TutorialActivity extends AppCompatActivity
       InputStream jsonStream = object==null ? null : object.getObjectStream(this);
       InputStream meshStream = object==null ? null : object.getMeshStream(this);
       String name = object==null ? "NULL" : object.getUpperName();
-      InitAssets asset = new InitAssets(jsonStream,meshStream,getResources());
+      TutorialSurfaceView view = findViewById(R.id.tutorialSurfaceView);
+      OSInterface os = view.getInterface();
+      InitAssets asset = new InitAssets(jsonStream,meshStream,os);
       control.changeIfDifferent(ordinal,name,meshState,iconMode,asset);
       }
 
diff --git a/src/main/java/org/distorted/tutorials/TutorialSurfaceView.java b/src/main/java/org/distorted/tutorials/TutorialSurfaceView.java
index 8fc903b4..5cbad65c 100644
--- a/src/main/java/org/distorted/tutorials/TutorialSurfaceView.java
+++ b/src/main/java/org/distorted/tutorials/TutorialSurfaceView.java
@@ -18,6 +18,7 @@ import android.view.MotionEvent;
 
 import com.google.firebase.crashlytics.FirebaseCrashlytics;
 
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectControl;
 import org.distorted.objectlib.main.TwistyObjectNode;
 import org.distorted.os.OSInterface;
@@ -72,6 +73,13 @@ public class TutorialSurfaceView extends GLSurfaceView
       return mObjectController;
       }
 
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+    OSInterface getInterface()
+      {
+      return mInterface;
+      }
+
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 // PUBLIC API
 ///////////////////////////////////////////////////////////////////////////////////////////////////
