Skip to content

Commit e72d385

Browse files
author
Mihail Slavchev
committed
remove old code that makes *.js file writable in order to facilitate old LiveSync implementation
1 parent be97c9b commit e72d385

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

src/res/values/bool.xml

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/src/com/tns/AssetExtractor.java

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ static void copyStreams(InputStream is, FileOutputStream fos)
5858
}
5959
}
6060

61-
public static void extractAssets(Context context, ExtractPolicy extractPolicy, boolean writableAssets)
61+
public static void extractAssets(Context context, ExtractPolicy extractPolicy)
6262
{
6363
String appRoot = getAppRoot(context);
6464

6565
if (extractPolicy.extract(appRoot))
6666
{
67-
extractAssetsHelper(context, extractPolicy, writableAssets);
67+
extractAssetsHelper(context, extractPolicy);
6868
}
6969
}
7070

@@ -73,18 +73,13 @@ private static String getAppRoot(Context context)
7373
return context.getFilesDir().getPath();
7474
}
7575

76-
private static void extractAssetsHelper(Context context, ExtractPolicy extractPolicy, boolean writableAssets)
76+
private static void extractAssetsHelper(Context context, ExtractPolicy extractPolicy)
7777
{
7878
try
7979
{
8080
Runtime runtime = Runtime.getRuntime();
8181
String appRoot = getAppRoot(context);
8282

83-
if (writableAssets)
84-
{
85-
runtime.exec("chmod 777 " + appRoot);
86-
}
87-
8883
String packageCodePath = context.getPackageCodePath();
8984
Log.i(Platform.DEFAULT_LOG_TAG, "extractAssets: from " + packageCodePath);
9085
File zipFile = new File(packageCodePath);
@@ -117,16 +112,6 @@ private static void extractAssetsHelper(Context context, ExtractPolicy extractPo
117112
fos = new FileOutputStream(outputFile);
118113
copyStreams(zip.getInputStream(entry), fos);
119114
Log("Copied " + entry + " to " + appRoot + "/" + path);
120-
String curPath = outputFile.getAbsolutePath();
121-
if (writableAssets)
122-
{
123-
do
124-
{
125-
runtime.exec("chmod 777 " + curPath);
126-
curPath = new File(curPath).getParent();
127-
}
128-
while (!curPath.equals(appRoot));
129-
}
130115
}
131116
finally
132117
{

src/src/com/tns/Platform.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ public static int init(Context context) throws Exception
101101
makeInstanceStrong(context, appJavaObjectId);
102102
if (IsLogEnabled) Log.d(DEFAULT_LOG_TAG, "Initialized app instance id:" + appJavaObjectId);
103103

104-
int appBuilderWritableAssetsId = context.getResources().getIdentifier("appBuilderWritableAssets", "bool", context.getPackageName());
105-
AssetExtractor.extractAssets(context, extractPolicy, appBuilderWritableAssetsId == 0 ? false : context.getResources().getBoolean(appBuilderWritableAssetsId));
104+
AssetExtractor.extractAssets(context, extractPolicy);
106105
int debuggerPort = jsDebugger.getDebuggerPortFromEnvironment();
107106
Platform.initNativeScript(Require.getApplicationFilesPath(), appJavaObjectId, IsLogEnabled, context.getPackageName(), debuggerPort);
108107

0 commit comments

Comments
 (0)