6.1.0 - 变更包名 新增投影媒体权限开关/tasks模块 扩展内置模块方法 重构内置模块及构建脚本
This commit is contained in:
@@ -28,13 +28,14 @@ import org.autojs.autojs.timing.TimedTaskManager
|
||||
import org.autojs.autojs.timing.TimedTaskScheduler
|
||||
import org.autojs.autojs.tool.CrashHandler
|
||||
import org.autojs.autojs.ui.error.ErrorReportActivity
|
||||
import org.autojs.autojs6.BuildConfig
|
||||
import org.autojs.autojs6.R
|
||||
import java.lang.ref.WeakReference
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/1/27.
|
||||
*/
|
||||
|
||||
class App : MultiDexApplication() {
|
||||
lateinit var dynamicBroadcastReceivers: DynamicBroadcastReceivers
|
||||
private set
|
||||
|
||||
@@ -3,8 +3,6 @@ package org.autojs.autojs;
|
||||
/**
|
||||
* Created by Stardust on 2017/7/7.
|
||||
*/
|
||||
|
||||
public final class Constants {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.autojs.autojs;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Environment;
|
||||
|
||||
@@ -10,6 +9,7 @@ import com.stardust.app.GlobalAppContext;
|
||||
import com.stardust.autojs.runtime.accessibility.AccessibilityConfig;
|
||||
|
||||
import org.autojs.autojs.autojs.key.GlobalKeyObserver;
|
||||
import org.autojs.autojs6.R;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Objects;
|
||||
@@ -19,7 +19,6 @@ import java.util.Objects;
|
||||
*/
|
||||
public class Pref {
|
||||
|
||||
private static final SharedPreferences DISPOSABLE_BOOLEAN = GlobalAppContext.get().getSharedPreferences("DISPOSABLE_BOOLEAN", Context.MODE_PRIVATE);
|
||||
private static final String KEY_SERVER_ADDRESS = "KEY_SERVER_ADDRESS";
|
||||
private static final String KEY_FLOATING_MENU_SHOWN = "KEY_FLOATING_MENU_SHOWN";
|
||||
private static final String KEY_APP_LANG_INDEX = "KEY_APP_LANG_INDEX";
|
||||
@@ -37,52 +36,25 @@ public class Pref {
|
||||
|
||||
static {
|
||||
AccessibilityConfig.setIsUnintendedGuardEnabled(def().getBoolean(getString(R.string.key_guard_mode), false));
|
||||
def().registerOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
|
||||
}
|
||||
|
||||
private static SharedPreferences def() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(GlobalAppContext.get());
|
||||
}
|
||||
|
||||
private static boolean getDisposableBoolean(String key, boolean defaultValue) {
|
||||
boolean b = DISPOSABLE_BOOLEAN.getBoolean(key, defaultValue);
|
||||
if (b == defaultValue) {
|
||||
DISPOSABLE_BOOLEAN.edit().putBoolean(key, !defaultValue).apply();
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
public static boolean isNightModeEnabled() {
|
||||
return def().getBoolean(getString(R.string.key_night_mode), false);
|
||||
}
|
||||
|
||||
public static boolean isFirstGoToAccessibilitySetting() {
|
||||
return getDisposableBoolean("isFirstGoToAccessibilitySetting", false);
|
||||
}
|
||||
|
||||
public static boolean isRunningVolumeControlEnabled() {
|
||||
return def().getBoolean(getString(R.string.key_use_volume_control_running), true);
|
||||
}
|
||||
|
||||
public static boolean shouldEnableAccessibilityServiceByRoot() {
|
||||
return def().getBoolean(getString(R.string.key_enable_a11y_service_with_root_access), true);
|
||||
}
|
||||
|
||||
public static boolean shouldEnableAccessibilityServiceBySecureSettings() {
|
||||
return def().getBoolean(getString(R.string.key_enable_a11y_service_with_secure_settings), true);
|
||||
}
|
||||
|
||||
private static String getString(int id) {
|
||||
return GlobalAppContext.getString(id);
|
||||
}
|
||||
|
||||
public static boolean isFirstUsing() {
|
||||
return getDisposableBoolean("isFirstUsing", true);
|
||||
}
|
||||
|
||||
static {
|
||||
def().registerOnSharedPreferenceChangeListener(onSharedPreferenceChangeListener);
|
||||
}
|
||||
|
||||
public static String getServerAddressOrDefault(String defaultAddress) {
|
||||
return def().getString(KEY_SERVER_ADDRESS, defaultAddress);
|
||||
}
|
||||
@@ -96,7 +68,7 @@ public class Pref {
|
||||
}
|
||||
|
||||
public static boolean rootRecordGeneratesBinary() {
|
||||
return Objects.equals(def().getString(getString(R.string.key_root_record_out_file_type), getString(R.string.default_value_binary)), getString(R.string.value_root_record_out_file_type_binary));
|
||||
return Objects.equals(def().getString(getString(R.string.key_root_record_out_file_type), getString(R.string.default_value_binary)), getString(R.string.key_root_record_out_file_type_binary));
|
||||
}
|
||||
|
||||
public static boolean isStableModeEnabled() {
|
||||
@@ -105,7 +77,7 @@ public class Pref {
|
||||
|
||||
public static String getDocumentationUrl() {
|
||||
String docSource = def().getString(getString(R.string.key_documentation_source), null);
|
||||
if (docSource == null || docSource.equals(getString(R.string.value_documentation_source_local))) {
|
||||
if (docSource == null || docSource.equals(getString(R.string.key_documentation_source_local))) {
|
||||
return "file:///android_asset/docs/";
|
||||
} else {
|
||||
return "https://www.autojs.org/assets/autojs/docs/";
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.stardust.view.accessibility.AccessibilityService;
|
||||
import com.stardust.view.accessibility.LayoutInspector;
|
||||
import com.stardust.view.accessibility.NodeInfo;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.external.fileprovider.AppFileProvider;
|
||||
import org.autojs.autojs.pluginclient.DevPluginService;
|
||||
import org.autojs.autojs.ui.floating.FloatyWindowManger;
|
||||
@@ -39,7 +39,6 @@ import java.util.concurrent.Executors;
|
||||
/**
|
||||
* Created by Stardust on 2017/4/2.
|
||||
*/
|
||||
|
||||
public class AutoJs extends com.stardust.autojs.AutoJs {
|
||||
|
||||
private static AutoJs instance;
|
||||
@@ -123,7 +122,7 @@ public class AutoJs extends com.stardust.autojs.AutoJs {
|
||||
String log = super.println(level, charSequence);
|
||||
|
||||
// FIXME by SuperMonster003 as of Feb 2, 2022.
|
||||
// ! When running in 'ui' thread (`ui.run`, `ui.post`),
|
||||
// ! When running in "ui" thread (ui.run() or ui.post()),
|
||||
// ! android.os.NetworkOnMainThreadException may happen.
|
||||
// ! Further more, dunno if a thread executor is a good idea.
|
||||
printExecutor.submit(() -> devPluginService.print(log));
|
||||
@@ -145,14 +144,14 @@ public class AutoJs extends com.stardust.autojs.AutoJs {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void waitForAccessibilityServiceEnabled() {
|
||||
public void waitForAccessibilityServiceEnabled(long timeout) {
|
||||
if (AccessibilityService.Companion.getInstance() != null) {
|
||||
return;
|
||||
}
|
||||
String errorMessage = tryEnableAccessibilityService();
|
||||
if (errorMessage != null) {
|
||||
getAccessibilityTool().goToAccessibilitySetting();
|
||||
if (!AccessibilityService.Companion.waitForEnabled(-1)) {
|
||||
if (!AccessibilityService.Companion.waitForEnabled(timeout)) {
|
||||
throw new ScriptInterruptedException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,13 @@ import com.stardust.autojs.execution.ScriptExecution;
|
||||
import com.stardust.autojs.execution.ScriptExecutionListener;
|
||||
import com.stardust.autojs.runtime.api.Console;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/5/3.
|
||||
*/
|
||||
|
||||
public class ScriptExecutionGlobalListener implements ScriptExecutionListener {
|
||||
private static final String ENGINE_TAG_START_TIME = "org.autojs.autojs.autojs.Goodbye, World";
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ import zhao.arsceditor.ResDecoder.data.ResTable;
|
||||
/**
|
||||
* Created by Stardust on 2017/10/24.
|
||||
*/
|
||||
|
||||
public class ApkBuilder {
|
||||
|
||||
|
||||
@@ -139,10 +138,10 @@ public class ApkBuilder {
|
||||
}
|
||||
|
||||
private ProgressCallback mProgressCallback;
|
||||
private ApkPackager mApkPackager;
|
||||
private final ApkPackager mApkPackager;
|
||||
private String mArscPackageName;
|
||||
private ManifestEditor mManifestEditor;
|
||||
private String mWorkspacePath;
|
||||
private final String mWorkspacePath;
|
||||
private AppConfig mAppConfig;
|
||||
private final File mOutApkFile;
|
||||
private String mInitVector;
|
||||
@@ -318,7 +317,7 @@ public class ApkBuilder {
|
||||
private void buildArsc() throws IOException {
|
||||
File oldArsc = new File(mWorkspacePath, "resources.arsc");
|
||||
File newArsc = new File(mWorkspacePath, "resources.arsc.new");
|
||||
ARSCDecoder decoder = new ARSCDecoder(new BufferedInputStream(new FileInputStream(oldArsc)), (ResTable) null, false);
|
||||
ARSCDecoder decoder = new ARSCDecoder(new BufferedInputStream(new FileInputStream(oldArsc)), null, false);
|
||||
FileOutputStream fos = new FileOutputStream(newArsc);
|
||||
decoder.CloneArsc(fos, mArscPackageName, true);
|
||||
oldArsc.delete();
|
||||
|
||||
@@ -7,29 +7,25 @@ import com.stardust.app.GlobalAppContext;
|
||||
import com.stardust.autojs.core.inputevent.InputEventObserver;
|
||||
import com.stardust.autojs.core.inputevent.ShellKeyObserver;
|
||||
import com.stardust.event.EventDispatcher;
|
||||
import org.autojs.autojs.Pref;
|
||||
import org.autojs.autojs.autojs.AutoJs;
|
||||
import com.stardust.view.accessibility.AccessibilityService;
|
||||
import com.stardust.view.accessibility.OnKeyListener;
|
||||
|
||||
import javax.microedition.khronos.opengles.GL;
|
||||
import org.autojs.autojs.Pref;
|
||||
import org.autojs.autojs.autojs.AutoJs;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/8/14.
|
||||
*/
|
||||
|
||||
public class GlobalKeyObserver implements OnKeyListener, ShellKeyObserver.KeyListener {
|
||||
|
||||
|
||||
public interface OnVolumeDownListener {
|
||||
void onVolumeDown();
|
||||
}
|
||||
|
||||
private static final EventDispatcher.Event<OnVolumeDownListener> VOLUME_DOWN_EVENT = OnVolumeDownListener::onVolumeDown;
|
||||
private static final String LOG_TAG = "GlobalKeyObserver";
|
||||
private static final long EVENT_TIMEOUT = 200;
|
||||
private static GlobalKeyObserver sSingleton;
|
||||
private EventDispatcher<OnVolumeDownListener> mVolumeDownEventDispatcher = new EventDispatcher<>();
|
||||
private final EventDispatcher<OnVolumeDownListener> mVolumeDownEventDispatcher = new EventDispatcher<>();
|
||||
private boolean mVolumeDownFromShell, mVolumeDownFromAccessibility;
|
||||
private boolean mVolumeUpFromShell, mVolumeUpFromAccessibility;
|
||||
|
||||
@@ -74,8 +70,9 @@ public class GlobalKeyObserver implements OnKeyListener, ShellKeyObserver.KeyLis
|
||||
|
||||
@Override
|
||||
public void onKeyEvent(int keyCode, KeyEvent event) {
|
||||
if (event.getAction() != KeyEvent.ACTION_UP)
|
||||
if (event.getAction() != KeyEvent.ACTION_DOWN) {
|
||||
return;
|
||||
}
|
||||
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN) {
|
||||
if (mVolumeDownFromShell) {
|
||||
mVolumeDownFromShell = false;
|
||||
@@ -96,11 +93,6 @@ public class GlobalKeyObserver implements OnKeyListener, ShellKeyObserver.KeyLis
|
||||
|
||||
@Override
|
||||
public void onKeyDown(String keyName) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyUp(String keyName) {
|
||||
if ("KEY_VOLUMEUP".equals(keyName)) {
|
||||
if (mVolumeUpFromAccessibility) {
|
||||
mVolumeUpFromAccessibility = false;
|
||||
@@ -117,4 +109,9 @@ public class GlobalKeyObserver implements OnKeyListener, ShellKeyObserver.KeyLis
|
||||
onVolumeDown();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onKeyUp(String keyName) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.stardust.autojs.core.record.inputevent.InputEventToAutoFileRecorder;
|
||||
import com.stardust.autojs.core.record.inputevent.InputEventToRootAutomatorRecorder;
|
||||
import com.stardust.autojs.core.record.inputevent.TouchRecorder;
|
||||
import org.autojs.autojs.Pref;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.ui.common.ScriptOperations;
|
||||
import org.autojs.autojs.theme.dialog.ThemeColorMaterialDialogBuilder;
|
||||
import com.stardust.util.ClipboardUtil;
|
||||
@@ -24,13 +24,12 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
||||
/**
|
||||
* Created by Stardust on 2017/8/6.
|
||||
*/
|
||||
|
||||
public class GlobalActionRecorder implements Recorder.OnStateChangedListener {
|
||||
|
||||
private static GlobalActionRecorder sSingleton;
|
||||
private CopyOnWriteArrayList<Recorder.OnStateChangedListener> mOnStateChangedListeners = new CopyOnWriteArrayList<>();
|
||||
private final CopyOnWriteArrayList<Recorder.OnStateChangedListener> mOnStateChangedListeners = new CopyOnWriteArrayList<>();
|
||||
private TouchRecorder mTouchRecorder;
|
||||
private Context mContext;
|
||||
private final Context mContext;
|
||||
private boolean mDiscard = false;
|
||||
|
||||
public static GlobalActionRecorder getSingleton(Context context) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.content.pm.PackageManager;
|
||||
|
||||
import com.stardust.pio.UncheckedIOException;
|
||||
|
||||
import org.autojs.autojs.BuildConfig;
|
||||
import org.autojs.autojs6.BuildConfig;
|
||||
|
||||
import com.stardust.util.DeveloperUtils;
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.io.InputStream;
|
||||
/**
|
||||
* Created by Stardust on 2017/11/29.
|
||||
*/
|
||||
|
||||
public class ApkBuilderPluginHelper {
|
||||
|
||||
private static final String PLUGIN_PACKAGE_NAME = "org.autojs.apkbuilderplugin";
|
||||
|
||||
@@ -7,7 +7,6 @@ import androidx.annotation.Nullable;
|
||||
/**
|
||||
* Created by Stardust on 2017/5/15.
|
||||
*/
|
||||
|
||||
public class ScriptExecutionIntentService extends IntentService {
|
||||
|
||||
public ScriptExecutionIntentService() {
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.io.File;
|
||||
/**
|
||||
* Created by Stardust on 2017/4/1.
|
||||
*/
|
||||
|
||||
public class ScriptIntents {
|
||||
|
||||
public static final String EXTRA_KEY_PATH = "path";
|
||||
|
||||
@@ -8,7 +8,7 @@ import java.io.File;
|
||||
|
||||
public class AppFileProvider extends FileProvider {
|
||||
|
||||
public static final String AUTHORITY = "org.autojs.autojs.fileprovider";
|
||||
public static final String AUTHORITY = "org.autojs.autojs6.fileprovider";
|
||||
|
||||
public static Uri getUriForFile(Context context, File file){
|
||||
return FileProvider.getUriForFile(context, AUTHORITY, file);
|
||||
|
||||
@@ -1,98 +0,0 @@
|
||||
package org.autojs.autojs.external.foreground;
|
||||
|
||||
import android.app.ActivityManager;
|
||||
import android.app.Notification;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.app.PendingIntent;
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.RequiresApi;
|
||||
import androidx.core.app.NotificationCompat;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs.ui.main.MainActivity_;
|
||||
|
||||
public class ForegroundService extends Service {
|
||||
|
||||
|
||||
private static final int NOTIFICATION_ID = 1;
|
||||
private static final String CHANNEL_ID = ForegroundService.class.getName() + ".foreground";
|
||||
|
||||
public static void start(Context context) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
context.startForegroundService(new Intent(context, ForegroundService.class));
|
||||
} else {
|
||||
context.startService(new Intent(context, ForegroundService.class));
|
||||
}
|
||||
}
|
||||
|
||||
public static void stop(Context context){
|
||||
context.stopService(new Intent(context, ForegroundService.class));
|
||||
}
|
||||
|
||||
public static boolean isRunning(Context context) {
|
||||
ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
|
||||
for (ActivityManager.RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
|
||||
if (ForegroundService.class.getName().equals(service.service.getClassName())) {
|
||||
return service.foreground;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
startForeground();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void startForeground() {
|
||||
startForeground(NOTIFICATION_ID, buildNotification());
|
||||
}
|
||||
|
||||
private Notification buildNotification() {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
createNotificationChannel();
|
||||
}
|
||||
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, MainActivity_.intent(this).get(), 0);
|
||||
return new NotificationCompat.Builder(this, CHANNEL_ID)
|
||||
.setContentTitle(getString(R.string.foreground_notification_title))
|
||||
.setContentText(getString(R.string.foreground_notification_text))
|
||||
.setSmallIcon(R.drawable.autojs_material)
|
||||
.setWhen(System.currentTimeMillis())
|
||||
.setContentIntent(contentIntent)
|
||||
.setChannelId(CHANNEL_ID)
|
||||
.setVibrate(new long[0])
|
||||
.build();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.O)
|
||||
private void createNotificationChannel() {
|
||||
NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
assert manager != null;
|
||||
CharSequence name = getString(R.string.foreground_notification_channel_name);
|
||||
String description = getString(R.string.foreground_notification_channel_name);
|
||||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, NotificationManager.IMPORTANCE_DEFAULT);
|
||||
channel.setDescription(description);
|
||||
channel.enableLights(false);
|
||||
manager.createNotificationChannel(channel);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
stopForeground(true);
|
||||
super.onDestroy();
|
||||
|
||||
}
|
||||
}
|
||||
62
app/src/main/java/org/autojs/autojs/external/foreground/MainActivityForegroundService.java
vendored
Normal file
62
app/src/main/java/org/autojs/autojs/external/foreground/MainActivityForegroundService.java
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
package org.autojs.autojs.external.foreground;
|
||||
|
||||
import android.app.Service;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.IBinder;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.stardust.autojs.util.ForegroundServiceCreator;
|
||||
import com.stardust.autojs.util.ForegroundServiceUtils;
|
||||
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.ui.main.MainActivity_;
|
||||
|
||||
/**
|
||||
* Modified by SuperMonster003 as of Apr 10, 2022.
|
||||
*/
|
||||
public class MainActivityForegroundService extends Service {
|
||||
|
||||
private static final int NOTIFICATION_ID = 1;
|
||||
private static final Class<MainActivityForegroundService> sClassName = MainActivityForegroundService.class;
|
||||
|
||||
public static void start(Context context) {
|
||||
ForegroundServiceUtils.startService(context, sClassName);
|
||||
}
|
||||
|
||||
public static void stop(Context context) {
|
||||
ForegroundServiceUtils.stopServiceIfNeeded(context, sClassName);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBinder onBind(Intent intent) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
startForeground();
|
||||
}
|
||||
|
||||
private void startForeground() {
|
||||
ForegroundServiceUtils.startForeground(new ForegroundServiceCreator.Builder(this)
|
||||
.setClassName(sClassName)
|
||||
.setIntent(MainActivity_.intent(this).get())
|
||||
.setNotificationId(NOTIFICATION_ID)
|
||||
.setServiceName(R.string.foreground_notification_channel_name)
|
||||
.setServiceDescription(R.string.foreground_notification_channel_name)
|
||||
.setNotificationTitle(R.string.foreground_notification_title)
|
||||
.setNotificationContent(R.string.foreground_notification_text)
|
||||
.create());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
stopForeground(true);
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,14 +15,13 @@ import com.stardust.pio.PFiles;
|
||||
|
||||
import org.autojs.autojs.ui.BaseActivity;
|
||||
import org.autojs.autojs.ui.edit.EditActivity;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/2/2.
|
||||
*/
|
||||
|
||||
public class EditIntentActivity extends BaseActivity {
|
||||
|
||||
private static final String EXTERNAL_FILES = "external_files";
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.widget.Toast;
|
||||
import com.stardust.pio.PFiles;
|
||||
import org.autojs.autojs.ui.BaseActivity;
|
||||
import org.autojs.autojs.ui.common.ScriptOperations;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
@@ -18,7 +18,6 @@ import java.io.InputStream;
|
||||
/**
|
||||
* Created by Stardust on 2017/2/2.
|
||||
*/
|
||||
|
||||
public class ImportIntentActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.widget.Toast;
|
||||
import com.stardust.autojs.script.StringScriptSource;
|
||||
import com.stardust.pio.PFiles;
|
||||
import org.autojs.autojs.external.ScriptIntents;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.model.script.Scripts;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -19,7 +19,6 @@ import java.io.InputStream;
|
||||
/**
|
||||
* Created by Stardust on 2017/2/22.
|
||||
*/
|
||||
|
||||
public class RunIntentActivity extends Activity {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,16 +10,15 @@ import org.autojs.autojs.tool.BitmapTool;
|
||||
/**
|
||||
* Created by Stardust on 2017/1/20.
|
||||
*/
|
||||
|
||||
public class Shortcut {
|
||||
|
||||
private Context mContext;
|
||||
private final Context mContext;
|
||||
private String mName;
|
||||
private String mTargetClass;
|
||||
private String mTargetPackage;
|
||||
private Intent.ShortcutIconResource mIconRes;
|
||||
private boolean mDuplicate = false;
|
||||
private Intent mLaunchIntent = new Intent();
|
||||
private final Intent mLaunchIntent = new Intent();
|
||||
private Bitmap mIcon;
|
||||
|
||||
public Shortcut(Context context) {
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.content.Intent;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.graphics.drawable.Icon;
|
||||
import android.os.Build;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -15,14 +15,13 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Stardust on 2017/10/25.
|
||||
*/
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N_MR1)
|
||||
public class ShortcutManager {
|
||||
|
||||
|
||||
private static ShortcutManager sInstance;
|
||||
private Context mContext;
|
||||
private android.content.pm.ShortcutManager mShortcutManager;
|
||||
private final Context mContext;
|
||||
private final android.content.pm.ShortcutManager mShortcutManager;
|
||||
|
||||
|
||||
public ShortcutManager(Context context) {
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.twofortyfouram.locale.sdk.client.receiver.AbstractPluginSettingReceiv
|
||||
/**
|
||||
* Created by Stardust on 2017/3/27.
|
||||
*/
|
||||
|
||||
public class FireSettingReceiver extends AbstractPluginSettingReceiver {
|
||||
|
||||
private static final String TAG = "FireSettingReceiver";
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.twofortyfouram.locale.sdk.client.ui.activity.AbstractAppCompatPluginA
|
||||
import org.androidannotations.annotations.AfterViews;
|
||||
import org.androidannotations.annotations.Click;
|
||||
import org.androidannotations.annotations.EActivity;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.external.ScriptIntents;
|
||||
import org.autojs.autojs.model.explorer.ExplorerDirPage;
|
||||
import org.autojs.autojs.model.explorer.Explorers;
|
||||
@@ -41,7 +41,7 @@ public class TaskPrefEditActivity extends AbstractAppCompatPluginActivity {
|
||||
|
||||
|
||||
private void initScriptListRecyclerView() {
|
||||
ExplorerView explorerView = (ExplorerView) findViewById(R.id.script_list);
|
||||
ExplorerView explorerView = findViewById(R.id.script_list);
|
||||
explorerView.setExplorer(Explorers.external(), ExplorerDirPage.createRoot(Environment.getExternalStorageDirectory()));
|
||||
explorerView.setOnItemClickListener((view, item) -> {
|
||||
mSelectedScriptFilePath = item.getPath();
|
||||
|
||||
@@ -5,7 +5,7 @@ import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.widget.Toast;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.timing.TaskReceiver;
|
||||
import org.autojs.autojs.tool.Observers;
|
||||
import org.autojs.autojs.ui.BaseActivity;
|
||||
|
||||
@@ -1,17 +1,10 @@
|
||||
package org.autojs.autojs.external.tile;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.service.quicksettings.Tile;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.stardust.view.accessibility.NodeInfo;
|
||||
|
||||
import org.autojs.autojs.ui.floating.FullScreenFloatyWindow;
|
||||
import org.autojs.autojs.ui.floating.layoutinspector.LayoutBoundsFloatyWindow;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public class LayoutBoundsTile extends LayoutInspectTileService {
|
||||
@Override
|
||||
protected FullScreenFloatyWindow onCreateWindow(NodeInfo capture) {
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
package org.autojs.autojs.external.tile;
|
||||
|
||||
import android.os.Build;
|
||||
import android.service.quicksettings.Tile;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.stardust.view.accessibility.NodeInfo;
|
||||
|
||||
import org.autojs.autojs.ui.floating.FullScreenFloatyWindow;
|
||||
import org.autojs.autojs.ui.floating.layoutinspector.LayoutHierarchyFloatyWindow;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public class LayoutHierarchyTile extends LayoutInspectTileService {
|
||||
@Override
|
||||
protected FullScreenFloatyWindow onCreateWindow(NodeInfo capture) {
|
||||
|
||||
@@ -1,28 +1,24 @@
|
||||
package org.autojs.autojs.external.tile;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.service.quicksettings.Tile;
|
||||
import android.service.quicksettings.TileService;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
import com.stardust.autojs.core.accessibility.AccessibilityServiceTool;
|
||||
import com.stardust.view.accessibility.AccessibilityService;
|
||||
import com.stardust.view.accessibility.LayoutInspector;
|
||||
import com.stardust.view.accessibility.NodeInfo;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs.autojs.AutoJs;
|
||||
import org.autojs.autojs.ui.floating.FloatyWindowManger;
|
||||
import org.autojs.autojs.ui.floating.FullScreenFloatyWindow;
|
||||
import org.autojs.autojs6.R;
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
public abstract class LayoutInspectTileService extends TileService implements LayoutInspector.CaptureAvailableListener {
|
||||
|
||||
private boolean mCapturing = false;
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.util.Log;
|
||||
import android.widget.RemoteViews;
|
||||
|
||||
import com.stardust.pio.PFiles;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.external.ScriptIntents;
|
||||
import org.autojs.autojs.external.open.RunIntentActivity;
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.Set;
|
||||
/**
|
||||
* Created by Stardust on 2017/7/11.
|
||||
*/
|
||||
|
||||
public class ScriptWidget extends AppWidgetProvider {
|
||||
|
||||
private static final String LOG_TAG = "ScriptWidget";
|
||||
|
||||
@@ -10,7 +10,7 @@ import android.view.MenuItem;
|
||||
|
||||
import org.androidannotations.annotations.AfterViews;
|
||||
import org.androidannotations.annotations.EActivity;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.model.explorer.Explorer;
|
||||
import org.autojs.autojs.model.explorer.ExplorerDirPage;
|
||||
import org.autojs.autojs.model.explorer.ExplorerFileProvider;
|
||||
|
||||
@@ -5,9 +5,7 @@ import android.content.SharedPreferences;
|
||||
import android.util.Log;
|
||||
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
import org.autojs.autojs.App;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -18,12 +16,11 @@ import java.util.regex.Pattern;
|
||||
/**
|
||||
* Created by Stardust on 2017/7/11.
|
||||
*/
|
||||
|
||||
public class ScriptWidgets {
|
||||
|
||||
|
||||
private static final String LOG_TAG = "ScriptWidgets";
|
||||
private static SharedPreferences widgets = GlobalAppContext.get().getSharedPreferences("ScriptWidgets", Context.MODE_PRIVATE);
|
||||
private static final SharedPreferences widgets = GlobalAppContext.get().getSharedPreferences("ScriptWidgets", Context.MODE_PRIVATE);
|
||||
private static final Pattern ID_PATTERN = Pattern.compile("[a-zA-Z]+_([0-9])+");
|
||||
|
||||
static String getPathForAppWidgetId(int id) {
|
||||
|
||||
@@ -1,28 +1,23 @@
|
||||
package org.autojs.autojs.model.autocomplete;
|
||||
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
|
||||
import org.autojs.autojs.model.indices.Property;
|
||||
import org.autojs.autojs.ui.widget.SimpleTextWatcher;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2018/2/26.
|
||||
*/
|
||||
|
||||
public class AnyWordsCompletion extends SimpleTextWatcher {
|
||||
|
||||
|
||||
private static final String PATTERN = "[\\W]";
|
||||
private ExecutorService mExecutorService;
|
||||
private final ExecutorService mExecutorService;
|
||||
private volatile DictionaryTree<String> mDictionaryTree;
|
||||
private AtomicInteger mExecuteId = new AtomicInteger();
|
||||
private final AtomicInteger mExecuteId = new AtomicInteger();
|
||||
|
||||
public AnyWordsCompletion(ExecutorService executorService) {
|
||||
mExecutorService = executorService;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.autojs.autojs.model.autocomplete;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
@@ -8,8 +9,6 @@ import android.widget.EditText;
|
||||
import org.autojs.autojs.model.indices.Module;
|
||||
import org.autojs.autojs.model.indices.Modules;
|
||||
import org.autojs.autojs.model.indices.Property;
|
||||
import org.autojs.autojs.ui.widget.SimpleTextWatcher;
|
||||
import org.mozilla.javascript.ast.Loop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -26,7 +25,6 @@ import io.reactivex.schedulers.Schedulers;
|
||||
/**
|
||||
* Created by Stardust on 2018/2/3.
|
||||
*/
|
||||
|
||||
public class AutoCompletion {
|
||||
|
||||
public interface AutoCompleteCallback {
|
||||
@@ -39,12 +37,12 @@ public class AutoCompletion {
|
||||
private String mModuleName;
|
||||
private String mPropertyPrefill;
|
||||
private List<Module> mModules;
|
||||
private DictionaryTree<Property> mGlobalPropertyTree = new DictionaryTree<>();
|
||||
private final DictionaryTree<Property> mGlobalPropertyTree = new DictionaryTree<>();
|
||||
private AutoCompleteCallback mAutoCompleteCallback;
|
||||
private ExecutorService mExecutorService = Executors.newSingleThreadExecutor();
|
||||
private AnyWordsCompletion mAnyWordsCompletion;
|
||||
private AtomicInteger mExecuteId = new AtomicInteger();
|
||||
private Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
private final ExecutorService mExecutorService = Executors.newSingleThreadExecutor();
|
||||
private final AnyWordsCompletion mAnyWordsCompletion;
|
||||
private final AtomicInteger mExecuteId = new AtomicInteger();
|
||||
private final Handler mHandler = new Handler(Looper.getMainLooper());
|
||||
private final EditText mEditText;
|
||||
|
||||
public AutoCompletion(Context context, EditText editText) {
|
||||
@@ -58,6 +56,8 @@ public class AutoCompletion {
|
||||
mAutoCompleteCallback = autoCompleteCallback;
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
@SuppressLint("CheckResult")
|
||||
private void buildDictionaryTree(Context context) {
|
||||
Modules.getInstance().getModules(context)
|
||||
.subscribeOn(Schedulers.io())
|
||||
|
||||
@@ -3,7 +3,6 @@ package org.autojs.autojs.model.autocomplete;
|
||||
/**
|
||||
* Created by Stardust on 2018/2/3.
|
||||
*/
|
||||
|
||||
public class CodeCompletion {
|
||||
|
||||
private final String mHint;
|
||||
|
||||
@@ -9,8 +9,8 @@ import java.util.List;
|
||||
public class CodeCompletions {
|
||||
|
||||
|
||||
private int mFrom;
|
||||
private List<CodeCompletion> mCompletions;
|
||||
private final int mFrom;
|
||||
private final List<CodeCompletion> mCompletions;
|
||||
|
||||
public CodeCompletions(int cursor, List<CodeCompletion> completions) {
|
||||
mFrom = cursor;
|
||||
|
||||
@@ -11,7 +11,6 @@ import java.util.TreeMap;
|
||||
/**
|
||||
* Created by Stardust on 2018/2/3.
|
||||
*/
|
||||
|
||||
public class DictionaryTree<T> {
|
||||
|
||||
private static class Node<T> {
|
||||
@@ -36,7 +35,7 @@ public class DictionaryTree<T> {
|
||||
}
|
||||
}
|
||||
|
||||
private Node<T> mRoot = new Node<>('@');
|
||||
private final Node<T> mRoot = new Node<>('@');
|
||||
|
||||
public void putWord(String word, T tag) {
|
||||
Node<T> node = mRoot;
|
||||
|
||||
@@ -5,10 +5,9 @@ import java.util.Arrays;
|
||||
/**
|
||||
* Created by Stardust on 2017/9/28.
|
||||
*/
|
||||
|
||||
public class Symbols {
|
||||
|
||||
private static CodeCompletions sSymbols = CodeCompletions.just(Arrays.asList(
|
||||
private static final CodeCompletions sSymbols = CodeCompletions.just(Arrays.asList(
|
||||
"\"", "(", ")", "=", ";", "/", "{", "}", "!", "|", "&", "-",
|
||||
"[", "]", "+", "-", "<", ">", "\\", "*", "?"));
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
|
||||
public class EditorTheme {
|
||||
|
||||
private static Gson sGson;
|
||||
private static final Gson sGson;
|
||||
|
||||
static {
|
||||
sGson = new GsonBuilder()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.autojs.autojs.model.editor;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.Collections;
|
||||
@@ -8,7 +10,6 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Stardust on 2018/2/21.
|
||||
*/
|
||||
|
||||
public class TokenColor {
|
||||
|
||||
@SerializedName("name")
|
||||
@@ -47,6 +48,7 @@ public class TokenColor {
|
||||
mSettings = settings;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TokenColor{" +
|
||||
|
||||
@@ -6,8 +6,6 @@ import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import org.mozilla.javascript.Token;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
@@ -16,7 +14,6 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Stardust on 2018/2/21.
|
||||
*/
|
||||
|
||||
public class TokenColorDeserializer implements JsonDeserializer<TokenColor> {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.google.gson.annotations.SerializedName;
|
||||
/**
|
||||
* Created by Stardust on 2018/2/21.
|
||||
*/
|
||||
|
||||
public class TokenColorSettings {
|
||||
|
||||
@SerializedName("foreground")
|
||||
|
||||
@@ -12,7 +12,6 @@ import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
|
||||
import static org.autojs.autojs.model.explorer.ExplorerChangeEvent.*;
|
||||
|
||||
|
||||
public class Explorer {
|
||||
|
||||
private final ExplorerProvider mExplorerProvider;
|
||||
@@ -59,7 +58,6 @@ public class Explorer {
|
||||
return getFromCache(getParent(item));
|
||||
}
|
||||
|
||||
|
||||
public void notifyItemRemoved(ExplorerItem item) {
|
||||
ExplorerPage parent = getParent(item);
|
||||
ExplorerPage cachedParent = getFromCache(parent);
|
||||
@@ -90,14 +88,12 @@ public class Explorer {
|
||||
mEventBus.post(new ExplorerChangeEvent(parent, CREATE, item, item));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public void refreshAll() {
|
||||
if (mExplorerPageLruCache != null)
|
||||
mExplorerPageLruCache.evictAll();
|
||||
mEventBus.post(ExplorerChangeEvent.EVENT_ALL);
|
||||
}
|
||||
|
||||
|
||||
public Single<ExplorerPage> fetchChildren(ExplorerPage page) {
|
||||
ExplorerPage cachedGroup = mExplorerPageLruCache == null ? null : mExplorerPageLruCache.get(page.getPath());
|
||||
if (cachedGroup != null) {
|
||||
@@ -127,4 +123,5 @@ public class Explorer {
|
||||
public void unregisterChangeListener(Object subscriber) {
|
||||
mEventBus.unregister(subscriber);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
package org.autojs.autojs.model.explorer;
|
||||
|
||||
import com.stardust.util.ObjectHelper;
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class ExplorerChangeEvent {
|
||||
|
||||
@@ -49,6 +49,7 @@ public class ExplorerChangeEvent {
|
||||
return mPage;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ExplorerChangeEvent{" +
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package org.autojs.autojs.model.explorer;
|
||||
|
||||
import android.os.Build;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import com.stardust.pio.PFile;
|
||||
|
||||
@@ -87,13 +85,12 @@ public class ExplorerDirPage extends ExplorerFileItem implements ExplorerPage {
|
||||
return mChildren.iterator();
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@Override
|
||||
public void forEach(Consumer<? super ExplorerItem> action) {
|
||||
public void forEach(@NonNull Consumer<? super ExplorerItem> action) {
|
||||
mChildren.forEach(action);
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.N)
|
||||
@NonNull
|
||||
@Override
|
||||
public Spliterator<ExplorerItem> spliterator() {
|
||||
return mChildren.spliterator();
|
||||
|
||||
@@ -2,6 +2,8 @@ package org.autojs.autojs.model.explorer;
|
||||
|
||||
import com.stardust.pio.PFile;
|
||||
|
||||
import com.stardust.autojs.core.pref.Pref;
|
||||
|
||||
import java.io.FileFilter;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
@@ -40,13 +42,14 @@ public class ExplorerFileProvider implements ExplorerProvider {
|
||||
}
|
||||
|
||||
protected Observable<PFile> listFiles(PFile directory) {
|
||||
boolean isShowHidden = Pref.INSTANCE.isHiddenFilesShow();
|
||||
return Observable.just(directory)
|
||||
.flatMap(dir -> {
|
||||
PFile[] files;
|
||||
if (mFileFilter == null) {
|
||||
files = dir.listFiles();
|
||||
files = dir.listFiles(isShowHidden);
|
||||
} else {
|
||||
files = dir.listFiles(mFileFilter);
|
||||
files = dir.listFiles(mFileFilter, isShowHidden);
|
||||
}
|
||||
if (files == null) {
|
||||
return Observable.empty();
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package org.autojs.autojs.model.explorer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
|
||||
public interface ExplorerPage extends ExplorerItem, Iterable<ExplorerItem> {
|
||||
|
||||
void copyChildren(ExplorerPage page);
|
||||
|
||||
@@ -7,7 +7,7 @@ import java.io.File;
|
||||
|
||||
public class ExplorerProjectPage extends ExplorerDirPage {
|
||||
|
||||
private ProjectConfig mProjectConfig;
|
||||
private final ProjectConfig mProjectConfig;
|
||||
|
||||
public ExplorerProjectPage(PFile file, ExplorerPage parent, ProjectConfig projectConfig) {
|
||||
super(file, parent);
|
||||
|
||||
@@ -12,7 +12,7 @@ public class ExplorerSorter {
|
||||
|
||||
public static final Comparator<ExplorerItem> NAME = (o1, o2) -> collator.compare(o2.getName(), o1.getName());
|
||||
|
||||
public static final Comparator<ExplorerItem> DATE = (o1, o2) -> Long.compare(o1.lastModified(), o2.lastModified());
|
||||
public static final Comparator<ExplorerItem> DATE = Comparator.comparingLong(ExplorerItem::lastModified);
|
||||
|
||||
public static final Comparator<ExplorerItem> TYPE = (o1, o2) -> o2.getType().compareTo(o1.getType());
|
||||
|
||||
@@ -32,9 +32,9 @@ public class ExplorerSorter {
|
||||
|
||||
public static void sort(List<? extends ExplorerItem> items, final Comparator<ExplorerItem> comparator, boolean ascending) {
|
||||
if (ascending) {
|
||||
Collections.sort(items, comparator);
|
||||
items.sort(comparator);
|
||||
} else {
|
||||
Collections.sort(items, (Comparator<ExplorerItem>) (o1, o2) -> comparator.compare(o2, o1));
|
||||
items.sort((Comparator<ExplorerItem>) (o1, o2) -> comparator.compare(o2, o1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,12 @@ package org.autojs.autojs.model.explorer;
|
||||
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public class Explorers {
|
||||
|
||||
|
||||
private static Explorer sWorkspaceExplorer = new Explorer(Providers.workspace(), 20);
|
||||
private static final Explorer sWorkspaceExplorer = new Explorer(Providers.workspace(), 20);
|
||||
|
||||
private static Explorer sExternalExplorer = new Explorer(new ExplorerFileProvider(), 10);
|
||||
private static final Explorer sExternalExplorer = new Explorer(new ExplorerFileProvider(), 10);
|
||||
|
||||
public static Explorer workspace() {
|
||||
return sWorkspaceExplorer;
|
||||
@@ -20,7 +18,7 @@ public class Explorers {
|
||||
}
|
||||
|
||||
public static class Providers {
|
||||
private static WorkspaceFileProvider sWorkspaceFileProvider = new WorkspaceFileProvider(GlobalAppContext.get(), null);
|
||||
private static final WorkspaceFileProvider sWorkspaceFileProvider = new WorkspaceFileProvider(GlobalAppContext.get(), null);
|
||||
|
||||
public static WorkspaceFileProvider workspace() {
|
||||
return sWorkspaceFileProvider;
|
||||
|
||||
@@ -41,12 +41,12 @@ public class AndroidClassIndices {
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
private static AndroidClassIndices sInstance;
|
||||
|
||||
private static Type ANDROID_CLASS_LIST_TYPE = new TypeToken<List<AndroidClass>>() {
|
||||
private static final Type ANDROID_CLASS_LIST_TYPE = new TypeToken<List<AndroidClass>>() {
|
||||
}.getType();
|
||||
//packageName -> package classes
|
||||
private LinkedHashMap<String, ArrayList<ClassSearchingItem>> mPackages = new LinkedHashMap<>();
|
||||
private Context mContext;
|
||||
private ExecutorService mSingleThreadExecutor = new ThreadPoolExecutor(1, 1,
|
||||
// packageName -> package classes
|
||||
private final LinkedHashMap<String, ArrayList<ClassSearchingItem>> mPackages = new LinkedHashMap<>();
|
||||
private final Context mContext;
|
||||
private final ExecutorService mSingleThreadExecutor = new ThreadPoolExecutor(1, 1,
|
||||
2, TimeUnit.MINUTES, new LinkedBlockingQueue<>());
|
||||
private Throwable mLoadThrowable;
|
||||
|
||||
@@ -109,14 +109,10 @@ public class AndroidClassIndices {
|
||||
|
||||
|
||||
private void load(Reader reader) throws IOException {
|
||||
try {
|
||||
try (reader) {
|
||||
Gson gson = new Gson();
|
||||
ArrayList<AndroidClass> classes = gson.fromJson(reader, ANDROID_CLASS_LIST_TYPE);
|
||||
load(classes);
|
||||
} catch (RuntimeException e) {
|
||||
throw e;
|
||||
} finally {
|
||||
reader.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@ public abstract class ClassSearchingItem implements Comparable<ClassSearchingIte
|
||||
return 1;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ClassSearchingItem{" + getLabel() + "}";
|
||||
|
||||
@@ -8,7 +8,6 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Stardust on 2017/12/9.
|
||||
*/
|
||||
|
||||
public class Module {
|
||||
|
||||
@SerializedName("properties")
|
||||
|
||||
@@ -9,24 +9,21 @@ import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/12/9.
|
||||
*/
|
||||
|
||||
public class Modules {
|
||||
|
||||
private static final Type MODULE_LIST_TYPE = new TypeToken<List<Module>>() {
|
||||
|
||||
}.getType();
|
||||
private static final String MODULES_JSON_PATH = "indices/all.json";
|
||||
private static Modules sInstance = new Modules();
|
||||
private static final Modules sInstance = new Modules();
|
||||
|
||||
private List<Module> mModules;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.google.gson.annotations.SerializedName;
|
||||
/**
|
||||
* Created by Stardust on 2017/12/9.
|
||||
*/
|
||||
|
||||
public class Property {
|
||||
|
||||
@SerializedName("url")
|
||||
|
||||
@@ -19,11 +19,10 @@ import java.io.Reader;
|
||||
/**
|
||||
* Created by Stardust on 2017/10/28.
|
||||
*/
|
||||
|
||||
public class SampleFile extends ScriptFile {
|
||||
|
||||
private long mLength;
|
||||
private AssetManager mAssetManager;
|
||||
private final AssetManager mAssetManager;
|
||||
|
||||
public SampleFile(@NonNull String pathname, AssetManager assetManager) {
|
||||
super(pathname);
|
||||
|
||||
@@ -1,30 +1,31 @@
|
||||
package org.autojs.autojs.model.script;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static android.Manifest.permission.READ_EXTERNAL_STORAGE;
|
||||
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.text.TextUtils;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/4/1.
|
||||
*/
|
||||
|
||||
public class PathChecker {
|
||||
public static final int CHECK_RESULT_OK = 0;
|
||||
|
||||
private Context mContext;
|
||||
private final Context mContext;
|
||||
|
||||
public PathChecker(Context context) {
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
|
||||
public static int check(final String path) {
|
||||
if (TextUtils.isEmpty(path))
|
||||
return com.stardust.autojs.R.string.text_path_is_empty;
|
||||
@@ -36,7 +37,7 @@ public class PathChecker {
|
||||
public boolean checkAndToastError(String path) {
|
||||
int result = checkWithStoragePermission(path);
|
||||
if (result != CHECK_RESULT_OK) {
|
||||
Toast.makeText(mContext, mContext.getString(result) + ":" + path, Toast.LENGTH_SHORT).show();
|
||||
GlobalAppContext.toast(mContext.getString(result) + ": " + path, Toast.LENGTH_SHORT);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -50,8 +51,10 @@ public class PathChecker {
|
||||
}
|
||||
|
||||
private static boolean hasStorageReadPermission(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
return Environment.isExternalStorageManager();
|
||||
}
|
||||
return activity.checkSelfPermission(READ_EXTERNAL_STORAGE) == PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package org.autojs.autojs.model.script;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.stardust.autojs.script.AutoFileSource;
|
||||
import com.stardust.autojs.script.JavaScriptFileSource;
|
||||
import com.stardust.autojs.script.ScriptSource;
|
||||
@@ -12,7 +10,6 @@ import java.io.File;
|
||||
/**
|
||||
* Created by Stardust on 2017/1/23.
|
||||
*/
|
||||
|
||||
public class ScriptFile extends PFile {
|
||||
|
||||
public static final int TYPE_UNKNOWN = 0;
|
||||
|
||||
@@ -13,7 +13,7 @@ import com.stardust.autojs.runtime.exception.ScriptInterruptedException
|
||||
import com.stardust.autojs.script.ScriptSource
|
||||
import com.stardust.util.IntentUtil
|
||||
import org.autojs.autojs.Pref
|
||||
import org.autojs.autojs.R
|
||||
import org.autojs.autojs6.R
|
||||
import org.autojs.autojs.autojs.AutoJs
|
||||
import org.autojs.autojs.external.ScriptIntents
|
||||
import org.autojs.autojs.external.fileprovider.AppFileProvider
|
||||
@@ -27,7 +27,6 @@ import java.io.FileFilter
|
||||
/**
|
||||
* Created by Stardust on 2017/5/3.
|
||||
*/
|
||||
|
||||
object Scripts {
|
||||
|
||||
const val ACTION_ON_EXECUTION_FINISHED = "ACTION_ON_EXECUTION_FINISHED"
|
||||
|
||||
@@ -4,9 +4,7 @@ import androidx.annotation.NonNull;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs.network.api.UpdateCheckApi;
|
||||
import org.autojs.autojs.network.entity.VersionInfo;
|
||||
|
||||
@@ -19,7 +17,6 @@ import retrofit2.converter.gson.GsonConverterFactory;
|
||||
* Created by Stardust on 2017/9/20.
|
||||
* Modified by SuperMonster003 as of Feb 26, 2022.
|
||||
*/
|
||||
|
||||
public class VersionService {
|
||||
|
||||
private static final String baseUrl = "https://raw.githubusercontent.com/";
|
||||
|
||||
@@ -9,7 +9,6 @@ import retrofit2.http.Url;
|
||||
/**
|
||||
* Created by Stardust on 2017/12/6.
|
||||
*/
|
||||
|
||||
public interface DownloadApi {
|
||||
|
||||
@GET
|
||||
|
||||
@@ -10,7 +10,6 @@ import retrofit2.http.Headers;
|
||||
* Created by Stardust on 2017/9/20.
|
||||
* Modified by SuperMonster003 as of Feb 28, 2022.
|
||||
*/
|
||||
|
||||
public interface UpdateCheckApi {
|
||||
|
||||
@GET("/SuperMonster003/AutoJs6/master/project-versions.json")
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
package org.autojs.autojs.network.download;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/10/20.
|
||||
*/
|
||||
|
||||
public class DownloadFailedException extends Throwable {
|
||||
private final String mUrl;
|
||||
private final String mPath;
|
||||
@@ -13,6 +14,7 @@ public class DownloadFailedException extends Throwable {
|
||||
mPath = path;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DownloadFailedException{" +
|
||||
|
||||
@@ -11,7 +11,7 @@ import com.jakewharton.retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
|
||||
import com.stardust.concurrent.VolatileBox;
|
||||
import com.stardust.pio.PFiles;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.network.api.DownloadApi;
|
||||
import org.autojs.autojs.tool.SimpleObserver;
|
||||
|
||||
@@ -36,7 +36,6 @@ import retrofit2.Retrofit;
|
||||
/**
|
||||
* Created by Stardust on 2017/10/20.
|
||||
*/
|
||||
|
||||
public class DownloadManager {
|
||||
|
||||
private static final String LOG_TAG = "DownloadManager";
|
||||
|
||||
@@ -2,12 +2,11 @@ package org.autojs.autojs.network.entity;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import org.autojs.autojs.BuildConfig;
|
||||
import org.autojs.autojs6.BuildConfig;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/9/20.
|
||||
*/
|
||||
|
||||
public class VersionInfo {
|
||||
|
||||
public int appVersionCode;
|
||||
|
||||
@@ -1,617 +0,0 @@
|
||||
package org.autojs.autojs.network.entity.config;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Config{
|
||||
|
||||
|
||||
@SerializedName("socketioTransports")
|
||||
private List<String> socketioTransports;
|
||||
|
||||
@SerializedName("allowGuestSearching")
|
||||
private boolean allowGuestSearching;
|
||||
|
||||
@SerializedName("hasImageUploadPlugin")
|
||||
private boolean hasImageUploadPlugin;
|
||||
|
||||
@SerializedName("showSiteTitle")
|
||||
private boolean showSiteTitle;
|
||||
|
||||
@SerializedName("websocketAddress")
|
||||
private String websocketAddress;
|
||||
|
||||
@SerializedName("maximumFileSize")
|
||||
private String maximumFileSize;
|
||||
|
||||
@SerializedName("usePagination")
|
||||
private boolean usePagination;
|
||||
|
||||
@SerializedName("minimumPostLength")
|
||||
private String minimumPostLength;
|
||||
|
||||
@SerializedName("allowGuestUserSearching")
|
||||
private boolean allowGuestUserSearching;
|
||||
|
||||
@SerializedName("allowTopicsThumbnail")
|
||||
private boolean allowTopicsThumbnail;
|
||||
|
||||
@SerializedName("allowGuestHandles")
|
||||
private boolean allowGuestHandles;
|
||||
|
||||
@SerializedName("disableChatMessageEditing")
|
||||
private boolean disableChatMessageEditing;
|
||||
|
||||
@SerializedName("version")
|
||||
private String version;
|
||||
|
||||
@SerializedName("minimumTitleLength")
|
||||
private String minimumTitleLength;
|
||||
|
||||
@SerializedName("maximumTagsPerTopic")
|
||||
private int maximumTagsPerTopic;
|
||||
|
||||
@SerializedName("topicPostSort")
|
||||
private String topicPostSort;
|
||||
|
||||
@SerializedName("defaultBootswatchSkin")
|
||||
private String defaultBootswatchSkin;
|
||||
|
||||
@SerializedName("allowFileUploads")
|
||||
private boolean allowFileUploads;
|
||||
|
||||
@SerializedName("maximumPostLength")
|
||||
private String maximumPostLength;
|
||||
|
||||
@SerializedName("loggedIn")
|
||||
private boolean loggedIn;
|
||||
|
||||
@SerializedName("postsPerPage")
|
||||
private String postsPerPage;
|
||||
|
||||
|
||||
@SerializedName("relative_path")
|
||||
private String relativePath;
|
||||
|
||||
@SerializedName("requireEmailConfirmation")
|
||||
private boolean requireEmailConfirmation;
|
||||
|
||||
@SerializedName("defaultLang")
|
||||
private String defaultLang;
|
||||
|
||||
@SerializedName("disableChat")
|
||||
private boolean disableChat;
|
||||
|
||||
@SerializedName("userLang")
|
||||
private String userLang;
|
||||
|
||||
@SerializedName("maxReconnectionAttempts")
|
||||
private int maxReconnectionAttempts;
|
||||
|
||||
@SerializedName("timeagoCutoff")
|
||||
private String timeagoCutoff;
|
||||
|
||||
@SerializedName("browserTitle")
|
||||
private String browserTitle;
|
||||
|
||||
@SerializedName("siteTitle")
|
||||
private String siteTitle;
|
||||
|
||||
@SerializedName("csrf_token")
|
||||
private String csrfToken;
|
||||
|
||||
@SerializedName("categoryTopicSort")
|
||||
private String categoryTopicSort;
|
||||
|
||||
@SerializedName("disableMasonry")
|
||||
private boolean disableMasonry;
|
||||
|
||||
@SerializedName("theme:src")
|
||||
private String themeSrc;
|
||||
|
||||
@SerializedName("cookies")
|
||||
private Cookies cookies;
|
||||
|
||||
@SerializedName("markdown")
|
||||
private Markdown markdown;
|
||||
|
||||
@SerializedName("minimumTagLength")
|
||||
private String minimumTagLength;
|
||||
|
||||
@SerializedName("maximumTagLength")
|
||||
private String maximumTagLength;
|
||||
|
||||
@SerializedName("maximumTitleLength")
|
||||
private String maximumTitleLength;
|
||||
|
||||
@SerializedName("topicsPerPage")
|
||||
private String topicsPerPage;
|
||||
|
||||
@SerializedName("useOutgoingLinksPage")
|
||||
private boolean useOutgoingLinksPage;
|
||||
|
||||
@SerializedName("bootswatchSkin")
|
||||
private String bootswatchSkin;
|
||||
|
||||
@SerializedName("minimumTagsPerTopic")
|
||||
private int minimumTagsPerTopic;
|
||||
|
||||
@SerializedName("delayImageLoading")
|
||||
private boolean delayImageLoading;
|
||||
|
||||
@SerializedName("cache-buster")
|
||||
private String cacheBuster;
|
||||
|
||||
@SerializedName("titleLayout")
|
||||
private String titleLayout;
|
||||
|
||||
@SerializedName("theme:id")
|
||||
private String themeId;
|
||||
|
||||
@SerializedName("topicSearchEnabled")
|
||||
private boolean topicSearchEnabled;
|
||||
|
||||
@SerializedName("searchEnabled")
|
||||
private boolean searchEnabled;
|
||||
|
||||
@SerializedName("reconnectionDelay")
|
||||
private int reconnectionDelay;
|
||||
|
||||
|
||||
public void setSocketioTransports(List<String> socketioTransports){
|
||||
this.socketioTransports = socketioTransports;
|
||||
}
|
||||
|
||||
public List<String> getSocketioTransports(){
|
||||
return socketioTransports;
|
||||
}
|
||||
|
||||
public void setAllowGuestSearching(boolean allowGuestSearching){
|
||||
this.allowGuestSearching = allowGuestSearching;
|
||||
}
|
||||
|
||||
public boolean isAllowGuestSearching(){
|
||||
return allowGuestSearching;
|
||||
}
|
||||
|
||||
public void setHasImageUploadPlugin(boolean hasImageUploadPlugin){
|
||||
this.hasImageUploadPlugin = hasImageUploadPlugin;
|
||||
}
|
||||
|
||||
public boolean isHasImageUploadPlugin(){
|
||||
return hasImageUploadPlugin;
|
||||
}
|
||||
|
||||
public void setShowSiteTitle(boolean showSiteTitle){
|
||||
this.showSiteTitle = showSiteTitle;
|
||||
}
|
||||
|
||||
public boolean isShowSiteTitle(){
|
||||
return showSiteTitle;
|
||||
}
|
||||
|
||||
public void setWebsocketAddress(String websocketAddress){
|
||||
this.websocketAddress = websocketAddress;
|
||||
}
|
||||
|
||||
public String getWebsocketAddress(){
|
||||
return websocketAddress;
|
||||
}
|
||||
|
||||
public void setMaximumFileSize(String maximumFileSize){
|
||||
this.maximumFileSize = maximumFileSize;
|
||||
}
|
||||
|
||||
public String getMaximumFileSize(){
|
||||
return maximumFileSize;
|
||||
}
|
||||
|
||||
public void setUsePagination(boolean usePagination){
|
||||
this.usePagination = usePagination;
|
||||
}
|
||||
|
||||
public boolean isUsePagination(){
|
||||
return usePagination;
|
||||
}
|
||||
|
||||
public void setMinimumPostLength(String minimumPostLength){
|
||||
this.minimumPostLength = minimumPostLength;
|
||||
}
|
||||
|
||||
public String getMinimumPostLength(){
|
||||
return minimumPostLength;
|
||||
}
|
||||
|
||||
public void setAllowGuestUserSearching(boolean allowGuestUserSearching){
|
||||
this.allowGuestUserSearching = allowGuestUserSearching;
|
||||
}
|
||||
|
||||
public boolean isAllowGuestUserSearching(){
|
||||
return allowGuestUserSearching;
|
||||
}
|
||||
|
||||
public void setAllowTopicsThumbnail(boolean allowTopicsThumbnail){
|
||||
this.allowTopicsThumbnail = allowTopicsThumbnail;
|
||||
}
|
||||
|
||||
public boolean isAllowTopicsThumbnail(){
|
||||
return allowTopicsThumbnail;
|
||||
}
|
||||
|
||||
public void setAllowGuestHandles(boolean allowGuestHandles){
|
||||
this.allowGuestHandles = allowGuestHandles;
|
||||
}
|
||||
|
||||
public boolean isAllowGuestHandles(){
|
||||
return allowGuestHandles;
|
||||
}
|
||||
|
||||
public void setDisableChatMessageEditing(boolean disableChatMessageEditing){
|
||||
this.disableChatMessageEditing = disableChatMessageEditing;
|
||||
}
|
||||
|
||||
public boolean isDisableChatMessageEditing(){
|
||||
return disableChatMessageEditing;
|
||||
}
|
||||
|
||||
public void setVersion(String version){
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
public String getVersion(){
|
||||
return version;
|
||||
}
|
||||
|
||||
public void setMinimumTitleLength(String minimumTitleLength){
|
||||
this.minimumTitleLength = minimumTitleLength;
|
||||
}
|
||||
|
||||
public String getMinimumTitleLength(){
|
||||
return minimumTitleLength;
|
||||
}
|
||||
|
||||
public void setMaximumTagsPerTopic(int maximumTagsPerTopic){
|
||||
this.maximumTagsPerTopic = maximumTagsPerTopic;
|
||||
}
|
||||
|
||||
public int getMaximumTagsPerTopic(){
|
||||
return maximumTagsPerTopic;
|
||||
}
|
||||
|
||||
public void setTopicPostSort(String topicPostSort){
|
||||
this.topicPostSort = topicPostSort;
|
||||
}
|
||||
|
||||
public String getTopicPostSort(){
|
||||
return topicPostSort;
|
||||
}
|
||||
|
||||
public void setDefaultBootswatchSkin(String defaultBootswatchSkin){
|
||||
this.defaultBootswatchSkin = defaultBootswatchSkin;
|
||||
}
|
||||
|
||||
public String getDefaultBootswatchSkin(){
|
||||
return defaultBootswatchSkin;
|
||||
}
|
||||
|
||||
public void setAllowFileUploads(boolean allowFileUploads){
|
||||
this.allowFileUploads = allowFileUploads;
|
||||
}
|
||||
|
||||
public boolean isAllowFileUploads(){
|
||||
return allowFileUploads;
|
||||
}
|
||||
|
||||
public void setMaximumPostLength(String maximumPostLength){
|
||||
this.maximumPostLength = maximumPostLength;
|
||||
}
|
||||
|
||||
public String getMaximumPostLength(){
|
||||
return maximumPostLength;
|
||||
}
|
||||
|
||||
public void setLoggedIn(boolean loggedIn){
|
||||
this.loggedIn = loggedIn;
|
||||
}
|
||||
|
||||
public boolean isLoggedIn(){
|
||||
return loggedIn;
|
||||
}
|
||||
|
||||
public void setPostsPerPage(String postsPerPage){
|
||||
this.postsPerPage = postsPerPage;
|
||||
}
|
||||
|
||||
public String getPostsPerPage(){
|
||||
return postsPerPage;
|
||||
}
|
||||
|
||||
public void setRelativePath(String relativePath){
|
||||
this.relativePath = relativePath;
|
||||
}
|
||||
|
||||
public String getRelativePath(){
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
public void setRequireEmailConfirmation(boolean requireEmailConfirmation){
|
||||
this.requireEmailConfirmation = requireEmailConfirmation;
|
||||
}
|
||||
|
||||
public boolean isRequireEmailConfirmation(){
|
||||
return requireEmailConfirmation;
|
||||
}
|
||||
|
||||
public void setDefaultLang(String defaultLang){
|
||||
this.defaultLang = defaultLang;
|
||||
}
|
||||
|
||||
public String getDefaultLang(){
|
||||
return defaultLang;
|
||||
}
|
||||
|
||||
public void setDisableChat(boolean disableChat){
|
||||
this.disableChat = disableChat;
|
||||
}
|
||||
|
||||
public boolean isDisableChat(){
|
||||
return disableChat;
|
||||
}
|
||||
|
||||
public void setUserLang(String userLang){
|
||||
this.userLang = userLang;
|
||||
}
|
||||
|
||||
public String getUserLang(){
|
||||
return userLang;
|
||||
}
|
||||
|
||||
public void setMaxReconnectionAttempts(int maxReconnectionAttempts){
|
||||
this.maxReconnectionAttempts = maxReconnectionAttempts;
|
||||
}
|
||||
|
||||
public int getMaxReconnectionAttempts(){
|
||||
return maxReconnectionAttempts;
|
||||
}
|
||||
|
||||
public void setTimeagoCutoff(String timeagoCutoff){
|
||||
this.timeagoCutoff = timeagoCutoff;
|
||||
}
|
||||
|
||||
public String getTimeagoCutoff(){
|
||||
return timeagoCutoff;
|
||||
}
|
||||
|
||||
public void setBrowserTitle(String browserTitle){
|
||||
this.browserTitle = browserTitle;
|
||||
}
|
||||
|
||||
public String getBrowserTitle(){
|
||||
return browserTitle;
|
||||
}
|
||||
|
||||
public void setSiteTitle(String siteTitle){
|
||||
this.siteTitle = siteTitle;
|
||||
}
|
||||
|
||||
public String getSiteTitle(){
|
||||
return siteTitle;
|
||||
}
|
||||
|
||||
public void setCsrfToken(String csrfToken){
|
||||
this.csrfToken = csrfToken;
|
||||
}
|
||||
|
||||
public String getCsrfToken(){
|
||||
return csrfToken;
|
||||
}
|
||||
|
||||
public void setCategoryTopicSort(String categoryTopicSort){
|
||||
this.categoryTopicSort = categoryTopicSort;
|
||||
}
|
||||
|
||||
public String getCategoryTopicSort(){
|
||||
return categoryTopicSort;
|
||||
}
|
||||
|
||||
public void setDisableMasonry(boolean disableMasonry){
|
||||
this.disableMasonry = disableMasonry;
|
||||
}
|
||||
|
||||
public boolean isDisableMasonry(){
|
||||
return disableMasonry;
|
||||
}
|
||||
|
||||
public void setThemeSrc(String themeSrc){
|
||||
this.themeSrc = themeSrc;
|
||||
}
|
||||
|
||||
public String getThemeSrc(){
|
||||
return themeSrc;
|
||||
}
|
||||
|
||||
public void setCookies(Cookies cookies){
|
||||
this.cookies = cookies;
|
||||
}
|
||||
|
||||
public Cookies getCookies(){
|
||||
return cookies;
|
||||
}
|
||||
|
||||
public void setMarkdown(Markdown markdown){
|
||||
this.markdown = markdown;
|
||||
}
|
||||
|
||||
public Markdown getMarkdown(){
|
||||
return markdown;
|
||||
}
|
||||
|
||||
public void setMinimumTagLength(String minimumTagLength){
|
||||
this.minimumTagLength = minimumTagLength;
|
||||
}
|
||||
|
||||
public String getMinimumTagLength(){
|
||||
return minimumTagLength;
|
||||
}
|
||||
|
||||
public void setMaximumTagLength(String maximumTagLength){
|
||||
this.maximumTagLength = maximumTagLength;
|
||||
}
|
||||
|
||||
public String getMaximumTagLength(){
|
||||
return maximumTagLength;
|
||||
}
|
||||
|
||||
public void setMaximumTitleLength(String maximumTitleLength){
|
||||
this.maximumTitleLength = maximumTitleLength;
|
||||
}
|
||||
|
||||
public String getMaximumTitleLength(){
|
||||
return maximumTitleLength;
|
||||
}
|
||||
|
||||
public void setTopicsPerPage(String topicsPerPage){
|
||||
this.topicsPerPage = topicsPerPage;
|
||||
}
|
||||
|
||||
public String getTopicsPerPage(){
|
||||
return topicsPerPage;
|
||||
}
|
||||
|
||||
public void setUseOutgoingLinksPage(boolean useOutgoingLinksPage){
|
||||
this.useOutgoingLinksPage = useOutgoingLinksPage;
|
||||
}
|
||||
|
||||
public boolean isUseOutgoingLinksPage(){
|
||||
return useOutgoingLinksPage;
|
||||
}
|
||||
|
||||
public void setBootswatchSkin(String bootswatchSkin){
|
||||
this.bootswatchSkin = bootswatchSkin;
|
||||
}
|
||||
|
||||
public String getBootswatchSkin(){
|
||||
return bootswatchSkin;
|
||||
}
|
||||
|
||||
public void setMinimumTagsPerTopic(int minimumTagsPerTopic){
|
||||
this.minimumTagsPerTopic = minimumTagsPerTopic;
|
||||
}
|
||||
|
||||
public int getMinimumTagsPerTopic(){
|
||||
return minimumTagsPerTopic;
|
||||
}
|
||||
|
||||
public void setDelayImageLoading(boolean delayImageLoading){
|
||||
this.delayImageLoading = delayImageLoading;
|
||||
}
|
||||
|
||||
public boolean isDelayImageLoading(){
|
||||
return delayImageLoading;
|
||||
}
|
||||
|
||||
public void setCacheBuster(String cacheBuster){
|
||||
this.cacheBuster = cacheBuster;
|
||||
}
|
||||
|
||||
public String getCacheBuster(){
|
||||
return cacheBuster;
|
||||
}
|
||||
|
||||
public void setTitleLayout(String titleLayout){
|
||||
this.titleLayout = titleLayout;
|
||||
}
|
||||
|
||||
public String getTitleLayout(){
|
||||
return titleLayout;
|
||||
}
|
||||
|
||||
public void setThemeId(String themeId){
|
||||
this.themeId = themeId;
|
||||
}
|
||||
|
||||
public String getThemeId(){
|
||||
return themeId;
|
||||
}
|
||||
|
||||
public void setTopicSearchEnabled(boolean topicSearchEnabled){
|
||||
this.topicSearchEnabled = topicSearchEnabled;
|
||||
}
|
||||
|
||||
public boolean isTopicSearchEnabled(){
|
||||
return topicSearchEnabled;
|
||||
}
|
||||
|
||||
public void setSearchEnabled(boolean searchEnabled){
|
||||
this.searchEnabled = searchEnabled;
|
||||
}
|
||||
|
||||
public boolean isSearchEnabled(){
|
||||
return searchEnabled;
|
||||
}
|
||||
|
||||
public void setReconnectionDelay(int reconnectionDelay){
|
||||
this.reconnectionDelay = reconnectionDelay;
|
||||
}
|
||||
|
||||
public int getReconnectionDelay(){
|
||||
return reconnectionDelay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return
|
||||
"Config{" +
|
||||
",socketioTransports = '" + socketioTransports + '\'' +
|
||||
",allowGuestSearching = '" + allowGuestSearching + '\'' +
|
||||
",hasImageUploadPlugin = '" + hasImageUploadPlugin + '\'' +
|
||||
",showSiteTitle = '" + showSiteTitle + '\'' +
|
||||
",websocketAddress = '" + websocketAddress + '\'' +
|
||||
",maximumFileSize = '" + maximumFileSize + '\'' +
|
||||
",usePagination = '" + usePagination + '\'' +
|
||||
",minimumPostLength = '" + minimumPostLength + '\'' +
|
||||
",allowGuestUserSearching = '" + allowGuestUserSearching + '\'' +
|
||||
",allowTopicsThumbnail = '" + allowTopicsThumbnail + '\'' +
|
||||
",allowGuestHandles = '" + allowGuestHandles + '\'' +
|
||||
",disableChatMessageEditing = '" + disableChatMessageEditing + '\'' +
|
||||
",version = '" + version + '\'' +
|
||||
",minimumTitleLength = '" + minimumTitleLength + '\'' +
|
||||
",maximumTagsPerTopic = '" + maximumTagsPerTopic + '\'' +
|
||||
",topicPostSort = '" + topicPostSort + '\'' +
|
||||
",defaultBootswatchSkin = '" + defaultBootswatchSkin + '\'' +
|
||||
",allowFileUploads = '" + allowFileUploads + '\'' +
|
||||
",maximumPostLength = '" + maximumPostLength + '\'' +
|
||||
",loggedIn = '" + loggedIn + '\'' +
|
||||
",postsPerPage = '" + postsPerPage + '\'' +
|
||||
",relative_path = '" + relativePath + '\'' +
|
||||
",requireEmailConfirmation = '" + requireEmailConfirmation + '\'' +
|
||||
",defaultLang = '" + defaultLang + '\'' +
|
||||
",disableChat = '" + disableChat + '\'' +
|
||||
",userLang = '" + userLang + '\'' +
|
||||
",maxReconnectionAttempts = '" + maxReconnectionAttempts + '\'' +
|
||||
",timeagoCutoff = '" + timeagoCutoff + '\'' +
|
||||
",browserTitle = '" + browserTitle + '\'' +
|
||||
",siteTitle = '" + siteTitle + '\'' +
|
||||
",csrf_token = '" + csrfToken + '\'' +
|
||||
",categoryTopicSort = '" + categoryTopicSort + '\'' +
|
||||
",disableMasonry = '" + disableMasonry + '\'' +
|
||||
",theme:src = '" + themeSrc + '\'' +
|
||||
",cookies = '" + cookies + '\'' +
|
||||
",markdown = '" + markdown + '\'' +
|
||||
",minimumTagLength = '" + minimumTagLength + '\'' +
|
||||
",maximumTagLength = '" + maximumTagLength + '\'' +
|
||||
",maximumTitleLength = '" + maximumTitleLength + '\'' +
|
||||
",topicsPerPage = '" + topicsPerPage + '\'' +
|
||||
",useOutgoingLinksPage = '" + useOutgoingLinksPage + '\'' +
|
||||
",bootswatchSkin = '" + bootswatchSkin + '\'' +
|
||||
",minimumTagsPerTopic = '" + minimumTagsPerTopic + '\'' +
|
||||
",delayImageLoading = '" + delayImageLoading + '\'' +
|
||||
",cache-buster = '" + cacheBuster + '\'' +
|
||||
",titleLayout = '" + titleLayout + '\'' +
|
||||
",theme:id = '" + themeId + '\'' +
|
||||
",topicSearchEnabled = '" + topicSearchEnabled + '\'' +
|
||||
",searchEnabled = '" + searchEnabled + '\'' +
|
||||
",reconnectionDelay = '" + reconnectionDelay + '\'' +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
package org.autojs.autojs.network.entity.config;
|
||||
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Cookies {
|
||||
|
||||
@SerializedName("link")
|
||||
private String link;
|
||||
|
||||
@SerializedName("dismiss")
|
||||
private String dismiss;
|
||||
|
||||
@SerializedName("message")
|
||||
private String message;
|
||||
|
||||
@SerializedName("enabled")
|
||||
private boolean enabled;
|
||||
|
||||
public void setLink(String link) {
|
||||
this.link = link;
|
||||
}
|
||||
|
||||
public String getLink() {
|
||||
return link;
|
||||
}
|
||||
|
||||
public void setDismiss(String dismiss) {
|
||||
this.dismiss = dismiss;
|
||||
}
|
||||
|
||||
public String getDismiss() {
|
||||
return dismiss;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return enabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return
|
||||
"Cookies{" +
|
||||
"link = '" + link + '\'' +
|
||||
",dismiss = '" + dismiss + '\'' +
|
||||
",message = '" + message + '\'' +
|
||||
",enabled = '" + enabled + '\'' +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
package org.autojs.autojs.network.entity.config;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class Markdown{
|
||||
|
||||
@SerializedName("highlight")
|
||||
private int highlight;
|
||||
|
||||
@SerializedName("theme")
|
||||
private String theme;
|
||||
|
||||
public void setHighlight(int highlight){
|
||||
this.highlight = highlight;
|
||||
}
|
||||
|
||||
public int getHighlight(){
|
||||
return highlight;
|
||||
}
|
||||
|
||||
public void setTheme(String theme){
|
||||
this.theme = theme;
|
||||
}
|
||||
|
||||
public String getTheme(){
|
||||
return theme;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return
|
||||
"Markdown{" +
|
||||
"highlight = '" + highlight + '\'' +
|
||||
",theme = '" + theme + '\'' +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
package org.autojs.autojs.network.entity.notification;
|
||||
|
||||
import org.autojs.autojs.network.entity.user.User;
|
||||
|
||||
public class Notification {
|
||||
|
||||
private boolean read;
|
||||
private String mergeId;
|
||||
private String importance;
|
||||
private String nid;
|
||||
private String type;
|
||||
private String path;
|
||||
private String readClass;
|
||||
private String datetime;
|
||||
private String from;
|
||||
private String bodyShort;
|
||||
private String datetimeISO;
|
||||
private User user;
|
||||
|
||||
public void setRead(boolean read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public boolean isRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setMergeId(String mergeId) {
|
||||
this.mergeId = mergeId;
|
||||
}
|
||||
|
||||
public String getMergeId() {
|
||||
return mergeId;
|
||||
}
|
||||
|
||||
public void setImportance(String importance) {
|
||||
this.importance = importance;
|
||||
}
|
||||
|
||||
public String getImportance() {
|
||||
return importance;
|
||||
}
|
||||
|
||||
public void setNid(String nid) {
|
||||
this.nid = nid;
|
||||
}
|
||||
|
||||
public String getNid() {
|
||||
return nid;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setReadClass(String readClass) {
|
||||
this.readClass = readClass;
|
||||
}
|
||||
|
||||
public String getReadClass() {
|
||||
return readClass;
|
||||
}
|
||||
|
||||
public void setDatetime(String datetime) {
|
||||
this.datetime = datetime;
|
||||
}
|
||||
|
||||
public String getDatetime() {
|
||||
return datetime;
|
||||
}
|
||||
|
||||
public void setFrom(String from) {
|
||||
this.from = from;
|
||||
}
|
||||
|
||||
public String getFrom() {
|
||||
return from;
|
||||
}
|
||||
|
||||
public void setBodyShort(String bodyShort) {
|
||||
this.bodyShort = bodyShort;
|
||||
}
|
||||
|
||||
public String getBodyShort() {
|
||||
return bodyShort;
|
||||
}
|
||||
|
||||
public void setDatetimeISO(String datetimeISO) {
|
||||
this.datetimeISO = datetimeISO;
|
||||
}
|
||||
|
||||
public String getDatetimeISO() {
|
||||
return datetimeISO;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return
|
||||
"Notification{" +
|
||||
"read = '" + read + '\'' +
|
||||
",mergeId = '" + mergeId + '\'' +
|
||||
",importance = '" + importance + '\'' +
|
||||
",nid = '" + nid + '\'' +
|
||||
",type = '" + type + '\'' +
|
||||
",path = '" + path + '\'' +
|
||||
",readClass = '" + readClass + '\'' +
|
||||
",datetime = '" + datetime + '\'' +
|
||||
",from = '" + from + '\'' +
|
||||
",bodyShort = '" + bodyShort + '\'' +
|
||||
",datetimeISO = '" + datetimeISO + '\'' +
|
||||
",user = '" + user + '\'' +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
package org.autojs.autojs.network.entity.notification;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class NotificationResponse {
|
||||
|
||||
private List<Notification> notifications;
|
||||
|
||||
public void setNotifications(List<Notification> notifications) {
|
||||
this.notifications = notifications;
|
||||
}
|
||||
|
||||
public List<Notification> getNotifications() {
|
||||
return notifications;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return
|
||||
"NotificationResponse{" +
|
||||
"notifications = '" + notifications + '\'' +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -1,173 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class AppInfo {
|
||||
|
||||
public static final String PERMISSION_ROOT = "root";
|
||||
|
||||
@SerializedName("details")
|
||||
private String mDetails;
|
||||
@SerializedName("email")
|
||||
private String mEmail;
|
||||
@SerializedName("file")
|
||||
private String mFile;
|
||||
@SerializedName("minSdkVersion")
|
||||
private long mMinSdkVersion;
|
||||
@SerializedName("name")
|
||||
private String mName;
|
||||
@SerializedName("package")
|
||||
private String mPackage;
|
||||
@SerializedName("permissions")
|
||||
private List<String> mPermissions;
|
||||
@SerializedName("qq")
|
||||
private String mQq;
|
||||
@SerializedName("releaseNotes")
|
||||
private String mReleaseNotes;
|
||||
@SerializedName("screenshots")
|
||||
private List<String> mScreenshots;
|
||||
@SerializedName("summary")
|
||||
private String mSummary;
|
||||
@SerializedName("userGuide")
|
||||
private String mUserGuide;
|
||||
@SerializedName("version")
|
||||
private String mVersion;
|
||||
@SerializedName("versionCode")
|
||||
private long mVersionCode;
|
||||
|
||||
public String getDetails() {
|
||||
return mDetails;
|
||||
}
|
||||
|
||||
public void setDetails(String details) {
|
||||
mDetails = details;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return mEmail;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
mEmail = email;
|
||||
}
|
||||
|
||||
public String getFile() {
|
||||
return mFile;
|
||||
}
|
||||
|
||||
public void setFile(String file) {
|
||||
mFile = file;
|
||||
}
|
||||
|
||||
public long getMinSdkVersion() {
|
||||
return mMinSdkVersion;
|
||||
}
|
||||
|
||||
public void setMinSdkVersion(long minSdkVersion) {
|
||||
mMinSdkVersion = minSdkVersion;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
mName = name;
|
||||
}
|
||||
|
||||
public String getPackage() {
|
||||
return mPackage;
|
||||
}
|
||||
|
||||
public void setPackage(String packageName) {
|
||||
mPackage = packageName;
|
||||
}
|
||||
|
||||
public List<String> getPermissions() {
|
||||
return mPermissions;
|
||||
}
|
||||
|
||||
public void setPermissions(List<String> permissions) {
|
||||
mPermissions = permissions;
|
||||
}
|
||||
|
||||
public String getQq() {
|
||||
return mQq;
|
||||
}
|
||||
|
||||
public void setQq(String qq) {
|
||||
mQq = qq;
|
||||
}
|
||||
|
||||
public String getReleaseNotes() {
|
||||
return mReleaseNotes;
|
||||
}
|
||||
|
||||
public void setReleaseNotes(String releaseNotes) {
|
||||
mReleaseNotes = releaseNotes;
|
||||
}
|
||||
|
||||
public List<String> getScreenshots() {
|
||||
return mScreenshots;
|
||||
}
|
||||
|
||||
public void setScreenshots(List<String> screenshots) {
|
||||
mScreenshots = screenshots;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return mSummary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
mSummary = summary;
|
||||
}
|
||||
|
||||
public String getUserGuide() {
|
||||
return mUserGuide;
|
||||
}
|
||||
|
||||
public void setUserGuide(String userGuide) {
|
||||
mUserGuide = userGuide;
|
||||
}
|
||||
|
||||
public String getVersion() {
|
||||
return mVersion;
|
||||
}
|
||||
|
||||
public void setVersion(String version) {
|
||||
mVersion = version;
|
||||
}
|
||||
|
||||
public long getVersionCode() {
|
||||
return mVersionCode;
|
||||
}
|
||||
|
||||
public void setVersionCode(long versionCode) {
|
||||
mVersionCode = versionCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ScriptApp{" +
|
||||
"mDetails='" + mDetails + '\'' +
|
||||
", mEmail='" + mEmail + '\'' +
|
||||
", mFile='" + mFile + '\'' +
|
||||
", mMinSdkVersion=" + mMinSdkVersion +
|
||||
", mName='" + mName + '\'' +
|
||||
", mPackage='" + mPackage + '\'' +
|
||||
", mPermissions=" + mPermissions +
|
||||
", mQq='" + mQq + '\'' +
|
||||
", mReleaseNotes='" + mReleaseNotes + '\'' +
|
||||
", mScreenshots=" + mScreenshots +
|
||||
", mSummary='" + mSummary + '\'' +
|
||||
", mUserGuide='" + mUserGuide + '\'' +
|
||||
", mVersion='" + mVersion + '\'' +
|
||||
", mVersionCode=" + mVersionCode +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Category {
|
||||
|
||||
@SerializedName("cid")
|
||||
private String mCid;
|
||||
@SerializedName("description")
|
||||
private String mDescription;
|
||||
@SerializedName("descriptionParsed")
|
||||
private String mDescriptionParsed;
|
||||
@SerializedName("link")
|
||||
private String mLink;
|
||||
@SerializedName("loggedIn")
|
||||
private Boolean mLoggedIn;
|
||||
@SerializedName("name")
|
||||
private String mName;
|
||||
@SerializedName("nextStart")
|
||||
private Long mNextStart;
|
||||
@SerializedName("numRecentReplies")
|
||||
private String mNumRecentReplies;
|
||||
@SerializedName("pagination")
|
||||
private Pagination mPagination;
|
||||
@SerializedName("parentCid")
|
||||
private String mParentCid;
|
||||
@SerializedName("post_count")
|
||||
private String mPostCount;
|
||||
@SerializedName("privileges")
|
||||
private Privileges mPrivileges;
|
||||
@SerializedName("slug")
|
||||
private String mSlug;
|
||||
@SerializedName("title")
|
||||
private String mTitle;
|
||||
@SerializedName("topic_count")
|
||||
private String mTopicCount;
|
||||
@SerializedName("topics")
|
||||
private List<Topic> mTopics;
|
||||
@SerializedName("totalPostCount")
|
||||
private Long mTotalPostCount;
|
||||
@SerializedName("totalTopicCount")
|
||||
private Long mTotalTopicCount;
|
||||
@SerializedName("url")
|
||||
private String mUrl;
|
||||
|
||||
public String getDescription() {
|
||||
return mDescription;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
mDescription = description;
|
||||
}
|
||||
|
||||
public String getDescriptionParsed() {
|
||||
return mDescriptionParsed;
|
||||
}
|
||||
|
||||
public void setDescriptionParsed(String descriptionParsed) {
|
||||
mDescriptionParsed = descriptionParsed;
|
||||
}
|
||||
public String getLink() {
|
||||
return mLink;
|
||||
}
|
||||
|
||||
public void setLink(String link) {
|
||||
mLink = link;
|
||||
}
|
||||
|
||||
public Boolean getLoggedIn() {
|
||||
return mLoggedIn;
|
||||
}
|
||||
|
||||
public void setLoggedIn(Boolean loggedIn) {
|
||||
mLoggedIn = loggedIn;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return mName;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
mName = name;
|
||||
}
|
||||
|
||||
public Long getNextStart() {
|
||||
return mNextStart;
|
||||
}
|
||||
|
||||
public void setNextStart(Long nextStart) {
|
||||
mNextStart = nextStart;
|
||||
}
|
||||
|
||||
public String getNumRecentReplies() {
|
||||
return mNumRecentReplies;
|
||||
}
|
||||
|
||||
public void setNumRecentReplies(String numRecentReplies) {
|
||||
mNumRecentReplies = numRecentReplies;
|
||||
}
|
||||
|
||||
public String getParentCid() {
|
||||
return mParentCid;
|
||||
}
|
||||
|
||||
public void setParentCid(String parentCid) {
|
||||
mParentCid = parentCid;
|
||||
}
|
||||
|
||||
public String getPostCount() {
|
||||
return mPostCount;
|
||||
}
|
||||
|
||||
public void setPostCount(String postCount) {
|
||||
mPostCount = postCount;
|
||||
}
|
||||
|
||||
public Privileges getPrivileges() {
|
||||
return mPrivileges;
|
||||
}
|
||||
|
||||
public void setPrivileges(Privileges privileges) {
|
||||
mPrivileges = privileges;
|
||||
}
|
||||
|
||||
public String getSlug() {
|
||||
return mSlug;
|
||||
}
|
||||
|
||||
public void setSlug(String slug) {
|
||||
mSlug = slug;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
mTitle = title;
|
||||
}
|
||||
|
||||
public String getTopicCount() {
|
||||
return mTopicCount;
|
||||
}
|
||||
|
||||
public void setTopicCount(String topicCount) {
|
||||
mTopicCount = topicCount;
|
||||
}
|
||||
|
||||
public List<Topic> getTopics() {
|
||||
return mTopics;
|
||||
}
|
||||
|
||||
public void setTopics(List<Topic> topics) {
|
||||
mTopics = topics;
|
||||
}
|
||||
|
||||
public Long getTotalPostCount() {
|
||||
return mTotalPostCount;
|
||||
}
|
||||
|
||||
public void setTotalPostCount(Long totalPostCount) {
|
||||
mTotalPostCount = totalPostCount;
|
||||
}
|
||||
|
||||
public Long getTotalTopicCount() {
|
||||
return mTotalTopicCount;
|
||||
}
|
||||
|
||||
public void setTotalTopicCount(Long totalTopicCount) {
|
||||
mTotalTopicCount = totalTopicCount;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Page {
|
||||
|
||||
@SerializedName("active")
|
||||
private boolean mActive;
|
||||
@SerializedName("page")
|
||||
private long mPage;
|
||||
|
||||
public boolean getActive() {
|
||||
return mActive;
|
||||
}
|
||||
|
||||
public void setActive(boolean active) {
|
||||
mActive = active;
|
||||
}
|
||||
|
||||
public long getPage() {
|
||||
return mPage;
|
||||
}
|
||||
|
||||
public void setPage(long page) {
|
||||
mPage = page;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Pagination {
|
||||
|
||||
@SerializedName("currentPage")
|
||||
private Long mCurrentPage;
|
||||
@SerializedName("next")
|
||||
private Page mNext;
|
||||
@SerializedName("pageCount")
|
||||
private Long mPageCount;
|
||||
@SerializedName("pages")
|
||||
private List<Object> mPages;
|
||||
@SerializedName("prev")
|
||||
private Page mPrev;
|
||||
@SerializedName("rel")
|
||||
private List<Object> mRel;
|
||||
|
||||
public Long getCurrentPage() {
|
||||
return mCurrentPage;
|
||||
}
|
||||
|
||||
public void setCurrentPage(Long currentPage) {
|
||||
mCurrentPage = currentPage;
|
||||
}
|
||||
|
||||
public Page getNext() {
|
||||
return mNext;
|
||||
}
|
||||
|
||||
public void setNext(Page next) {
|
||||
mNext = next;
|
||||
}
|
||||
|
||||
public Long getPageCount() {
|
||||
return mPageCount;
|
||||
}
|
||||
|
||||
public void setPageCount(Long pageCount) {
|
||||
mPageCount = pageCount;
|
||||
}
|
||||
|
||||
public List<Object> getPages() {
|
||||
return mPages;
|
||||
}
|
||||
|
||||
public void setPages(List<Object> pages) {
|
||||
mPages = pages;
|
||||
}
|
||||
|
||||
public Page getPrev() {
|
||||
return mPrev;
|
||||
}
|
||||
|
||||
public void setPrev(Page prev) {
|
||||
mPrev = prev;
|
||||
}
|
||||
|
||||
public List<Object> getRel() {
|
||||
return mRel;
|
||||
}
|
||||
|
||||
public void setRel(List<Object> rel) {
|
||||
mRel = rel;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,182 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.autojs.autojs.network.entity.user.User;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Post {
|
||||
|
||||
@SerializedName("content")
|
||||
private String mContent;
|
||||
@SerializedName("downvoted")
|
||||
private boolean mDownvoted;
|
||||
@SerializedName("downvotes")
|
||||
private long mDownvotes;
|
||||
@SerializedName("edited")
|
||||
private String mEdited;
|
||||
@SerializedName("editedISO")
|
||||
private String mEditedISO;
|
||||
@SerializedName("index")
|
||||
private long mIndex;
|
||||
@SerializedName("pid")
|
||||
private String mPid;
|
||||
@SerializedName("replies")
|
||||
private Replies mReplies;
|
||||
@SerializedName("selfPost")
|
||||
private boolean mSelfPost;
|
||||
@SerializedName("tid")
|
||||
private String mTid;
|
||||
@SerializedName("timestamp")
|
||||
private String mTimestamp;
|
||||
@SerializedName("timestampISO")
|
||||
private String mTimestampISO;
|
||||
@SerializedName("uid")
|
||||
private String mUid;
|
||||
@SerializedName("upvoted")
|
||||
private boolean mUpvoted;
|
||||
@SerializedName("upvotes")
|
||||
private long mUpvotes;
|
||||
@SerializedName("user")
|
||||
private User mUser;
|
||||
@SerializedName("votes")
|
||||
private long mVotes;
|
||||
|
||||
public String getContent() {
|
||||
return mContent;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
mContent = content;
|
||||
}
|
||||
|
||||
public boolean getDownvoted() {
|
||||
return mDownvoted;
|
||||
}
|
||||
|
||||
public void setDownvoted(boolean downvoted) {
|
||||
mDownvoted = downvoted;
|
||||
}
|
||||
|
||||
public long getDownvotes() {
|
||||
return mDownvotes;
|
||||
}
|
||||
|
||||
public void setDownvotes(long downvotes) {
|
||||
mDownvotes = downvotes;
|
||||
}
|
||||
|
||||
public String getEdited() {
|
||||
return mEdited;
|
||||
}
|
||||
|
||||
public void setEdited(String edited) {
|
||||
mEdited = edited;
|
||||
}
|
||||
|
||||
public String getEditedISO() {
|
||||
return mEditedISO;
|
||||
}
|
||||
|
||||
public void setEditedISO(String editedISO) {
|
||||
mEditedISO = editedISO;
|
||||
}
|
||||
|
||||
public long getIndex() {
|
||||
return mIndex;
|
||||
}
|
||||
|
||||
public void setIndex(long index) {
|
||||
mIndex = index;
|
||||
}
|
||||
|
||||
public String getPid() {
|
||||
return mPid;
|
||||
}
|
||||
|
||||
public void setPid(String pid) {
|
||||
mPid = pid;
|
||||
}
|
||||
|
||||
public Replies getReplies() {
|
||||
return mReplies;
|
||||
}
|
||||
|
||||
public void setReplies(Replies replies) {
|
||||
mReplies = replies;
|
||||
}
|
||||
|
||||
public boolean getSelfPost() {
|
||||
return mSelfPost;
|
||||
}
|
||||
|
||||
public void setSelfPost(boolean selfPost) {
|
||||
mSelfPost = selfPost;
|
||||
}
|
||||
|
||||
public String getTid() {
|
||||
return mTid;
|
||||
}
|
||||
|
||||
public void setTid(String tid) {
|
||||
mTid = tid;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return mTimestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
mTimestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getTimestampISO() {
|
||||
return mTimestampISO;
|
||||
}
|
||||
|
||||
public void setTimestampISO(String timestampISO) {
|
||||
mTimestampISO = timestampISO;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return mUid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
mUid = uid;
|
||||
}
|
||||
|
||||
public boolean getUpvoted() {
|
||||
return mUpvoted;
|
||||
}
|
||||
|
||||
public void setUpvoted(boolean upvoted) {
|
||||
mUpvoted = upvoted;
|
||||
}
|
||||
|
||||
public long getUpvotes() {
|
||||
return mUpvotes;
|
||||
}
|
||||
|
||||
public void setUpvotes(long upvotes) {
|
||||
mUpvotes = upvotes;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return mUser;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
mUser = user;
|
||||
}
|
||||
|
||||
public long getVotes() {
|
||||
return mVotes;
|
||||
}
|
||||
|
||||
public void setVotes(long votes) {
|
||||
mVotes = votes;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Privileges {
|
||||
|
||||
@SerializedName("cid")
|
||||
private String mCid;
|
||||
@SerializedName("editable")
|
||||
private Boolean mEditable;
|
||||
@SerializedName("isAdminOrMod")
|
||||
private Boolean mIsAdminOrMod;
|
||||
@SerializedName("read")
|
||||
private Boolean mRead;
|
||||
@SerializedName("topics:create")
|
||||
private Boolean mTopicsCreate;
|
||||
@SerializedName("topics:read")
|
||||
private Boolean mTopicsRead;
|
||||
@SerializedName("topics:tag")
|
||||
private Boolean mTopicsTag;
|
||||
@SerializedName("uid")
|
||||
private Long mUid;
|
||||
@SerializedName("view_deleted")
|
||||
private Boolean mViewDeleted;
|
||||
|
||||
public String getCid() {
|
||||
return mCid;
|
||||
}
|
||||
|
||||
public void setCid(String cid) {
|
||||
mCid = cid;
|
||||
}
|
||||
|
||||
public Boolean getEditable() {
|
||||
return mEditable;
|
||||
}
|
||||
|
||||
public void setEditable(Boolean editable) {
|
||||
mEditable = editable;
|
||||
}
|
||||
|
||||
public Boolean getIsAdminOrMod() {
|
||||
return mIsAdminOrMod;
|
||||
}
|
||||
|
||||
public void setIsAdminOrMod(Boolean isAdminOrMod) {
|
||||
mIsAdminOrMod = isAdminOrMod;
|
||||
}
|
||||
|
||||
public Boolean getRead() {
|
||||
return mRead;
|
||||
}
|
||||
|
||||
public void setRead(Boolean read) {
|
||||
mRead = read;
|
||||
}
|
||||
|
||||
public Boolean getTopicsCreate() {
|
||||
return mTopicsCreate;
|
||||
}
|
||||
|
||||
public void setTopicsCreate(Boolean topicsCreate) {
|
||||
mTopicsCreate = topicsCreate;
|
||||
}
|
||||
|
||||
public Boolean getTopicsRead() {
|
||||
return mTopicsRead;
|
||||
}
|
||||
|
||||
public void setTopicsRead(Boolean topicsRead) {
|
||||
mTopicsRead = topicsRead;
|
||||
}
|
||||
|
||||
public Boolean getTopicsTag() {
|
||||
return mTopicsTag;
|
||||
}
|
||||
|
||||
public void setTopicsTag(Boolean topicsTag) {
|
||||
mTopicsTag = topicsTag;
|
||||
}
|
||||
|
||||
public Long getUid() {
|
||||
return mUid;
|
||||
}
|
||||
|
||||
public void setUid(Long uid) {
|
||||
mUid = uid;
|
||||
}
|
||||
|
||||
public Boolean getViewDeleted() {
|
||||
return mViewDeleted;
|
||||
}
|
||||
|
||||
public void setViewDeleted(Boolean viewDeleted) {
|
||||
mViewDeleted = viewDeleted;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import java.util.List;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.autojs.autojs.network.entity.user.User;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Replies {
|
||||
|
||||
@SerializedName("count")
|
||||
private long mCount;
|
||||
@SerializedName("hasMore")
|
||||
private boolean mHasMore;
|
||||
@SerializedName("text")
|
||||
private String mText;
|
||||
@SerializedName("users")
|
||||
private List<User> mUsers;
|
||||
|
||||
public long getCount() {
|
||||
return mCount;
|
||||
}
|
||||
|
||||
public void setCount(long count) {
|
||||
mCount = count;
|
||||
}
|
||||
|
||||
public boolean getHasMore() {
|
||||
return mHasMore;
|
||||
}
|
||||
|
||||
public void setHasMore(boolean hasMore) {
|
||||
mHasMore = hasMore;
|
||||
}
|
||||
|
||||
public String getText() {
|
||||
return mText;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
mText = text;
|
||||
}
|
||||
|
||||
public List<User> getUsers() {
|
||||
return mUsers;
|
||||
}
|
||||
|
||||
public void setUsers(List<User> users) {
|
||||
mUsers = users;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,396 +0,0 @@
|
||||
|
||||
package org.autojs.autojs.network.entity.topic;
|
||||
|
||||
import android.text.Html;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import org.autojs.autojs.network.entity.user.User;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class Topic {
|
||||
|
||||
private static final Gson GSON = new Gson();
|
||||
|
||||
@SerializedName("category")
|
||||
private Category mCategory;
|
||||
@SerializedName("cid")
|
||||
private String mCid;
|
||||
@SerializedName("deleted")
|
||||
private boolean mDeleted;
|
||||
@SerializedName("downvotes")
|
||||
private long mDownvotes;
|
||||
@SerializedName("icons")
|
||||
private List<Object> mIcons;
|
||||
@SerializedName("ignored")
|
||||
private boolean mIgnored;
|
||||
@SerializedName("index")
|
||||
private long mIndex;
|
||||
@SerializedName("isOwner")
|
||||
private boolean mIsOwner;
|
||||
@SerializedName("lastposttime")
|
||||
private String mLastposttime;
|
||||
@SerializedName("lastposttimeISO")
|
||||
private String mLastposttimeISO;
|
||||
@SerializedName("locked")
|
||||
private boolean mLocked;
|
||||
@SerializedName("mainPid")
|
||||
private String mMainPid;
|
||||
@SerializedName("pinned")
|
||||
private boolean mPinned;
|
||||
@SerializedName("postcount")
|
||||
private String mPostcount;
|
||||
@SerializedName("slug")
|
||||
private String mSlug;
|
||||
@SerializedName("tags")
|
||||
private List<Object> mTags;
|
||||
@SerializedName("thumb")
|
||||
private String mThumb;
|
||||
@SerializedName("tid")
|
||||
private String mTid;
|
||||
@SerializedName("timestamp")
|
||||
private String mTimestamp;
|
||||
@SerializedName("timestampISO")
|
||||
private String mTimestampISO;
|
||||
@SerializedName("title")
|
||||
private String mTitle;
|
||||
@SerializedName("titleRaw")
|
||||
private String mTitleRaw;
|
||||
@SerializedName("uid")
|
||||
private String mUid;
|
||||
@SerializedName("unread")
|
||||
private boolean mUnread;
|
||||
@SerializedName("unreplied")
|
||||
private boolean mUnreplied;
|
||||
@SerializedName("upvotes")
|
||||
private long mUpvotes;
|
||||
@SerializedName("user")
|
||||
private User mUser;
|
||||
@SerializedName("viewcount")
|
||||
private String mViewcount;
|
||||
@SerializedName("votes")
|
||||
private long mVotes;
|
||||
@SerializedName("posts")
|
||||
private List<Post> mPosts = new ArrayList<>();
|
||||
@SerializedName("teaser")
|
||||
private Post mTeaser;
|
||||
|
||||
private AppInfo mAppInfo;
|
||||
private Post mMainPost;
|
||||
|
||||
public Category getCategory() {
|
||||
return mCategory;
|
||||
}
|
||||
|
||||
public void setCategory(Category category) {
|
||||
mCategory = category;
|
||||
}
|
||||
|
||||
public String getCid() {
|
||||
return mCid;
|
||||
}
|
||||
|
||||
public void setCid(String cid) {
|
||||
mCid = cid;
|
||||
}
|
||||
|
||||
public boolean getDeleted() {
|
||||
return mDeleted;
|
||||
}
|
||||
|
||||
public void setDeleted(boolean deleted) {
|
||||
mDeleted = deleted;
|
||||
}
|
||||
|
||||
public long getDownvotes() {
|
||||
return mDownvotes;
|
||||
}
|
||||
|
||||
public void setDownvotes(long downvotes) {
|
||||
mDownvotes = downvotes;
|
||||
}
|
||||
|
||||
public List<Object> getIcons() {
|
||||
return mIcons;
|
||||
}
|
||||
|
||||
public void setIcons(List<Object> icons) {
|
||||
mIcons = icons;
|
||||
}
|
||||
|
||||
public boolean getIgnored() {
|
||||
return mIgnored;
|
||||
}
|
||||
|
||||
public void setIgnored(boolean ignored) {
|
||||
mIgnored = ignored;
|
||||
}
|
||||
|
||||
public long getIndex() {
|
||||
return mIndex;
|
||||
}
|
||||
|
||||
public void setIndex(long index) {
|
||||
mIndex = index;
|
||||
}
|
||||
|
||||
public boolean getIsOwner() {
|
||||
return mIsOwner;
|
||||
}
|
||||
|
||||
public void setIsOwner(boolean isOwner) {
|
||||
mIsOwner = isOwner;
|
||||
}
|
||||
|
||||
public String getLastposttime() {
|
||||
return mLastposttime;
|
||||
}
|
||||
|
||||
public void setLastposttime(String lastposttime) {
|
||||
mLastposttime = lastposttime;
|
||||
}
|
||||
|
||||
public String getLastposttimeISO() {
|
||||
return mLastposttimeISO;
|
||||
}
|
||||
|
||||
public void setLastposttimeISO(String lastposttimeISO) {
|
||||
mLastposttimeISO = lastposttimeISO;
|
||||
}
|
||||
|
||||
public boolean getLocked() {
|
||||
return mLocked;
|
||||
}
|
||||
|
||||
public void setLocked(boolean locked) {
|
||||
mLocked = locked;
|
||||
}
|
||||
|
||||
public String getMainPid() {
|
||||
return mMainPid;
|
||||
}
|
||||
|
||||
public void setMainPid(String mainPid) {
|
||||
mMainPid = mainPid;
|
||||
}
|
||||
|
||||
public boolean getPinned() {
|
||||
return mPinned;
|
||||
}
|
||||
|
||||
public void setPinned(boolean pinned) {
|
||||
mPinned = pinned;
|
||||
}
|
||||
|
||||
public String getPostcount() {
|
||||
return mPostcount;
|
||||
}
|
||||
|
||||
public void setPostcount(String postcount) {
|
||||
mPostcount = postcount;
|
||||
}
|
||||
|
||||
public String getSlug() {
|
||||
return mSlug;
|
||||
}
|
||||
|
||||
public void setSlug(String slug) {
|
||||
mSlug = slug;
|
||||
}
|
||||
|
||||
public List<Object> getTags() {
|
||||
return mTags;
|
||||
}
|
||||
|
||||
public void setTags(List<Object> tags) {
|
||||
mTags = tags;
|
||||
}
|
||||
|
||||
public String getThumb() {
|
||||
return mThumb;
|
||||
}
|
||||
|
||||
public void setThumb(String thumb) {
|
||||
mThumb = thumb;
|
||||
}
|
||||
|
||||
public String getTid() {
|
||||
return mTid;
|
||||
}
|
||||
|
||||
public void setTid(String tid) {
|
||||
mTid = tid;
|
||||
}
|
||||
|
||||
public String getTimestamp() {
|
||||
return mTimestamp;
|
||||
}
|
||||
|
||||
public void setTimestamp(String timestamp) {
|
||||
mTimestamp = timestamp;
|
||||
}
|
||||
|
||||
public String getTimestampISO() {
|
||||
return mTimestampISO;
|
||||
}
|
||||
|
||||
public void setTimestampISO(String timestampISO) {
|
||||
mTimestampISO = timestampISO;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return mTitle;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
mTitle = title;
|
||||
}
|
||||
|
||||
public String getTitleRaw() {
|
||||
return mTitleRaw;
|
||||
}
|
||||
|
||||
public void setTitleRaw(String titleRaw) {
|
||||
mTitleRaw = titleRaw;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return mUid;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
mUid = uid;
|
||||
}
|
||||
|
||||
public boolean getUnread() {
|
||||
return mUnread;
|
||||
}
|
||||
|
||||
public void setUnread(boolean unread) {
|
||||
mUnread = unread;
|
||||
}
|
||||
|
||||
public boolean getUnreplied() {
|
||||
return mUnreplied;
|
||||
}
|
||||
|
||||
public void setUnreplied(boolean unreplied) {
|
||||
mUnreplied = unreplied;
|
||||
}
|
||||
|
||||
public long getUpvotes() {
|
||||
return mUpvotes;
|
||||
}
|
||||
|
||||
public void setUpvotes(long upvotes) {
|
||||
mUpvotes = upvotes;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return mUser;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
mUser = user;
|
||||
}
|
||||
|
||||
public String getViewcount() {
|
||||
return mViewcount;
|
||||
}
|
||||
|
||||
public void setViewcount(String viewcount) {
|
||||
mViewcount = viewcount;
|
||||
}
|
||||
|
||||
public long getVotes() {
|
||||
return mVotes;
|
||||
}
|
||||
|
||||
public void setVotes(long votes) {
|
||||
mVotes = votes;
|
||||
}
|
||||
|
||||
public List<Post> getPosts() {
|
||||
return mPosts;
|
||||
}
|
||||
|
||||
public void setPosts(List<Post> posts) {
|
||||
mPosts = posts;
|
||||
}
|
||||
|
||||
public AppInfo getAppInfo() {
|
||||
if (mAppInfo != null) {
|
||||
return mAppInfo;
|
||||
}
|
||||
if (mTeaser == null || mTeaser.getContent() == null) {
|
||||
return null;
|
||||
}
|
||||
try {
|
||||
String decoded = Html.fromHtml(mTeaser.getContent()).toString();
|
||||
AppInfo appInfo = GSON.fromJson(decoded, AppInfo.class);
|
||||
mAppInfo = appInfo;
|
||||
return appInfo;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public Post getTeaser() {
|
||||
return mTeaser;
|
||||
}
|
||||
|
||||
public void setTeaser(Post teaser) {
|
||||
mTeaser = teaser;
|
||||
}
|
||||
|
||||
public Post getMainPost() {
|
||||
return mMainPost;
|
||||
}
|
||||
|
||||
public void setMainPost(Post mainPost) {
|
||||
mMainPost = mainPost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Topic{" +
|
||||
"mCategory=" + mCategory +
|
||||
", mCid='" + mCid + '\'' +
|
||||
", mDeleted=" + mDeleted +
|
||||
", mDownvotes=" + mDownvotes +
|
||||
", mIcons=" + mIcons +
|
||||
", mIgnored=" + mIgnored +
|
||||
", mIndex=" + mIndex +
|
||||
", mIsOwner=" + mIsOwner +
|
||||
", mLastposttime='" + mLastposttime + '\'' +
|
||||
", mLastposttimeISO='" + mLastposttimeISO + '\'' +
|
||||
", mLocked=" + mLocked +
|
||||
", mMainPid='" + mMainPid + '\'' +
|
||||
", mPinned=" + mPinned +
|
||||
", mPostcount='" + mPostcount + '\'' +
|
||||
", mSlug='" + mSlug + '\'' +
|
||||
", mTags=" + mTags +
|
||||
", mThumb='" + mThumb + '\'' +
|
||||
", mTid='" + mTid + '\'' +
|
||||
", mTimestamp='" + mTimestamp + '\'' +
|
||||
", mTimestampISO='" + mTimestampISO + '\'' +
|
||||
", mTitle='" + mTitle + '\'' +
|
||||
", mTitleRaw='" + mTitleRaw + '\'' +
|
||||
", mUid='" + mUid + '\'' +
|
||||
", mUnread=" + mUnread +
|
||||
", mUnreplied=" + mUnreplied +
|
||||
", mUpvotes=" + mUpvotes +
|
||||
", mUser=" + mUser +
|
||||
", mViewcount='" + mViewcount + '\'' +
|
||||
", mVotes=" + mVotes +
|
||||
", mPosts=" + mPosts +
|
||||
", mTeaser=" + mTeaser +
|
||||
", mAppInfo=" + mAppInfo +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
@@ -1,253 +0,0 @@
|
||||
package org.autojs.autojs.network.entity.user;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class GroupsItem{
|
||||
|
||||
@SerializedName("createtimeISO")
|
||||
private String createtimeISO;
|
||||
|
||||
@SerializedName("createtime")
|
||||
private String createtime;
|
||||
|
||||
@SerializedName("private")
|
||||
private boolean jsonMemberPrivate;
|
||||
|
||||
@SerializedName("hidden")
|
||||
private boolean hidden;
|
||||
|
||||
@SerializedName("userTitleEnabled")
|
||||
private boolean userTitleEnabled;
|
||||
|
||||
@SerializedName("displayName")
|
||||
private String displayName;
|
||||
|
||||
@SerializedName("memberCount")
|
||||
private String memberCount;
|
||||
|
||||
@SerializedName("icon")
|
||||
private String icon;
|
||||
|
||||
@SerializedName("description")
|
||||
private String description;
|
||||
|
||||
@SerializedName("labelColor")
|
||||
private String labelColor;
|
||||
|
||||
@SerializedName("userTitle")
|
||||
private String userTitle;
|
||||
|
||||
@SerializedName("deleted")
|
||||
private String deleted;
|
||||
|
||||
@SerializedName("system")
|
||||
private boolean system;
|
||||
|
||||
@SerializedName("cover:position")
|
||||
private String coverPosition;
|
||||
|
||||
@SerializedName("name")
|
||||
private String name;
|
||||
|
||||
@SerializedName("cover:url")
|
||||
private String coverUrl;
|
||||
|
||||
@SerializedName("cover:thumb:url")
|
||||
private String coverThumbUrl;
|
||||
|
||||
@SerializedName("disableJoinRequests")
|
||||
private boolean disableJoinRequests;
|
||||
|
||||
@SerializedName("slug")
|
||||
private String slug;
|
||||
|
||||
@SerializedName("nameEncoded")
|
||||
private String nameEncoded;
|
||||
|
||||
public void setCreatetimeISO(String createtimeISO){
|
||||
this.createtimeISO = createtimeISO;
|
||||
}
|
||||
|
||||
public String getCreatetimeISO(){
|
||||
return createtimeISO;
|
||||
}
|
||||
|
||||
public void setCreatetime(String createtime){
|
||||
this.createtime = createtime;
|
||||
}
|
||||
|
||||
public String getCreatetime(){
|
||||
return createtime;
|
||||
}
|
||||
|
||||
public void setJsonMemberPrivate(boolean jsonMemberPrivate){
|
||||
this.jsonMemberPrivate = jsonMemberPrivate;
|
||||
}
|
||||
|
||||
public boolean isJsonMemberPrivate(){
|
||||
return jsonMemberPrivate;
|
||||
}
|
||||
|
||||
public void setHidden(boolean hidden){
|
||||
this.hidden = hidden;
|
||||
}
|
||||
|
||||
public boolean isHidden(){
|
||||
return hidden;
|
||||
}
|
||||
|
||||
public void setUserTitleEnabled(boolean userTitleEnabled){
|
||||
this.userTitleEnabled = userTitleEnabled;
|
||||
}
|
||||
|
||||
public boolean isUserTitleEnabled(){
|
||||
return userTitleEnabled;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName){
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getDisplayName(){
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setMemberCount(String memberCount){
|
||||
this.memberCount = memberCount;
|
||||
}
|
||||
|
||||
public String getMemberCount(){
|
||||
return memberCount;
|
||||
}
|
||||
|
||||
public void setIcon(String icon){
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
public String getIcon(){
|
||||
return icon;
|
||||
}
|
||||
|
||||
public void setDescription(String description){
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getDescription(){
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setLabelColor(String labelColor){
|
||||
this.labelColor = labelColor;
|
||||
}
|
||||
|
||||
public String getLabelColor(){
|
||||
return labelColor;
|
||||
}
|
||||
|
||||
public void setUserTitle(String userTitle){
|
||||
this.userTitle = userTitle;
|
||||
}
|
||||
|
||||
public String getUserTitle(){
|
||||
return userTitle;
|
||||
}
|
||||
|
||||
public void setDeleted(String deleted){
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
public String getDeleted(){
|
||||
return deleted;
|
||||
}
|
||||
|
||||
public void setSystem(boolean system){
|
||||
this.system = system;
|
||||
}
|
||||
|
||||
public boolean isSystem(){
|
||||
return system;
|
||||
}
|
||||
|
||||
public void setCoverPosition(String coverPosition){
|
||||
this.coverPosition = coverPosition;
|
||||
}
|
||||
|
||||
public String getCoverPosition(){
|
||||
return coverPosition;
|
||||
}
|
||||
|
||||
public void setName(String name){
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName(){
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setCoverUrl(String coverUrl){
|
||||
this.coverUrl = coverUrl;
|
||||
}
|
||||
|
||||
public String getCoverUrl(){
|
||||
return coverUrl;
|
||||
}
|
||||
|
||||
public void setCoverThumbUrl(String coverThumbUrl){
|
||||
this.coverThumbUrl = coverThumbUrl;
|
||||
}
|
||||
|
||||
public String getCoverThumbUrl(){
|
||||
return coverThumbUrl;
|
||||
}
|
||||
|
||||
public void setDisableJoinRequests(boolean disableJoinRequests){
|
||||
this.disableJoinRequests = disableJoinRequests;
|
||||
}
|
||||
|
||||
public boolean isDisableJoinRequests(){
|
||||
return disableJoinRequests;
|
||||
}
|
||||
|
||||
public void setSlug(String slug){
|
||||
this.slug = slug;
|
||||
}
|
||||
|
||||
public String getSlug(){
|
||||
return slug;
|
||||
}
|
||||
|
||||
public void setNameEncoded(String nameEncoded){
|
||||
this.nameEncoded = nameEncoded;
|
||||
}
|
||||
|
||||
public String getNameEncoded(){
|
||||
return nameEncoded;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return
|
||||
"GroupsItem{" +
|
||||
"createtimeISO = '" + createtimeISO + '\'' +
|
||||
",createtime = '" + createtime + '\'' +
|
||||
",private = '" + jsonMemberPrivate + '\'' +
|
||||
",hidden = '" + hidden + '\'' +
|
||||
",userTitleEnabled = '" + userTitleEnabled + '\'' +
|
||||
",displayName = '" + displayName + '\'' +
|
||||
",memberCount = '" + memberCount + '\'' +
|
||||
",icon = '" + icon + '\'' +
|
||||
",description = '" + description + '\'' +
|
||||
",labelColor = '" + labelColor + '\'' +
|
||||
",userTitle = '" + userTitle + '\'' +
|
||||
",deleted = '" + deleted + '\'' +
|
||||
",system = '" + system + '\'' +
|
||||
",cover:position = '" + coverPosition + '\'' +
|
||||
",name = '" + name + '\'' +
|
||||
",cover:url = '" + coverUrl + '\'' +
|
||||
",cover:thumb:url = '" + coverThumbUrl + '\'' +
|
||||
",disableJoinRequests = '" + disableJoinRequests + '\'' +
|
||||
",slug = '" + slug + '\'' +
|
||||
",nameEncoded = '" + nameEncoded + '\'' +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@@ -1,756 +0,0 @@
|
||||
package org.autojs.autojs.network.entity.user;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.stardust.util.Objects;
|
||||
|
||||
public class User {
|
||||
|
||||
@SerializedName("websiteLink")
|
||||
private String websiteLink;
|
||||
|
||||
@SerializedName("reputation")
|
||||
private String reputation;
|
||||
|
||||
@SerializedName("sso")
|
||||
private List<Object> sso;
|
||||
|
||||
@SerializedName("icon:text")
|
||||
private String iconText;
|
||||
|
||||
@SerializedName("isGlobalModerator")
|
||||
private boolean isGlobalModerator;
|
||||
|
||||
@SerializedName("joindate")
|
||||
private String joindate;
|
||||
|
||||
@SerializedName("profile_links")
|
||||
private List<Object> profileLinks;
|
||||
|
||||
@SerializedName("reputation:disabled")
|
||||
private boolean reputationDisabled;
|
||||
|
||||
@SerializedName("isAdmin")
|
||||
private boolean isAdmin;
|
||||
|
||||
@SerializedName("moderationNote")
|
||||
private String moderationNote;
|
||||
|
||||
@SerializedName("ips")
|
||||
private List<String> ips;
|
||||
|
||||
@SerializedName("aboutme")
|
||||
private String aboutme;
|
||||
|
||||
@SerializedName("isTargetAdmin")
|
||||
private boolean isTargetAdmin;
|
||||
|
||||
@SerializedName("email:confirmed")
|
||||
private boolean emailConfirmed;
|
||||
|
||||
@SerializedName("isAdminOrGlobalModerator")
|
||||
private boolean isAdminOrGlobalModerator;
|
||||
|
||||
@SerializedName("emailClass")
|
||||
private String emailClass;
|
||||
|
||||
@SerializedName("downvote:disabled")
|
||||
private boolean downvoteDisabled;
|
||||
|
||||
@SerializedName("topiccount")
|
||||
private String topiccount;
|
||||
|
||||
@SerializedName("isSelf")
|
||||
private boolean isSelf;
|
||||
|
||||
@SerializedName("status")
|
||||
private String status;
|
||||
|
||||
@SerializedName("birthday")
|
||||
private String birthday;
|
||||
|
||||
@SerializedName("showHidden")
|
||||
private boolean showHidden;
|
||||
|
||||
@SerializedName("yourid")
|
||||
private int yourid;
|
||||
|
||||
@SerializedName("lastposttime")
|
||||
private String lastposttime;
|
||||
|
||||
@SerializedName("isModerator")
|
||||
private boolean isModerator;
|
||||
|
||||
@SerializedName("signature")
|
||||
private String signature;
|
||||
|
||||
@SerializedName("icon:bgColor")
|
||||
private String iconBgColor;
|
||||
|
||||
@SerializedName("canEdit")
|
||||
private boolean canEdit;
|
||||
|
||||
@SerializedName("groupTitle")
|
||||
private String groupTitle;
|
||||
|
||||
@SerializedName("followingCount")
|
||||
private int followingCount;
|
||||
|
||||
@SerializedName("lastonlineISO")
|
||||
private String lastonlineISO;
|
||||
|
||||
@SerializedName("email:disableEdit")
|
||||
private boolean emailDisableEdit;
|
||||
|
||||
@SerializedName("uid")
|
||||
private String uid;
|
||||
|
||||
@SerializedName("canChangePassword")
|
||||
private boolean canChangePassword;
|
||||
|
||||
@SerializedName("profileviews")
|
||||
private String profileviews;
|
||||
|
||||
@SerializedName("cover:url")
|
||||
private String coverUrl;
|
||||
|
||||
@SerializedName("banned")
|
||||
private boolean banned;
|
||||
|
||||
@SerializedName("userslug")
|
||||
private String userslug;
|
||||
|
||||
@SerializedName("followerCount")
|
||||
private int followerCount;
|
||||
|
||||
@SerializedName("email")
|
||||
private String email;
|
||||
|
||||
@SerializedName("website")
|
||||
private String website;
|
||||
|
||||
@SerializedName("isFollowing")
|
||||
private boolean isFollowing;
|
||||
|
||||
@SerializedName("uploadedpicture")
|
||||
private String uploadedpicture;
|
||||
|
||||
@SerializedName("passwordExpiry")
|
||||
private String passwordExpiry;
|
||||
|
||||
@SerializedName("canBan")
|
||||
private boolean canBan;
|
||||
|
||||
@SerializedName("lastonline")
|
||||
private String lastonline;
|
||||
|
||||
@SerializedName("disableSignatures")
|
||||
private boolean disableSignatures;
|
||||
|
||||
@SerializedName("groups")
|
||||
private List<GroupsItem> groups;
|
||||
|
||||
@SerializedName("username:disableEdit")
|
||||
private boolean usernameDisableEdit;
|
||||
|
||||
@SerializedName("picture")
|
||||
private String picture;
|
||||
|
||||
@SerializedName("joindateISO")
|
||||
private String joindateISO;
|
||||
|
||||
@SerializedName("isSelfOrAdminOrGlobalModerator")
|
||||
private boolean isSelfOrAdminOrGlobalModerator;
|
||||
|
||||
@SerializedName("websiteName")
|
||||
private String websiteName;
|
||||
|
||||
@SerializedName("isAdminOrGlobalModeratorOrModerator")
|
||||
private boolean isAdminOrGlobalModeratorOrModerator;
|
||||
|
||||
@SerializedName("cover:position")
|
||||
private String coverPosition;
|
||||
|
||||
@SerializedName("postcount")
|
||||
private String postcount;
|
||||
|
||||
@SerializedName("location")
|
||||
private String location;
|
||||
|
||||
@SerializedName("fullname")
|
||||
private String fullname;
|
||||
|
||||
@SerializedName("age")
|
||||
private int age;
|
||||
|
||||
@SerializedName("theirid")
|
||||
private String theirid;
|
||||
|
||||
@SerializedName("username")
|
||||
private String username;
|
||||
|
||||
public void setWebsiteLink(String websiteLink) {
|
||||
this.websiteLink = websiteLink;
|
||||
}
|
||||
|
||||
public String getWebsiteLink() {
|
||||
return websiteLink;
|
||||
}
|
||||
|
||||
public void setReputation(String reputation) {
|
||||
this.reputation = reputation;
|
||||
}
|
||||
|
||||
public String getReputation() {
|
||||
return reputation;
|
||||
}
|
||||
|
||||
public void setSso(List<Object> sso) {
|
||||
this.sso = sso;
|
||||
}
|
||||
|
||||
public List<Object> getSso() {
|
||||
return sso;
|
||||
}
|
||||
|
||||
public void setIconText(String iconText) {
|
||||
this.iconText = iconText;
|
||||
}
|
||||
|
||||
public String getIconText() {
|
||||
return iconText;
|
||||
}
|
||||
|
||||
public void setIsGlobalModerator(boolean isGlobalModerator) {
|
||||
this.isGlobalModerator = isGlobalModerator;
|
||||
}
|
||||
|
||||
public boolean isIsGlobalModerator() {
|
||||
return isGlobalModerator;
|
||||
}
|
||||
|
||||
public void setJoindate(String joindate) {
|
||||
this.joindate = joindate;
|
||||
}
|
||||
|
||||
public String getJoindate() {
|
||||
return joindate;
|
||||
}
|
||||
|
||||
public void setProfileLinks(List<Object> profileLinks) {
|
||||
this.profileLinks = profileLinks;
|
||||
}
|
||||
|
||||
public List<Object> getProfileLinks() {
|
||||
return profileLinks;
|
||||
}
|
||||
|
||||
public void setReputationDisabled(boolean reputationDisabled) {
|
||||
this.reputationDisabled = reputationDisabled;
|
||||
}
|
||||
|
||||
public boolean isReputationDisabled() {
|
||||
return reputationDisabled;
|
||||
}
|
||||
|
||||
public void setIsAdmin(boolean isAdmin) {
|
||||
this.isAdmin = isAdmin;
|
||||
}
|
||||
|
||||
public boolean isIsAdmin() {
|
||||
return isAdmin;
|
||||
}
|
||||
|
||||
public void setModerationNote(String moderationNote) {
|
||||
this.moderationNote = moderationNote;
|
||||
}
|
||||
|
||||
public String getModerationNote() {
|
||||
return moderationNote;
|
||||
}
|
||||
|
||||
public void setIps(List<String> ips) {
|
||||
this.ips = ips;
|
||||
}
|
||||
|
||||
public List<String> getIps() {
|
||||
return ips;
|
||||
}
|
||||
|
||||
public void setAboutme(String aboutme) {
|
||||
this.aboutme = aboutme;
|
||||
}
|
||||
|
||||
public String getAboutme() {
|
||||
return aboutme;
|
||||
}
|
||||
|
||||
public void setIsTargetAdmin(boolean isTargetAdmin) {
|
||||
this.isTargetAdmin = isTargetAdmin;
|
||||
}
|
||||
|
||||
public boolean isIsTargetAdmin() {
|
||||
return isTargetAdmin;
|
||||
}
|
||||
|
||||
public void setEmailConfirmed(boolean emailConfirmed) {
|
||||
this.emailConfirmed = emailConfirmed;
|
||||
}
|
||||
|
||||
public boolean isEmailConfirmed() {
|
||||
return emailConfirmed;
|
||||
}
|
||||
|
||||
public void setIsAdminOrGlobalModerator(boolean isAdminOrGlobalModerator) {
|
||||
this.isAdminOrGlobalModerator = isAdminOrGlobalModerator;
|
||||
}
|
||||
|
||||
public boolean isIsAdminOrGlobalModerator() {
|
||||
return isAdminOrGlobalModerator;
|
||||
}
|
||||
|
||||
public void setEmailClass(String emailClass) {
|
||||
this.emailClass = emailClass;
|
||||
}
|
||||
|
||||
public String getEmailClass() {
|
||||
return emailClass;
|
||||
}
|
||||
|
||||
public void setDownvoteDisabled(boolean downvoteDisabled) {
|
||||
this.downvoteDisabled = downvoteDisabled;
|
||||
}
|
||||
|
||||
public boolean isDownvoteDisabled() {
|
||||
return downvoteDisabled;
|
||||
}
|
||||
|
||||
public void setTopiccount(String topiccount) {
|
||||
this.topiccount = topiccount;
|
||||
}
|
||||
|
||||
public String getTopiccount() {
|
||||
return topiccount;
|
||||
}
|
||||
|
||||
public void setIsSelf(boolean isSelf) {
|
||||
this.isSelf = isSelf;
|
||||
}
|
||||
|
||||
public boolean isIsSelf() {
|
||||
return isSelf;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setBirthday(String birthday) {
|
||||
this.birthday = birthday;
|
||||
}
|
||||
|
||||
public String getBirthday() {
|
||||
return birthday;
|
||||
}
|
||||
|
||||
public void setShowHidden(boolean showHidden) {
|
||||
this.showHidden = showHidden;
|
||||
}
|
||||
|
||||
public boolean isShowHidden() {
|
||||
return showHidden;
|
||||
}
|
||||
|
||||
public void setYourid(int yourid) {
|
||||
this.yourid = yourid;
|
||||
}
|
||||
|
||||
public int getYourid() {
|
||||
return yourid;
|
||||
}
|
||||
|
||||
public void setLastposttime(String lastposttime) {
|
||||
this.lastposttime = lastposttime;
|
||||
}
|
||||
|
||||
public String getLastposttime() {
|
||||
return lastposttime;
|
||||
}
|
||||
|
||||
public void setIsModerator(boolean isModerator) {
|
||||
this.isModerator = isModerator;
|
||||
}
|
||||
|
||||
public boolean isIsModerator() {
|
||||
return isModerator;
|
||||
}
|
||||
|
||||
public void setSignature(String signature) {
|
||||
this.signature = signature;
|
||||
}
|
||||
|
||||
public String getSignature() {
|
||||
return signature;
|
||||
}
|
||||
|
||||
public void setIconBgColor(String iconBgColor) {
|
||||
this.iconBgColor = iconBgColor;
|
||||
}
|
||||
|
||||
public String getIconBgColor() {
|
||||
return iconBgColor;
|
||||
}
|
||||
|
||||
public void setCanEdit(boolean canEdit) {
|
||||
this.canEdit = canEdit;
|
||||
}
|
||||
|
||||
public boolean isCanEdit() {
|
||||
return canEdit;
|
||||
}
|
||||
|
||||
public void setGroupTitle(String groupTitle) {
|
||||
this.groupTitle = groupTitle;
|
||||
}
|
||||
|
||||
public String getGroupTitle() {
|
||||
return groupTitle;
|
||||
}
|
||||
|
||||
public void setFollowingCount(int followingCount) {
|
||||
this.followingCount = followingCount;
|
||||
}
|
||||
|
||||
public int getFollowingCount() {
|
||||
return followingCount;
|
||||
}
|
||||
|
||||
public void setLastonlineISO(String lastonlineISO) {
|
||||
this.lastonlineISO = lastonlineISO;
|
||||
}
|
||||
|
||||
public String getLastonlineISO() {
|
||||
return lastonlineISO;
|
||||
}
|
||||
|
||||
public void setEmailDisableEdit(boolean emailDisableEdit) {
|
||||
this.emailDisableEdit = emailDisableEdit;
|
||||
}
|
||||
|
||||
public boolean isEmailDisableEdit() {
|
||||
return emailDisableEdit;
|
||||
}
|
||||
|
||||
public void setUid(String uid) {
|
||||
this.uid = uid;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public void setCanChangePassword(boolean canChangePassword) {
|
||||
this.canChangePassword = canChangePassword;
|
||||
}
|
||||
|
||||
public boolean isCanChangePassword() {
|
||||
return canChangePassword;
|
||||
}
|
||||
|
||||
public void setProfileviews(String profileviews) {
|
||||
this.profileviews = profileviews;
|
||||
}
|
||||
|
||||
public String getProfileviews() {
|
||||
return profileviews;
|
||||
}
|
||||
|
||||
public void setCoverUrl(String coverUrl) {
|
||||
this.coverUrl = coverUrl;
|
||||
}
|
||||
|
||||
public String getCoverUrl() {
|
||||
return coverUrl;
|
||||
}
|
||||
|
||||
public void setBanned(boolean banned) {
|
||||
this.banned = banned;
|
||||
}
|
||||
|
||||
public boolean isBanned() {
|
||||
return banned;
|
||||
}
|
||||
|
||||
public void setUserslug(String userslug) {
|
||||
this.userslug = userslug;
|
||||
}
|
||||
|
||||
public String getUserslug() {
|
||||
return userslug;
|
||||
}
|
||||
|
||||
public void setFollowerCount(int followerCount) {
|
||||
this.followerCount = followerCount;
|
||||
}
|
||||
|
||||
public int getFollowerCount() {
|
||||
return followerCount;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setWebsite(String website) {
|
||||
this.website = website;
|
||||
}
|
||||
|
||||
public String getWebsite() {
|
||||
return website;
|
||||
}
|
||||
|
||||
public void setIsFollowing(boolean isFollowing) {
|
||||
this.isFollowing = isFollowing;
|
||||
}
|
||||
|
||||
public boolean isIsFollowing() {
|
||||
return isFollowing;
|
||||
}
|
||||
|
||||
public void setUploadedpicture(String uploadedpicture) {
|
||||
this.uploadedpicture = uploadedpicture;
|
||||
}
|
||||
|
||||
public String getUploadedpicture() {
|
||||
return uploadedpicture;
|
||||
}
|
||||
|
||||
public void setPasswordExpiry(String passwordExpiry) {
|
||||
this.passwordExpiry = passwordExpiry;
|
||||
}
|
||||
|
||||
public String getPasswordExpiry() {
|
||||
return passwordExpiry;
|
||||
}
|
||||
|
||||
public void setCanBan(boolean canBan) {
|
||||
this.canBan = canBan;
|
||||
}
|
||||
|
||||
public boolean isCanBan() {
|
||||
return canBan;
|
||||
}
|
||||
|
||||
public void setLastonline(String lastonline) {
|
||||
this.lastonline = lastonline;
|
||||
}
|
||||
|
||||
public String getLastonline() {
|
||||
return lastonline;
|
||||
}
|
||||
|
||||
public void setDisableSignatures(boolean disableSignatures) {
|
||||
this.disableSignatures = disableSignatures;
|
||||
}
|
||||
|
||||
public boolean isDisableSignatures() {
|
||||
return disableSignatures;
|
||||
}
|
||||
|
||||
public void setGroups(List<GroupsItem> groups) {
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
public List<GroupsItem> getGroups() {
|
||||
return groups;
|
||||
}
|
||||
|
||||
public void setUsernameDisableEdit(boolean usernameDisableEdit) {
|
||||
this.usernameDisableEdit = usernameDisableEdit;
|
||||
}
|
||||
|
||||
public boolean isUsernameDisableEdit() {
|
||||
return usernameDisableEdit;
|
||||
}
|
||||
|
||||
public void setPicture(String picture) {
|
||||
this.picture = picture;
|
||||
}
|
||||
|
||||
public String getPicture() {
|
||||
return picture;
|
||||
}
|
||||
|
||||
public void setJoindateISO(String joindateISO) {
|
||||
this.joindateISO = joindateISO;
|
||||
}
|
||||
|
||||
public String getJoindateISO() {
|
||||
return joindateISO;
|
||||
}
|
||||
|
||||
public void setIsSelfOrAdminOrGlobalModerator(boolean isSelfOrAdminOrGlobalModerator) {
|
||||
this.isSelfOrAdminOrGlobalModerator = isSelfOrAdminOrGlobalModerator;
|
||||
}
|
||||
|
||||
public boolean isIsSelfOrAdminOrGlobalModerator() {
|
||||
return isSelfOrAdminOrGlobalModerator;
|
||||
}
|
||||
|
||||
public void setWebsiteName(String websiteName) {
|
||||
this.websiteName = websiteName;
|
||||
}
|
||||
|
||||
public String getWebsiteName() {
|
||||
return websiteName;
|
||||
}
|
||||
|
||||
public void setIsAdminOrGlobalModeratorOrModerator(boolean isAdminOrGlobalModeratorOrModerator) {
|
||||
this.isAdminOrGlobalModeratorOrModerator = isAdminOrGlobalModeratorOrModerator;
|
||||
}
|
||||
|
||||
public boolean isIsAdminOrGlobalModeratorOrModerator() {
|
||||
return isAdminOrGlobalModeratorOrModerator;
|
||||
}
|
||||
|
||||
public void setCoverPosition(String coverPosition) {
|
||||
this.coverPosition = coverPosition;
|
||||
}
|
||||
|
||||
public String getCoverPosition() {
|
||||
return coverPosition;
|
||||
}
|
||||
|
||||
public void setPostcount(String postcount) {
|
||||
this.postcount = postcount;
|
||||
}
|
||||
|
||||
public String getPostcount() {
|
||||
return postcount;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setFullname(String fullname) {
|
||||
this.fullname = fullname;
|
||||
}
|
||||
|
||||
public String getFullname() {
|
||||
return fullname;
|
||||
}
|
||||
|
||||
public void setAge(int age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public int getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setTheirid(String theirid) {
|
||||
this.theirid = theirid;
|
||||
}
|
||||
|
||||
public String getTheirid() {
|
||||
return theirid;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return
|
||||
"User{" +
|
||||
"websiteLink = '" + websiteLink + '\'' +
|
||||
",reputation = '" + reputation + '\'' +
|
||||
",sso = '" + sso + '\'' +
|
||||
",icon:text = '" + iconText + '\'' +
|
||||
",isGlobalModerator = '" + isGlobalModerator + '\'' +
|
||||
",joindate = '" + joindate + '\'' +
|
||||
",profile_links = '" + profileLinks + '\'' +
|
||||
",reputation:disabled = '" + reputationDisabled + '\'' +
|
||||
",isAdmin = '" + isAdmin + '\'' +
|
||||
",moderationNote = '" + moderationNote + '\'' +
|
||||
",ips = '" + ips + '\'' +
|
||||
",aboutme = '" + aboutme + '\'' +
|
||||
",isTargetAdmin = '" + isTargetAdmin + '\'' +
|
||||
",email:confirmed = '" + emailConfirmed + '\'' +
|
||||
",isAdminOrGlobalModerator = '" + isAdminOrGlobalModerator + '\'' +
|
||||
",emailClass = '" + emailClass + '\'' +
|
||||
",downvote:disabled = '" + downvoteDisabled + '\'' +
|
||||
",topiccount = '" + topiccount + '\'' +
|
||||
",isSelf = '" + isSelf + '\'' +
|
||||
",status = '" + status + '\'' +
|
||||
",birthday = '" + birthday + '\'' +
|
||||
",showHidden = '" + showHidden + '\'' +
|
||||
",yourid = '" + yourid + '\'' +
|
||||
",lastposttime = '" + lastposttime + '\'' +
|
||||
",isModerator = '" + isModerator + '\'' +
|
||||
",signature = '" + signature + '\'' +
|
||||
",icon:bgColor = '" + iconBgColor + '\'' +
|
||||
",canEdit = '" + canEdit + '\'' +
|
||||
",groupTitle = '" + groupTitle + '\'' +
|
||||
",followingCount = '" + followingCount + '\'' +
|
||||
",lastonlineISO = '" + lastonlineISO + '\'' +
|
||||
",email:disableEdit = '" + emailDisableEdit + '\'' +
|
||||
",uid = '" + uid + '\'' +
|
||||
",canChangePassword = '" + canChangePassword + '\'' +
|
||||
",profileviews = '" + profileviews + '\'' +
|
||||
",cover:url = '" + coverUrl + '\'' +
|
||||
",banned = '" + banned + '\'' +
|
||||
",userslug = '" + userslug + '\'' +
|
||||
",followerCount = '" + followerCount + '\'' +
|
||||
",email = '" + email + '\'' +
|
||||
",website = '" + website + '\'' +
|
||||
",isFollowing = '" + isFollowing + '\'' +
|
||||
",uploadedpicture = '" + uploadedpicture + '\'' +
|
||||
",passwordExpiry = '" + passwordExpiry + '\'' +
|
||||
",canBan = '" + canBan + '\'' +
|
||||
",lastonline = '" + lastonline + '\'' +
|
||||
",disableSignatures = '" + disableSignatures + '\'' +
|
||||
",groups = '" + groups + '\'' +
|
||||
",username:disableEdit = '" + usernameDisableEdit + '\'' +
|
||||
",picture = '" + picture + '\'' +
|
||||
",joindateISO = '" + joindateISO + '\'' +
|
||||
",isSelfOrAdminOrGlobalModerator = '" + isSelfOrAdminOrGlobalModerator + '\'' +
|
||||
",websiteName = '" + websiteName + '\'' +
|
||||
",isAdminOrGlobalModeratorOrModerator = '" + isAdminOrGlobalModeratorOrModerator + '\'' +
|
||||
",cover:position = '" + coverPosition + '\'' +
|
||||
",postcount = '" + postcount + '\'' +
|
||||
",location = '" + location + '\'' +
|
||||
",fullname = '" + fullname + '\'' +
|
||||
",age = '" + age + '\'' +
|
||||
",theirid = '" + theirid + '\'' +
|
||||
",username = '" + username + '\'' +
|
||||
"}";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof User))
|
||||
return false;
|
||||
User user = (User) obj;
|
||||
return Objects.equals(user.uid, this.uid);
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
package org.autojs.autojs.network.util;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.CookieManager;
|
||||
import java.net.CookiePolicy;
|
||||
import java.net.CookieStore;
|
||||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import okhttp3.Cookie;
|
||||
import okhttp3.CookieJar;
|
||||
import okhttp3.HttpUrl;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/9/20.
|
||||
*/
|
||||
|
||||
public class WebkitCookieManagerProxy extends CookieManager implements CookieJar {
|
||||
private android.webkit.CookieManager webkitCookieManager;
|
||||
|
||||
private static final String TAG = WebkitCookieManagerProxy.class.getSimpleName();
|
||||
|
||||
public WebkitCookieManagerProxy() {
|
||||
this(null, null);
|
||||
}
|
||||
|
||||
WebkitCookieManagerProxy(CookieStore store, CookiePolicy cookiePolicy) {
|
||||
super(null, cookiePolicy);
|
||||
this.webkitCookieManager = android.webkit.CookieManager.getInstance();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void put(URI uri, Map<String, List<String>> responseHeaders)
|
||||
throws IOException {
|
||||
// make sure our args are valid
|
||||
if ((uri == null) || (responseHeaders == null))
|
||||
return;
|
||||
|
||||
// save our url once
|
||||
String url = uri.toString();
|
||||
|
||||
// go over the headers
|
||||
for (String headerKey : responseHeaders.keySet()) {
|
||||
// ignore headers which aren't cookie related
|
||||
if ((headerKey == null)
|
||||
|| !(headerKey.equalsIgnoreCase("Set-Cookie2") || headerKey
|
||||
.equalsIgnoreCase("Set-Cookie")))
|
||||
continue;
|
||||
|
||||
// process each of the headers
|
||||
for (String headerValue : responseHeaders.get(headerKey)) {
|
||||
webkitCookieManager.setCookie(url, headerValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, List<String>> get(URI uri,
|
||||
Map<String, List<String>> requestHeaders) throws IOException {
|
||||
// make sure our args are valid
|
||||
if ((uri == null) || (requestHeaders == null))
|
||||
throw new IllegalArgumentException("Argument is null");
|
||||
|
||||
// save our url once
|
||||
String url = uri.toString();
|
||||
|
||||
// prepare our response
|
||||
Map<String, List<String>> res = new java.util.HashMap<String, List<String>>();
|
||||
|
||||
// get the cookie
|
||||
String cookie = webkitCookieManager.getCookie(url);
|
||||
|
||||
// return it
|
||||
if (cookie != null) {
|
||||
res.put("Cookie", Arrays.asList(cookie));
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CookieStore getCookieStore() {
|
||||
// we don't want anyone to work with this cookie store directly
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveFromResponse(HttpUrl url, List<Cookie> cookies) {
|
||||
HashMap<String, List<String>> generatedResponseHeaders = new HashMap<>();
|
||||
ArrayList<String> cookiesList = new ArrayList<>();
|
||||
for (Cookie c : cookies) {
|
||||
// toString correctly generates a normal cookie string
|
||||
cookiesList.add(c.toString());
|
||||
}
|
||||
|
||||
generatedResponseHeaders.put("Set-Cookie", cookiesList);
|
||||
try {
|
||||
put(url.uri(), generatedResponseHeaders);
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "Error adding cookies through okhttp", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Cookie> loadForRequest(HttpUrl url) {
|
||||
ArrayList<Cookie> cookieArrayList = new ArrayList<>();
|
||||
try {
|
||||
Map<String, List<String>> cookieList = get(url.uri(), new HashMap<String, List<String>>());
|
||||
// Format here looks like: "Cookie":["cookie1=val1;cookie2=val2;"]
|
||||
for (List<String> ls : cookieList.values()) {
|
||||
for (String s : ls) {
|
||||
String[] cookies = s.split(";");
|
||||
for (String cookie : cookies) {
|
||||
Cookie c = Cookie.parse(url, cookie);
|
||||
cookieArrayList.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
Log.e(TAG, "error making cookie!", e);
|
||||
}
|
||||
return cookieArrayList;
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ import com.stardust.pio.PFiles;
|
||||
import com.stardust.util.MD5;
|
||||
|
||||
import org.autojs.autojs.Pref;
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
import org.autojs.autojs.autojs.AutoJs;
|
||||
import org.autojs.autojs.model.script.Scripts;
|
||||
|
||||
@@ -26,19 +26,23 @@ import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.Callable;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
import io.reactivex.functions.Consumer;
|
||||
import io.reactivex.schedulers.Schedulers;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/5/11.
|
||||
*/
|
||||
|
||||
public class DevPluginResponseHandler implements Handler {
|
||||
|
||||
public static final String TYPE_COMMAND = DevPluginService.TYPE_COMMAND;
|
||||
public static final String TYPE_BYTES_COMMAND = DevPluginService.TYPE_BYTES_COMMAND;
|
||||
|
||||
private final Router mRouter = new Router.RootRouter("type")
|
||||
.handler("command", new Router("command")
|
||||
.handler(TYPE_COMMAND, new Router("command")
|
||||
.handler("run", data -> {
|
||||
String script = data.get("script").getAsString();
|
||||
String name = getName(data);
|
||||
@@ -57,19 +61,11 @@ public class DevPluginResponseHandler implements Handler {
|
||||
saveScript(name, script);
|
||||
return true;
|
||||
})
|
||||
.handler("rerun", data -> {
|
||||
String id = data.get("id").getAsString();
|
||||
String script = data.get("script").getAsString();
|
||||
String name = getName(data);
|
||||
stopScript(id);
|
||||
runScript(id, name, script);
|
||||
return true;
|
||||
})
|
||||
.handler("stopAll", data -> {
|
||||
AutoJs.getInstance().getScriptEngineService().stopAllAndToast();
|
||||
return true;
|
||||
}))
|
||||
.handler("bytes_command", new Router("command")
|
||||
.handler(TYPE_BYTES_COMMAND, new Router("command")
|
||||
.handler("run_project", data -> {
|
||||
launchProject(data.get("dir").getAsString());
|
||||
return true;
|
||||
@@ -127,7 +123,7 @@ public class DevPluginResponseHandler implements Handler {
|
||||
.launch(AutoJs.getInstance().getScriptEngineService());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
GlobalAppContext.toast(R.string.text_invalid_project);
|
||||
GlobalAppContext.toast(R.string.text_invalid_project, Toast.LENGTH_LONG);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -158,7 +154,7 @@ public class DevPluginResponseHandler implements Handler {
|
||||
File file = new File(Pref.getScriptDirPath(), name);
|
||||
PFiles.ensureDir(file.getPath());
|
||||
PFiles.write(file, script);
|
||||
GlobalAppContext.toast(R.string.text_script_save_successfully);
|
||||
GlobalAppContext.toast(R.string.text_script_save_successfully, Toast.LENGTH_LONG);
|
||||
}
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
@@ -168,17 +164,23 @@ public class DevPluginResponseHandler implements Handler {
|
||||
name = "untitled";
|
||||
}
|
||||
name = PFiles.getNameWithoutExtension(name);
|
||||
|
||||
File toDir = new File(Pref.getScriptDirPath(), name);
|
||||
Callable<String> stringCallable = () -> {
|
||||
copyDir(new File(dir), toDir);
|
||||
return toDir.getPath();
|
||||
};
|
||||
|
||||
Consumer<String> stringConsumer = dest -> GlobalAppContext
|
||||
.toast(R.string.text_project_save_success + "\n" + dest, Toast.LENGTH_LONG);
|
||||
Consumer<Throwable> throwableConsumer = err -> GlobalAppContext
|
||||
.toast(R.string.text_project_save_error + "\n" + err.getMessage(), Toast.LENGTH_LONG);
|
||||
|
||||
Observable
|
||||
.fromCallable(() -> {
|
||||
copyDir(new File(dir), toDir);
|
||||
return toDir.getPath();
|
||||
})
|
||||
.fromCallable(stringCallable)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(dest -> GlobalAppContext.toast(R.string.text_project_save_success + "\n" + dest, Toast.LENGTH_LONG),
|
||||
err -> GlobalAppContext.toast(R.string.text_project_save_error + "\n" + err.getMessage(), Toast.LENGTH_LONG)
|
||||
);
|
||||
.subscribe(stringConsumer, throwableConsumer);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ import io.reactivex.subjects.PublishSubject;
|
||||
/**
|
||||
* Created by Stardust on 2017/5/11.
|
||||
*/
|
||||
|
||||
public class DevPluginService {
|
||||
|
||||
public static DevPluginService getInstance() {
|
||||
@@ -70,6 +69,7 @@ public class DevPluginService {
|
||||
}
|
||||
|
||||
public static final String TYPE_HELLO = "hello";
|
||||
public static final String TYPE_COMMAND = "command";
|
||||
public static final String TYPE_BYTES_COMMAND = "bytes_command";
|
||||
public static final int HANDSHAKE_TIMEOUT = JsonSocket.HANDSHAKE_TIMEOUT;
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.google.gson.JsonObject;
|
||||
/**
|
||||
* Created by Stardust on 2017/5/11.
|
||||
*/
|
||||
|
||||
public interface Handler {
|
||||
|
||||
boolean handle(JsonObject data);
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.stardust.app.GlobalAppContext;
|
||||
import com.stardust.autojs.runtime.api.Device;
|
||||
import com.stardust.util.MapBuilder;
|
||||
|
||||
import org.autojs.autojs.BuildConfig;
|
||||
import org.autojs.autojs6.BuildConfig;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
|
||||
@@ -11,7 +11,6 @@ import java.util.Map;
|
||||
/**
|
||||
* Created by Stardust on 2017/5/11.
|
||||
*/
|
||||
|
||||
public class Router implements Handler {
|
||||
|
||||
private static final String LOG_TAG = "Router";
|
||||
|
||||
@@ -5,8 +5,6 @@ import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
|
||||
import org.autojs.autojs.timing.IntentTask;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package org.autojs.autojs.storage.database;
|
||||
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/11/28.
|
||||
*/
|
||||
|
||||
public class ModelChange<M> {
|
||||
|
||||
public static final int INSERT = 1;
|
||||
@@ -28,6 +29,7 @@ public class ModelChange<M> {
|
||||
return mAction;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ModelChange{" +
|
||||
|
||||
@@ -19,7 +19,7 @@ public class FileObservable {
|
||||
}
|
||||
|
||||
private static Observable<File> copy(String fromPath, String toPath, boolean deleteOld) {
|
||||
return new Observable<File>() {
|
||||
return new Observable<>() {
|
||||
@Override
|
||||
protected void subscribeActual(Observer<? super File> observer) {
|
||||
try {
|
||||
|
||||
@@ -10,7 +10,6 @@ import java.io.IOException;
|
||||
/**
|
||||
* Created by Stardust on 2017/10/21.
|
||||
*/
|
||||
|
||||
public class TmpScriptFiles {
|
||||
|
||||
public static File create(Context context) throws IOException {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.autojs.autojs.theme;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
|
||||
@@ -10,7 +9,7 @@ import androidx.appcompat.app.AppCompatDelegate;
|
||||
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
|
||||
import org.autojs.autojs.R;
|
||||
import org.autojs.autojs6.R;
|
||||
|
||||
import com.stardust.theme.ThemeColor;
|
||||
import com.stardust.theme.ThemeColorManager;
|
||||
@@ -18,7 +17,6 @@ import com.stardust.theme.ThemeColorManager;
|
||||
/**
|
||||
* Created by Stardust on 2017/3/12.
|
||||
*/
|
||||
|
||||
public class ThemeColorManagerCompat {
|
||||
|
||||
private static SharedPreferences sSharedPreferences;
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.stardust.theme.ThemeColorMutable;
|
||||
/**
|
||||
* Created by Stardust on 2017/3/5.
|
||||
*/
|
||||
|
||||
public class ThemeColorMaterialDialogBuilder extends MaterialDialog.Builder implements ThemeColorMutable {
|
||||
public ThemeColorMaterialDialogBuilder(@NonNull Context context) {
|
||||
super(context);
|
||||
|
||||
@@ -12,7 +12,6 @@ import com.stardust.theme.ThemeColorMutable;
|
||||
/**
|
||||
* Created by Stardust on 2017/5/10.
|
||||
*/
|
||||
|
||||
public class ThemeColorImageViewCompat extends AppCompatImageView implements ThemeColorMutable {
|
||||
private int mColor;
|
||||
|
||||
|
||||
@@ -11,7 +11,6 @@ import com.stardust.theme.ThemeColorMutable;
|
||||
/**
|
||||
* Created by Stardust on 2018/1/23.
|
||||
*/
|
||||
|
||||
public class ThemeColorSwipeRefreshLayout extends SwipeRefreshLayout implements ThemeColorMutable {
|
||||
public ThemeColorSwipeRefreshLayout(Context context) {
|
||||
super(context);
|
||||
|
||||
@@ -5,13 +5,11 @@ import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import org.autojs.autojs.App;
|
||||
import org.autojs.autojs.external.ScriptIntents;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/11/27.
|
||||
*/
|
||||
|
||||
public class TaskReceiver extends BroadcastReceiver {
|
||||
|
||||
public static final String ACTION_TASK = "com.stardust.autojs.action.task";
|
||||
|
||||
@@ -4,6 +4,8 @@ import android.app.PendingIntent;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.stardust.autojs.execution.ExecutionConfig;
|
||||
|
||||
import org.autojs.autojs.external.ScriptIntents;
|
||||
@@ -195,6 +197,7 @@ public class TimedTask extends BaseModel {
|
||||
createIntent(), PendingIntent.FLAG_UPDATE_CURRENT);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TimedTask{" +
|
||||
|
||||
@@ -25,9 +25,9 @@ import io.reactivex.Observable;
|
||||
public class TimedTaskManager {
|
||||
|
||||
private static TimedTaskManager sInstance;
|
||||
private Context mContext;
|
||||
private TimedTaskDatabase mTimedTaskDatabase;
|
||||
private IntentTaskDatabase mIntentTaskDatabase;
|
||||
private final Context mContext;
|
||||
private final TimedTaskDatabase mTimedTaskDatabase;
|
||||
private final IntentTaskDatabase mIntentTaskDatabase;
|
||||
|
||||
public static TimedTaskManager getInstance() {
|
||||
if (sInstance == null) {
|
||||
|
||||
@@ -22,7 +22,6 @@ import io.reactivex.schedulers.Schedulers;
|
||||
/**
|
||||
* Created by Stardust on 2017/11/27.
|
||||
*/
|
||||
|
||||
public class TimedTaskScheduler {
|
||||
|
||||
private static final String LOG_TAG = "TimedTaskScheduler";
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.graphics.drawable.Drawable;
|
||||
/**
|
||||
* Created by Stardust on 2017/4/22.
|
||||
*/
|
||||
|
||||
public class BitmapTool {
|
||||
|
||||
public static Bitmap scaleBitmap(Bitmap origin, int newWidth, int newHeight) {
|
||||
|
||||
17
app/src/main/java/org/autojs/autojs/tool/ConsoleTool.java
Normal file
17
app/src/main/java/org/autojs/autojs/tool/ConsoleTool.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package org.autojs.autojs.tool;
|
||||
|
||||
import android.content.Intent;
|
||||
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
|
||||
import org.autojs.autojs.ui.log.LogActivity_;
|
||||
|
||||
public class ConsoleTool {
|
||||
|
||||
public static void launch() {
|
||||
LogActivity_.intent(GlobalAppContext.get())
|
||||
.flags(Intent.FLAG_ACTIVITY_NEW_TASK)
|
||||
.start();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -3,13 +3,14 @@ package org.autojs.autojs.tool;
|
||||
/* Created by Stardust on 2017/2/2 */
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.stardust.app.GlobalAppContext;
|
||||
|
||||
import org.autojs.autojs.BuildConfig;
|
||||
import org.autojs.autojs6.BuildConfig;
|
||||
import org.mozilla.javascript.RhinoException;
|
||||
|
||||
import com.stardust.view.accessibility.AccessibilityService;
|
||||
@@ -25,7 +26,7 @@ public class CrashHandler extends CrashReport.CrashHandleCallback implements Unc
|
||||
private static long firstCrashMillis = 0;
|
||||
private final Class<?> mErrorReportClass;
|
||||
private UncaughtExceptionHandler mBuglyHandler;
|
||||
private UncaughtExceptionHandler mSystemHandler;
|
||||
private final UncaughtExceptionHandler mSystemHandler;
|
||||
|
||||
public CrashHandler(Class<?> errorReportClass) {
|
||||
this.mErrorReportClass = errorReportClass;
|
||||
@@ -36,7 +37,7 @@ public class CrashHandler extends CrashReport.CrashHandleCallback implements Unc
|
||||
mBuglyHandler = buglyHandler;
|
||||
}
|
||||
|
||||
public void uncaughtException(Thread thread, Throwable ex) {
|
||||
public void uncaughtException(@NonNull Thread thread, @NonNull Throwable ex) {
|
||||
Log.e(TAG, "Uncaught Exception", ex);
|
||||
if (thread != Looper.getMainLooper().getThread()) {
|
||||
if(!(ex instanceof RhinoException)){
|
||||
|
||||
@@ -9,7 +9,6 @@ import java.util.List;
|
||||
/**
|
||||
* Created by Stardust on 2017/7/21.
|
||||
*/
|
||||
|
||||
public class GsonUtils {
|
||||
|
||||
public static List<String> toReservedStringList(JsonElement element) {
|
||||
|
||||
@@ -5,28 +5,23 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
|
||||
import com.stardust.app.OnActivityResultDelegate;
|
||||
import org.autojs.autojs.R;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.InputStream;
|
||||
import org.autojs.autojs6.R;
|
||||
|
||||
/**
|
||||
* Created by Stardust on 2017/3/5.
|
||||
*/
|
||||
|
||||
public class ImageSelector implements OnActivityResultDelegate {
|
||||
|
||||
public interface ImageSelectorCallback {
|
||||
void onImageSelected(ImageSelector selector, Uri uri);
|
||||
}
|
||||
|
||||
private static final String TAG = ImageSelector.class.getSimpleName();
|
||||
|
||||
private static final int REQUEST_CODE = "LOVE HONMUA".hashCode() >> 16;
|
||||
private Activity mActivity;
|
||||
private ImageSelectorCallback mCallback;
|
||||
private final Activity mActivity;
|
||||
private final ImageSelectorCallback mCallback;
|
||||
private final Mediator mMediator;
|
||||
private boolean mDisposable;
|
||||
private Mediator mMediator;
|
||||
|
||||
public ImageSelector(Activity activity, OnActivityResultDelegate.Mediator mediator, ImageSelectorCallback callback) {
|
||||
mediator.addDelegate(REQUEST_CODE, this);
|
||||
@@ -59,5 +54,4 @@ public class ImageSelector implements OnActivityResultDelegate {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@ import android.view.inputmethod.InputMethodManager;
|
||||
/**
|
||||
* Created by Stardust on 2017/12/9.
|
||||
*/
|
||||
|
||||
public class InputMethodTool {
|
||||
|
||||
public static void dismissInputMethod(Context context, View view) {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user