update version name
This commit is contained in:
@@ -10,8 +10,8 @@ android {
|
||||
applicationId "com.stardust.scriptdroid"
|
||||
minSdkVersion 17
|
||||
targetSdkVersion 23
|
||||
versionCode 212
|
||||
versionName "3.0.0 Alpha13"
|
||||
versionCode 213
|
||||
versionName "3.0.0 Alpha14"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
multiDexEnabled true
|
||||
ndk {
|
||||
|
||||
@@ -139,6 +139,9 @@
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<action android:name="android.intent.action.EDIT"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
|
||||
<data android:scheme="file"/>
|
||||
<data android:scheme="content"/>
|
||||
<data android:mimeType="application/x-javascript"/>
|
||||
@@ -157,6 +160,9 @@
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<action android:name="android.intent.action.EDIT"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
|
||||
<data android:scheme="file"/>
|
||||
<data android:scheme="content"/>
|
||||
<data android:mimeType="application/x-javascript"/>
|
||||
@@ -176,6 +182,10 @@
|
||||
<action android:name="android.intent.action.VIEW"/>
|
||||
<action android:name="android.intent.action.EDIT"/>
|
||||
|
||||
<category android:name="android.intent.category.DEFAULT"/>
|
||||
<category android:name="android.intent.category.BROWSABLE"/>
|
||||
|
||||
|
||||
<data android:scheme="file"/>
|
||||
<data android:scheme="content"/>
|
||||
<data android:mimeType="application/x-javascript"/>
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
package com.stardust.scriptdroid.external.open;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.stardust.autojs.script.StringScriptSource;
|
||||
import com.stardust.pio.PFile;
|
||||
import com.stardust.pio.PFiles;
|
||||
import com.stardust.scriptdroid.external.CommonUtils;
|
||||
import com.stardust.scriptdroid.R;
|
||||
import com.stardust.scriptdroid.model.script.ScriptFile;
|
||||
import com.stardust.scriptdroid.model.script.Scripts;
|
||||
import com.stardust.scriptdroid.ui.common.ScriptOperations;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/2/22.
|
||||
@@ -18,11 +30,24 @@ public class RunIntentActivity extends Activity {
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
try {
|
||||
CommonUtils.handleIntent(this, getIntent());
|
||||
handleIntent(getIntent());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
Toast.makeText(this, R.string.edit_and_run_handle_intent_error, Toast.LENGTH_LONG).show();
|
||||
}
|
||||
finish();
|
||||
}
|
||||
|
||||
private void handleIntent(Intent intent) throws FileNotFoundException {
|
||||
Uri uri = intent.getData();
|
||||
if (uri != null && "content".equals(uri.getScheme())) {
|
||||
InputStream stream = getContentResolver().openInputStream(uri);
|
||||
Scripts.run(new StringScriptSource(PFiles.read(stream)));
|
||||
} else {
|
||||
final String path = intent.getData().getPath();
|
||||
if (!TextUtils.isEmpty(path)) {
|
||||
Scripts.run(new ScriptFile(path));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public class BuildActivity extends BaseActivity implements AutoJsApkBuilder.Prog
|
||||
String initialDir = new File(mOutputPath.getText().toString()).exists() ?
|
||||
mOutputPath.getText().toString() : StorageFileProvider.DEFAULT_DIRECTORY_PATH;
|
||||
new FileChooserDialogBuilder(this)
|
||||
.title(R.string.text_source_file_path)
|
||||
.title(R.string.text_output_apk_path)
|
||||
.dir(initialDir)
|
||||
.chooseDir()
|
||||
.singleChoice(dir -> mOutputPath.setText(dir.getPath()))
|
||||
|
||||
Reference in New Issue
Block a user