commit 3103c3c82188e3782162329c4e08fcb29629247e
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/objectlib/helpers/OperatingSystemInterface.java b/src/main/java/org/distorted/objectlib/helpers/OperatingSystemInterface.java
index 4bcc6483..9e0bbe18 100644
--- a/src/main/java/org/distorted/objectlib/helpers/OperatingSystemInterface.java
+++ b/src/main/java/org/distorted/objectlib/helpers/OperatingSystemInterface.java
@@ -11,8 +11,18 @@ package org.distorted.objectlib.helpers;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
+import java.io.InputStream;
+
 public interface OperatingSystemInterface
   {
+  ///////////////////////////////////////////
+  // SCREEN
+  ///////////////////////////////////////////
+  int getScreenDensity();
+
+  ///////////////////////////////////////////
+  // TOUCH CONTROL
+  ///////////////////////////////////////////
   int ACTION_DOWN_1 = 0;
   int ACTION_UP_1   = 1;
   int ACTION_DOWN_2 = 3;
@@ -21,8 +31,6 @@ public interface OperatingSystemInterface
 
   int INVALID_POINTER_ID = -1;
 
-  int getScreenDensity();
-
   int getAction();
   void upOneOfThem();
   boolean isFirstPressed();
@@ -35,4 +43,10 @@ public interface OperatingSystemInterface
   float getFirstY();
   float getSecondX();
   float getSecondY();
+
+  ///////////////////////////////////////////
+  // LOCAL FILES
+  ///////////////////////////////////////////
+  InputStream openLocalFile(String name);
+  InputStream openLocalFile(int id);
   }
diff --git a/src/main/java/org/distorted/objectlib/main/InitAssets.java b/src/main/java/org/distorted/objectlib/main/InitAssets.java
index 2c7b9fa9..e6ea4645 100644
--- a/src/main/java/org/distorted/objectlib/main/InitAssets.java
+++ b/src/main/java/org/distorted/objectlib/main/InitAssets.java
@@ -9,7 +9,7 @@
 
 package org.distorted.objectlib.main;
 
-import android.content.res.Resources;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -20,15 +20,15 @@ public class InitAssets
   {
   private final InputStream mJsonStream;
   private final InputStream mMeshStream;
-  private final Resources mRes;
+  private final OperatingSystemInterface mInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public InitAssets(InputStream jsonStream, InputStream meshStream, Resources res)
+  public InitAssets(InputStream jsonStream, InputStream meshStream, OperatingSystemInterface inter)
     {
     mJsonStream = jsonStream;
     mMeshStream = meshStream;
-    mRes = res;
+    mInterface  = inter;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -54,9 +54,9 @@ public class InitAssets
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public Resources getResources()
+  public OperatingSystemInterface getOS()
     {
-    return mRes;
+    return mInterface;
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/main/TwistyObject.java b/src/main/java/org/distorted/objectlib/main/TwistyObject.java
index 8a1a4641..bb563d41 100644
--- a/src/main/java/org/distorted/objectlib/main/TwistyObject.java
+++ b/src/main/java/org/distorted/objectlib/main/TwistyObject.java
@@ -15,7 +15,6 @@ import java.io.InputStream;
 import java.util.Random;
 
 import android.content.SharedPreferences;
-import android.content.res.Resources;
 import android.graphics.Bitmap;
 import android.graphics.Canvas;
 import android.graphics.Paint;
@@ -50,6 +49,7 @@ import org.distorted.objectlib.helpers.ObjectSignature;
 import org.distorted.objectlib.helpers.ObjectSticker;
 import org.distorted.objectlib.helpers.ObjectStickerOverride;
 import org.distorted.objectlib.helpers.ObjectVertexEffects;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.helpers.QuatGroupGenerator;
 import org.distorted.objectlib.scrambling.ObjectScrambler;
 import org.distorted.objectlib.json.JsonReader;
@@ -246,8 +246,8 @@ public abstract class TwistyObject
     int[][] edges = getScrambleEdges();
     int[][] algorithms = getScrambleAlgorithms();
 
-    Resources res = asset==null ? null : asset.getResources();
-    TablebasesAbstract tablebase = res!=null ? getTablebase(res) : null;
+    OperatingSystemInterface os = asset==null ? null : asset.getOS();
+    TablebasesAbstract tablebase = os!=null ? getTablebase(os) : null;
     mScrambler = new ObjectScrambler(scramblingType,mNumAxis,mNumLayers,algorithms,edges,tablebase);
 
     boolean bandaged=false;
@@ -301,14 +301,14 @@ public abstract class TwistyObject
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private TablebasesAbstract getTablebase(Resources res)
+  private TablebasesAbstract getTablebase(OperatingSystemInterface os)
     {
     ObjectSignature signature = getSignature();
     long[] array = signature.getArray();
     int len = array.length;
     int sig = (int)array[len-1];
 
-    return ImplementedTablebasesList.createPacked(res,sig);
+    return ImplementedTablebasesList.createPacked(os,sig);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java b/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
index 7264b228..f6230d82 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/ImplementedTablebasesList.java
@@ -9,8 +9,7 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
-
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.main.ObjectSignatures;
 
 import java.lang.reflect.Constructor;
@@ -79,7 +78,7 @@ public enum ImplementedTablebasesList
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private static TablebasesAbstract create(Resources res, int signature, boolean packed)
+  private static TablebasesAbstract create(OperatingSystemInterface os, int signature, boolean packed)
     {
     Class<? extends TablebasesAbstract> clazz=null;
 
@@ -100,7 +99,7 @@ public enum ImplementedTablebasesList
         {
         if( packed )
           {
-          Object[] parameters = new Object[] { res };
+          Object[] parameters = new Object[] { os };
           return (TablebasesAbstract)cons[1].newInstance(parameters);
           }
         else
@@ -131,9 +130,9 @@ public enum ImplementedTablebasesList
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public static TablebasesAbstract createPacked(Resources res, int signature)
+  public static TablebasesAbstract createPacked(OperatingSystemInterface os, int signature)
     {
-    return create(res,signature,true);
+    return create(os,signature,true);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBCube2.java b/src/main/java/org/distorted/objectlib/tablebases/TBCube2.java
index 2d3455b9..cdd68cc1 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBCube2.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBCube2.java
@@ -9,10 +9,9 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -39,9 +38,9 @@ public class TBCube2 extends TablebasesPruning
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBCube2(Resources res)
+  public TBCube2(OperatingSystemInterface os)
     {
-    super(res, new int[] {R.raw.cube_2_pruning4,R.raw.cube_2_pruning5}, new int[] {R.raw.cube_2_pruning11} );
+    super(os, new int[] {R.raw.cube_2_pruning4,R.raw.cube_2_pruning5}, new int[] {R.raw.cube_2_pruning11} );
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBCuboid232.java b/src/main/java/org/distorted/objectlib/tablebases/TBCuboid232.java
index 213d7ba4..edd42917 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBCuboid232.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBCuboid232.java
@@ -9,9 +9,8 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -38,9 +37,9 @@ public class TBCuboid232 extends TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBCuboid232(Resources res)
+  public TBCuboid232(OperatingSystemInterface os)
     {
-    super(res,org.distorted.objectlib.R.raw.cu_232_tablebase);
+    super(os,org.distorted.objectlib.R.raw.cu_232_tablebase);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBDino.java b/src/main/java/org/distorted/objectlib/tablebases/TBDino.java
index 2e8a1888..ed04bb68 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBDino.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBDino.java
@@ -11,9 +11,8 @@ package org.distorted.objectlib.tablebases;
 
 import static org.distorted.objectlib.main.TwistyObject.SQ3;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -46,9 +45,9 @@ public abstract class TBDino extends TablebasesPruning
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBDino(Resources res, int[] middle, int[] high)
+  public TBDino(OperatingSystemInterface os, int[] middle, int[] high)
     {
-    super(res,middle,high);
+    super(os,middle,high);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBDino4.java b/src/main/java/org/distorted/objectlib/tablebases/TBDino4.java
index eae41ab4..fc71ea26 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBDino4.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBDino4.java
@@ -9,9 +9,8 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
-
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -30,9 +29,9 @@ public class TBDino4 extends TBDino
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBDino4(Resources res)
+  public TBDino4(OperatingSystemInterface os)
     {
-    super(res, new int[] {R.raw.din4_3_pruning2,R.raw.din4_3_pruning3}, new int[] {R.raw.din4_3_pruning7});
+    super(os, new int[] {R.raw.din4_3_pruning2,R.raw.din4_3_pruning3}, new int[] {R.raw.din4_3_pruning7});
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBDino6.java b/src/main/java/org/distorted/objectlib/tablebases/TBDino6.java
index 1a954115..fdb0422e 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBDino6.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBDino6.java
@@ -9,9 +9,8 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
-
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -29,9 +28,9 @@ public class TBDino6 extends TBDino
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBDino6(Resources res)
+  public TBDino6(OperatingSystemInterface os)
     {
-    super(res,new int[] {R.raw.dino_3_pruning3,R.raw.dino_3_pruning4},new int[] {R.raw.dino_3_pruning10});
+    super(os,new int[] {R.raw.dino_3_pruning3,R.raw.dino_3_pruning4},new int[] {R.raw.dino_3_pruning10});
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBIvyCube.java b/src/main/java/org/distorted/objectlib/tablebases/TBIvyCube.java
index 41d7b844..d9371c82 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBIvyCube.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBIvyCube.java
@@ -9,9 +9,9 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
+
 import static org.distorted.objectlib.main.TwistyObject.SQ3;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -36,9 +36,9 @@ public class TBIvyCube extends TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBIvyCube(Resources res)
+  public TBIvyCube(OperatingSystemInterface os)
     {
-    super(res,org.distorted.objectlib.R.raw.ivy_2_tablebase);
+    super(os,org.distorted.objectlib.R.raw.ivy_2_tablebase);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBJing.java b/src/main/java/org/distorted/objectlib/tablebases/TBJing.java
index c40acd67..ea1305cc 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBJing.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBJing.java
@@ -14,10 +14,9 @@ import static org.distorted.objectlib.main.TwistyObject.SQ3;
 import static org.distorted.objectlib.main.TwistyObject.SQ6;
 import static org.distorted.objectlib.objects.TwistyJing.F;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -42,10 +41,10 @@ public class TBJing extends TablebasesPruning
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBJing(Resources res)
+  public TBJing(OperatingSystemInterface os)
     {
-    super(res, new int[] {R.raw.jing_2_pruning4 ,R.raw.jing_2_pruning5 },
-               new int[] {R.raw.jing_2_pruning11,R.raw.jing_2_pruning12} );
+    super(os, new int[] {R.raw.jing_2_pruning4 ,R.raw.jing_2_pruning5 },
+              new int[] {R.raw.jing_2_pruning11,R.raw.jing_2_pruning12} );
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBPyraminx.java b/src/main/java/org/distorted/objectlib/tablebases/TBPyraminx.java
index 1e19f3a0..a7128d77 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBPyraminx.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBPyraminx.java
@@ -13,10 +13,9 @@ import static org.distorted.objectlib.main.TwistyObject.SQ2;
 import static org.distorted.objectlib.main.TwistyObject.SQ3;
 import static org.distorted.objectlib.main.TwistyObject.SQ6;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -41,9 +40,9 @@ public class TBPyraminx extends TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBPyraminx(Resources res)
+  public TBPyraminx(OperatingSystemInterface os)
     {
-    super(res, R.raw.pyra_3_tablebase);
+    super(os, R.raw.pyra_3_tablebase);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDiamond.java b/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDiamond.java
index a44ea35a..31b873fe 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDiamond.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDiamond.java
@@ -11,10 +11,9 @@ package org.distorted.objectlib.tablebases;
 
 import static org.distorted.objectlib.main.TwistyObject.SQ2;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -51,9 +50,9 @@ public class TBPyraminxDiamond extends TablebasesPruning
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBPyraminxDiamond(Resources res)
+  public TBPyraminxDiamond(OperatingSystemInterface os)
     {
-    super(res, new int[] {R.raw.pdia_3_pruning3,R.raw.pdia_3_pruning4}, new int[] {R.raw.pdia_3_pruning10});
+    super(os, new int[] {R.raw.pdia_3_pruning3,R.raw.pdia_3_pruning4}, new int[] {R.raw.pdia_3_pruning10});
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDuo.java b/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDuo.java
index 826c7457..d2a05548 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDuo.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBPyraminxDuo.java
@@ -13,9 +13,8 @@ import static org.distorted.objectlib.main.TwistyObject.SQ2;
 import static org.distorted.objectlib.main.TwistyObject.SQ3;
 import static org.distorted.objectlib.main.TwistyObject.SQ6;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -30,9 +29,9 @@ public class TBPyraminxDuo extends TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBPyraminxDuo(Resources res)
+  public TBPyraminxDuo(OperatingSystemInterface os)
     {
-    super(res,org.distorted.objectlib.R.raw.pduo_2_tablebase);
+    super(os,org.distorted.objectlib.R.raw.pduo_2_tablebase);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBSkewb.java b/src/main/java/org/distorted/objectlib/tablebases/TBSkewb.java
index 578156c1..accc7764 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBSkewb.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBSkewb.java
@@ -11,10 +11,9 @@ package org.distorted.objectlib.tablebases;
 
 import static org.distorted.objectlib.main.TwistyObject.SQ3;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -62,10 +61,9 @@ public class TBSkewb extends TablebasesPruning
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBSkewb(Resources res)
+  public TBSkewb(OperatingSystemInterface os)
     {
-    super(res,new int[] {R.raw.skew_2_pruning4,R.raw.skew_2_pruning5},new int[]{R.raw.skew_2_pruning11});
-    //super(res, R.raw.skew_2_tablebase);
+    super(os,new int[] {R.raw.skew_2_pruning4,R.raw.skew_2_pruning5},new int[]{R.raw.skew_2_pruning11});
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TBSkewbDiamond.java b/src/main/java/org/distorted/objectlib/tablebases/TBSkewbDiamond.java
index 07a03725..b6772a3a 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TBSkewbDiamond.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TBSkewbDiamond.java
@@ -13,10 +13,9 @@ import static org.distorted.objectlib.main.TwistyObject.SQ2;
 import static org.distorted.objectlib.main.TwistyObject.SQ3;
 import static org.distorted.objectlib.main.TwistyObject.SQ6;
 
-import android.content.res.Resources;
-
 import org.distorted.library.type.Static3D;
 import org.distorted.objectlib.R;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -49,9 +48,9 @@ public class TBSkewbDiamond extends TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TBSkewbDiamond(Resources res)
+  public TBSkewbDiamond(OperatingSystemInterface os)
     {
-    super(res, R.raw.diam_2_tablebase);
+    super(os, R.raw.diam_2_tablebase);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TablebasesAbstract.java b/src/main/java/org/distorted/objectlib/tablebases/TablebasesAbstract.java
index eaa365e1..4ff9b97a 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TablebasesAbstract.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TablebasesAbstract.java
@@ -9,11 +9,10 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
-
 import org.distorted.library.main.QuatHelper;
 import org.distorted.library.type.Static3D;
 import org.distorted.library.type.Static4D;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 import org.distorted.objectlib.helpers.QuatGroupGenerator;
 
 import java.io.ByteArrayOutputStream;
@@ -99,12 +98,12 @@ public abstract class TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TablebasesAbstract(Resources res, int resource)
+  public TablebasesAbstract(OperatingSystemInterface os, int resource)
     {
     this();
 
     mInitialized = true;
-    InputStream stream = res.openRawResource(resource);
+    InputStream stream = os.openLocalFile(resource);
     ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 
     int nRead;
diff --git a/src/main/java/org/distorted/objectlib/tablebases/TablebasesPruning.java b/src/main/java/org/distorted/objectlib/tablebases/TablebasesPruning.java
index 304dede0..d1f49165 100644
--- a/src/main/java/org/distorted/objectlib/tablebases/TablebasesPruning.java
+++ b/src/main/java/org/distorted/objectlib/tablebases/TablebasesPruning.java
@@ -9,7 +9,7 @@
 
 package org.distorted.objectlib.tablebases;
 
-import android.content.res.Resources;
+import org.distorted.objectlib.helpers.OperatingSystemInterface;
 
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
@@ -34,9 +34,9 @@ public abstract class TablebasesPruning extends TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  private PruningTable createPruningTable(Resources res, int id)
+  private PruningTable createPruningTable(OperatingSystemInterface os, int id)
     {
-    InputStream stream = res.openRawResource(id);
+    InputStream stream = os.openLocalFile(id);
     ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 
     int nRead;
@@ -71,7 +71,7 @@ public abstract class TablebasesPruning extends TablebasesAbstract
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public TablebasesPruning(Resources res, int[] midIDs, int[] highIDs)
+  public TablebasesPruning(OperatingSystemInterface os, int[] midIDs, int[] highIDs)
     {
     super();
 
@@ -83,8 +83,8 @@ public abstract class TablebasesPruning extends TablebasesAbstract
     mGodsNumber = getGodsNumber();
     mInitialized = true;
 
-    for(int i=0; i<mid ; i++) mMidTables[i] = createPruningTable(res,midIDs[i] );
-    for(int i=0; i<high; i++) mHighTables[i]= createPruningTable(res,highIDs[i]);
+    for(int i=0; i<mid ; i++) mMidTables[i] = createPruningTable(os,midIDs[i] );
+    for(int i=0; i<high; i++) mHighTables[i]= createPruningTable(os,highIDs[i]);
 
     computeLowHigh();
     }
