@ -0,0 +1,8 @@
|
|||||||
|
*.iml
|
||||||
|
.gradle
|
||||||
|
/local.properties
|
||||||
|
/.idea
|
||||||
|
.DS_Store
|
||||||
|
/build
|
||||||
|
/captures
|
||||||
|
.externalNativeBuild
|
@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>FakeLocation-master</name>
|
||||||
|
<comment>Project FakeLocation-master created by Buildship.</comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
@ -0,0 +1,13 @@
|
|||||||
|
arguments=
|
||||||
|
auto.sync=false
|
||||||
|
build.scans.enabled=false
|
||||||
|
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
|
||||||
|
connection.project.dir=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
gradle.user.home=
|
||||||
|
java.home=C\:/Program Files/Java/jdk-13.0.1
|
||||||
|
jvm.arguments=
|
||||||
|
offline.mode=false
|
||||||
|
override.workspace.settings=true
|
||||||
|
show.console.view=true
|
||||||
|
show.executions.view=true
|
@ -0,0 +1 @@
|
|||||||
|
/build
|
@ -0,0 +1,40 @@
|
|||||||
|
apply plugin: 'com.android.application'
|
||||||
|
|
||||||
|
def releaseAppName() {
|
||||||
|
return "FakeLocation"
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion 28
|
||||||
|
defaultConfig {
|
||||||
|
applicationId "com.xposed.hook"
|
||||||
|
minSdkVersion 15
|
||||||
|
targetSdkVersion 23
|
||||||
|
versionCode 3
|
||||||
|
versionName "1.0.3"
|
||||||
|
}
|
||||||
|
buildTypes {
|
||||||
|
release {
|
||||||
|
minifyEnabled false
|
||||||
|
applicationVariants.all {
|
||||||
|
variant ->
|
||||||
|
variant.outputs.each {
|
||||||
|
output -> output.outputFileName = "${releaseAppName()}_v${defaultConfig.versionName}.apk"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lintOptions {
|
||||||
|
checkReleaseBuilds false
|
||||||
|
}
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation 'com.android.support:appcompat-v7:28.0.0'
|
||||||
|
implementation 'com.android.support:design:28.0.0'
|
||||||
|
compileOnly 'de.robv.android.xposed:api:82'
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in D:\Android\sdk/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the proguardFiles
|
||||||
|
# directive in build.gradle.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
# Uncomment this to preserve the line number information for
|
||||||
|
# debugging stack traces.
|
||||||
|
#-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
# If you keep the line number information, uncomment this to
|
||||||
|
# hide the original source file name.
|
||||||
|
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.xposed.hook">
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||||
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:allowBackup="true"
|
||||||
|
android:icon="@mipmap/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:resizeableActivity="true"
|
||||||
|
android:supportsRtl="true"
|
||||||
|
android:theme="@style/AppTheme">
|
||||||
|
<meta-data
|
||||||
|
android:name="xposedmodule"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="xposeddescription"
|
||||||
|
android:value="FakeLocation" />
|
||||||
|
<meta-data
|
||||||
|
android:name="xposedminversion"
|
||||||
|
android:value="82" />
|
||||||
|
|
||||||
|
<activity android:name=".MainActivity">
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity android:name=".RimetActivity"></activity>
|
||||||
|
<activity android:name=".LuckMoneySetting"></activity>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1 @@
|
|||||||
|
com.xposed.hook.Main
|
@ -0,0 +1,101 @@
|
|||||||
|
package com.xposed.hook;
|
||||||
|
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.EditText;
|
||||||
|
|
||||||
|
import com.xposed.hook.wechat.LuckyMoneyHook;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/2/4.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LuckMoneySetting extends AppCompatActivity {
|
||||||
|
|
||||||
|
private CompoundButton cb;
|
||||||
|
private CompoundButton cb2;
|
||||||
|
private CompoundButton cb3;
|
||||||
|
private CompoundButton cb4;
|
||||||
|
private EditText et_lucky_money_delay;
|
||||||
|
|
||||||
|
private SharedPreferences sp;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_lucky_money_setting);
|
||||||
|
setTitle(R.string.wechat_hook);
|
||||||
|
cb = (CompoundButton) findViewById(R.id.cb);
|
||||||
|
cb2 = (CompoundButton) findViewById(R.id.cb2);
|
||||||
|
cb3 = (CompoundButton) findViewById(R.id.cb3);
|
||||||
|
cb4 = (CompoundButton) findViewById(R.id.cb4);
|
||||||
|
et_lucky_money_delay = findViewById(R.id.et_lucky_money_delay);
|
||||||
|
sp = getSharedPreferences("lucky_money", MODE_WORLD_READABLE);
|
||||||
|
cb.setChecked(sp.getBoolean("quick_open", true));
|
||||||
|
cb2.setChecked(sp.getBoolean("auto_receive", true));
|
||||||
|
cb3.setChecked(sp.getBoolean("recalled", true));
|
||||||
|
cb4.setChecked(sp.getBoolean("3_days_Moments", false));
|
||||||
|
et_lucky_money_delay.setText(String.valueOf(sp.getInt("lucky_money_delay", 0)));
|
||||||
|
cb.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
sp.edit().putBoolean("quick_open", isChecked).commit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cb2.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
sp.edit().putBoolean("auto_receive", isChecked).commit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cb3.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
sp.edit().putBoolean("recalled", isChecked).commit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cb4.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||||
|
@Override
|
||||||
|
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
|
||||||
|
sp.edit().putBoolean("3_days_Moments", isChecked).commit();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
findViewById(R.id.btn_reboot_app).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
saveLuckyMoneyDelay();
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
intent.setData(Uri.fromParts("package", LuckyMoneyHook.WECHAT_PACKAGE_NAME, null));
|
||||||
|
startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish() {
|
||||||
|
super.finish();
|
||||||
|
saveLuckyMoneyDelay();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void saveLuckyMoneyDelay() {
|
||||||
|
try {
|
||||||
|
int delay = Integer.parseInt(et_lucky_money_delay.getText().toString());
|
||||||
|
sp.edit().putInt("lucky_money_delay", delay).commit();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
package com.xposed.hook;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.xposed.hook.config.Constants;
|
||||||
|
import com.xposed.hook.config.PkgConfig;
|
||||||
|
import com.xposed.hook.location.LocationHook;
|
||||||
|
import com.xposed.hook.wechat.LuckyMoneyHook;
|
||||||
|
|
||||||
|
import de.robv.android.xposed.IXposedHookLoadPackage;
|
||||||
|
import de.robv.android.xposed.XSharedPreferences;
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2017/7/22.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class Main implements IXposedHookLoadPackage {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleLoadPackage(XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable {
|
||||||
|
Log.e("***********************", loadPackageParam.packageName);
|
||||||
|
LuckyMoneyHook.hook(loadPackageParam);
|
||||||
|
XSharedPreferences preferences = new XSharedPreferences("com.xposed.hook", Constants.PREF_FILE_NAME);
|
||||||
|
if (preferences.getBoolean(loadPackageParam.packageName, false)) {
|
||||||
|
String defaultLatitude = Constants.DEFAULT_LATITUDE;
|
||||||
|
String defaultLongitude = Constants.DEFAULT_LONGITUDE;
|
||||||
|
if (PkgConfig.pkg_dingtalk.equals(loadPackageParam.packageName)) {
|
||||||
|
defaultLatitude = "0";
|
||||||
|
defaultLongitude = "0";
|
||||||
|
}
|
||||||
|
String prefix = loadPackageParam.packageName + "_";
|
||||||
|
double latitude = 0;
|
||||||
|
double longitude = 0;
|
||||||
|
try {
|
||||||
|
latitude = Double.parseDouble(preferences.getString(prefix + "latitude", defaultLatitude));
|
||||||
|
longitude = Double.parseDouble(preferences.getString(prefix + "longitude", defaultLongitude));
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
int lac = preferences.getInt(prefix + "lac", Constants.DEFAULT_LAC);
|
||||||
|
int cid = preferences.getInt(prefix + "cid", Constants.DEFAULT_CID);
|
||||||
|
LocationHook.hookAndChange(loadPackageParam, latitude, longitude, lac, cid);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
package com.xposed.hook;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.BaseAdapter;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import com.xposed.hook.entity.AppInfo;
|
||||||
|
import com.xposed.hook.utils.AppUtil;
|
||||||
|
import com.xposed.hook.utils.ViewHolder;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class MainActivity extends AppCompatActivity {
|
||||||
|
|
||||||
|
private ListView lv;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
setContentView(R.layout.activity_main);
|
||||||
|
lv = (ListView) findViewById(R.id.lv);
|
||||||
|
lv.setAdapter(new MyAdapter(getApplicationContext()));
|
||||||
|
lv.setOnItemClickListener((parent, view, position, id) -> {
|
||||||
|
startActivity(new Intent(this, RimetActivity.class)
|
||||||
|
.putExtra("appInfo", (Serializable) lv.getAdapter().getItem(position)));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onCreateOptionsMenu(Menu menu) {
|
||||||
|
MenuInflater inflater = getMenuInflater();
|
||||||
|
inflater.inflate(R.menu.menu_main, menu);
|
||||||
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int id = item.getItemId();
|
||||||
|
if (id == R.id.item_luck_money) {
|
||||||
|
startActivity(new Intent(this, LuckMoneySetting.class));
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return super.onOptionsItemSelected(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class MyAdapter extends BaseAdapter {
|
||||||
|
|
||||||
|
private List<AppInfo> list;
|
||||||
|
|
||||||
|
public MyAdapter(Context context) {
|
||||||
|
list = AppUtil.getAppList(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return list.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AppInfo getItem(int position) {
|
||||||
|
return list.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
if (convertView == null)
|
||||||
|
convertView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_package, parent, false);
|
||||||
|
ImageView iv_icon = ViewHolder.get(convertView, R.id.iv_icon);
|
||||||
|
TextView tv_title = ViewHolder.get(convertView, R.id.tv_title);
|
||||||
|
TextView tv_package = ViewHolder.get(convertView, R.id.tv_package);
|
||||||
|
AppInfo pkg = list.get(position);
|
||||||
|
iv_icon.setImageDrawable(pkg.icon);
|
||||||
|
tv_title.setText(pkg.title);
|
||||||
|
tv_package.setText(pkg.packageName);
|
||||||
|
return convertView;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,269 @@
|
|||||||
|
package com.xposed.hook;
|
||||||
|
|
||||||
|
import android.Manifest;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationListener;
|
||||||
|
import android.location.LocationManager;
|
||||||
|
import android.net.Uri;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.provider.Settings;
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.design.widget.TabLayout;
|
||||||
|
import android.support.v4.app.ActivityCompat;
|
||||||
|
import android.support.v7.app.AppCompatActivity;
|
||||||
|
import android.telephony.CellLocation;
|
||||||
|
import android.telephony.PhoneStateListener;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
|
import android.telephony.gsm.GsmCellLocation;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.EditText;
|
||||||
|
import android.widget.TextView;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.xposed.hook.config.Constants;
|
||||||
|
import com.xposed.hook.config.PkgConfig;
|
||||||
|
import com.xposed.hook.entity.AppInfo;
|
||||||
|
|
||||||
|
public class RimetActivity extends AppCompatActivity implements View.OnClickListener {
|
||||||
|
|
||||||
|
private SharedPreferences sp;
|
||||||
|
|
||||||
|
private TabLayout tabLayout;
|
||||||
|
private TabLayout.Tab gpsTab;
|
||||||
|
private TabLayout.Tab cellTab;
|
||||||
|
|
||||||
|
private View ll_gps;
|
||||||
|
private EditText etLatitude;
|
||||||
|
private EditText etLongitude;
|
||||||
|
private TextView tvLatitude;
|
||||||
|
private TextView tvLongitude;
|
||||||
|
private Button btnAutoFillGps;
|
||||||
|
|
||||||
|
private View ll_cell;
|
||||||
|
private EditText etLac;
|
||||||
|
private EditText etCid;
|
||||||
|
private TextView tvLac;
|
||||||
|
private TextView tvCid;
|
||||||
|
private Button btnAutoFillCell;
|
||||||
|
|
||||||
|
private CompoundButton cb;
|
||||||
|
|
||||||
|
private AppInfo appInfo;
|
||||||
|
private boolean isDingTalk;
|
||||||
|
|
||||||
|
TelephonyManager tm;
|
||||||
|
GsmCellLocation l;
|
||||||
|
LocationManager lm;
|
||||||
|
Location gpsL;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
appInfo = (AppInfo) getIntent().getSerializableExtra("appInfo");
|
||||||
|
if (appInfo == null)
|
||||||
|
return;
|
||||||
|
setContentView(R.layout.activity_rimet);
|
||||||
|
setTitle(appInfo.title);
|
||||||
|
isDingTalk = PkgConfig.pkg_dingtalk.equals(appInfo.packageName);
|
||||||
|
tm = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
|
||||||
|
lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
|
||||||
|
String prefix = appInfo.packageName + "_";
|
||||||
|
sp = getSharedPreferences(Constants.PREF_FILE_NAME, MODE_WORLD_READABLE);
|
||||||
|
String defaultLatitude = Constants.DEFAULT_LATITUDE;
|
||||||
|
String defaultLongitude = Constants.DEFAULT_LONGITUDE;
|
||||||
|
if (isDingTalk) {
|
||||||
|
defaultLatitude = "";
|
||||||
|
defaultLongitude = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
ll_gps = findViewById(R.id.ll_gps);
|
||||||
|
etLatitude = (EditText) findViewById(R.id.et_latitude);
|
||||||
|
etLongitude = (EditText) findViewById(R.id.et_longitude);
|
||||||
|
tvLatitude = (TextView) findViewById(R.id.tv_latitude);
|
||||||
|
tvLongitude = (TextView) findViewById(R.id.tv_longitude);
|
||||||
|
btnAutoFillGps = (Button) findViewById(R.id.btn_auto_fill_gps);
|
||||||
|
etLatitude.setText(sp.getString(prefix + "latitude", defaultLatitude));
|
||||||
|
etLongitude.setText(sp.getString(prefix + "longitude", defaultLongitude));
|
||||||
|
btnAutoFillGps.setOnClickListener(this);
|
||||||
|
|
||||||
|
ll_cell = findViewById(R.id.ll_cell);
|
||||||
|
etLac = (EditText) findViewById(R.id.et_lac);
|
||||||
|
etCid = (EditText) findViewById(R.id.et_cid);
|
||||||
|
tvLac = (TextView) findViewById(R.id.tv_lac);
|
||||||
|
tvCid = (TextView) findViewById(R.id.tv_cid);
|
||||||
|
btnAutoFillCell = (Button) findViewById(R.id.btn_auto_fill_cell);
|
||||||
|
int lac = sp.getInt(prefix + "lac", Constants.DEFAULT_LAC);
|
||||||
|
int cid = sp.getInt(prefix + "cid", Constants.DEFAULT_CID);
|
||||||
|
if (lac != Constants.DEFAULT_LAC)
|
||||||
|
etLac.setText(String.valueOf(lac));
|
||||||
|
if (cid != Constants.DEFAULT_CID)
|
||||||
|
etCid.setText(String.valueOf(cid));
|
||||||
|
btnAutoFillCell.setOnClickListener(this);
|
||||||
|
|
||||||
|
initTabLayout();
|
||||||
|
cb = (CompoundButton) findViewById(R.id.cb);
|
||||||
|
cb.setChecked(sp.getBoolean(appInfo.packageName, false));
|
||||||
|
findViewById(R.id.btn_save).setOnClickListener(this);
|
||||||
|
findViewById(R.id.btn_reboot_app).setOnClickListener(this);
|
||||||
|
|
||||||
|
requestPermissions();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initTabLayout() {
|
||||||
|
tabLayout = (TabLayout) findViewById(R.id.tab_layout);
|
||||||
|
gpsTab = tabLayout.newTab().setText(R.string.gps_location);
|
||||||
|
cellTab = tabLayout.newTab().setText(R.string.cell_location);
|
||||||
|
if (isDingTalk) {
|
||||||
|
tabLayout.addTab(cellTab);
|
||||||
|
tabLayout.addTab(gpsTab);
|
||||||
|
ll_gps.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
tabLayout.addTab(gpsTab);
|
||||||
|
tabLayout.addTab(cellTab);
|
||||||
|
ll_cell.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
|
||||||
|
@Override
|
||||||
|
public void onTabSelected(TabLayout.Tab tab) {
|
||||||
|
ll_gps.setVisibility(tab == gpsTab ? View.VISIBLE : View.GONE);
|
||||||
|
ll_cell.setVisibility(tab == gpsTab ? View.GONE : View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabUnselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onTabReselected(TabLayout.Tab tab) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
int id = v.getId();
|
||||||
|
switch (id) {
|
||||||
|
case R.id.btn_auto_fill_cell:
|
||||||
|
etLac.setText(String.valueOf(l.getLac()));
|
||||||
|
etCid.setText(String.valueOf(l.getCid()));
|
||||||
|
break;
|
||||||
|
case R.id.btn_auto_fill_gps:
|
||||||
|
etLatitude.setText(String.valueOf(gpsL.getLatitude()));
|
||||||
|
etLongitude.setText(String.valueOf(gpsL.getLongitude()));
|
||||||
|
break;
|
||||||
|
case R.id.btn_save:
|
||||||
|
String prefix = appInfo.packageName + "_";
|
||||||
|
sp.edit().putString(prefix + "latitude", etLatitude.getText().toString())
|
||||||
|
.putString(prefix + "longitude", etLongitude.getText().toString())
|
||||||
|
.putInt(prefix + "lac", parseInt(etLac.getText().toString()))
|
||||||
|
.putInt(prefix + "cid", parseInt(etCid.getText().toString()))
|
||||||
|
.putBoolean(appInfo.packageName, cb.isChecked())
|
||||||
|
.commit();
|
||||||
|
Toast.makeText(getApplicationContext(), R.string.save_success, Toast.LENGTH_SHORT).show();
|
||||||
|
break;
|
||||||
|
case R.id.btn_reboot_app:
|
||||||
|
try {
|
||||||
|
Intent intent = new Intent();
|
||||||
|
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
|
||||||
|
intent.setData(Uri.fromParts("package", appInfo.packageName, null));
|
||||||
|
startActivity(intent);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private int parseInt(String str) {
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(str);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void finish() {
|
||||||
|
stopLocation();
|
||||||
|
super.finish();
|
||||||
|
}
|
||||||
|
|
||||||
|
PhoneStateListener listener = new PhoneStateListener() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCellLocationChanged(CellLocation location) {
|
||||||
|
if (location instanceof GsmCellLocation) {
|
||||||
|
l = (GsmCellLocation) location;
|
||||||
|
tvLac.setText(getString(R.string.current_lac, String.valueOf(l.getLac())));
|
||||||
|
tvCid.setText(getString(R.string.current_cid, String.valueOf(l.getCid())));
|
||||||
|
btnAutoFillCell.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
LocationListener gpsListener = new LocationListener() {
|
||||||
|
@Override
|
||||||
|
public void onLocationChanged(Location location) {
|
||||||
|
gpsL = location;
|
||||||
|
tvLatitude.setText(getString(R.string.current_latitude, String.valueOf(location.getLatitude())));
|
||||||
|
tvLongitude.setText(getString(R.string.current_longitude, String.valueOf(location.getLongitude())));
|
||||||
|
btnAutoFillGps.setVisibility(View.VISIBLE);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStatusChanged(String provider, int status, Bundle extras) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProviderEnabled(String provider) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onProviderDisabled(String provider) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
private void requestPermissions() {
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_COARSE_LOCATION,
|
||||||
|
Manifest.permission.ACCESS_FINE_LOCATION}, 101);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
startLocation();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
|
||||||
|
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
|
||||||
|
if (requestCode == 101 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
|
||||||
|
startLocation();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void startLocation() {
|
||||||
|
tm.listen(listener, PhoneStateListener.LISTEN_CELL_LOCATION);
|
||||||
|
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
|
||||||
|
&& ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
lm.requestSingleUpdate(LocationManager.GPS_PROVIDER, gpsListener, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopLocation() {
|
||||||
|
tm.listen(listener, PhoneStateListener.LISTEN_NONE);
|
||||||
|
lm.removeUpdates(gpsListener);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.xposed.hook.config;
|
||||||
|
|
||||||
|
public class Constants {
|
||||||
|
|
||||||
|
public static final String PREF_FILE_NAME = "location";
|
||||||
|
|
||||||
|
public static final String DEFAULT_LATITUDE = "34.752600";
|
||||||
|
public static final String DEFAULT_LONGITUDE = "113.662000";
|
||||||
|
public static final int DEFAULT_LAC = -1;
|
||||||
|
public static final int DEFAULT_CID = -1;
|
||||||
|
}
|
@ -0,0 +1,23 @@
|
|||||||
|
package com.xposed.hook.config;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/1/24.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PkgConfig {
|
||||||
|
|
||||||
|
public static final List<String> packages = new ArrayList<>();
|
||||||
|
public static final String pkg_dingtalk = "com.alibaba.android.rimet";
|
||||||
|
|
||||||
|
static {
|
||||||
|
packages.add("com.autonavi.minimap");
|
||||||
|
packages.add("com.team.club");
|
||||||
|
packages.add("com.baidu.BaiduMap");
|
||||||
|
packages.add("com.tencent.mm");
|
||||||
|
packages.add("com.tencent.mobileqq");
|
||||||
|
packages.add("com.sina.weibo");
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package com.xposed.hook.entity;
|
||||||
|
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public class AppInfo implements Serializable {
|
||||||
|
|
||||||
|
public String title;
|
||||||
|
public String packageName;
|
||||||
|
public transient Drawable icon;
|
||||||
|
}
|
@ -0,0 +1,79 @@
|
|||||||
|
package com.xposed.hook.location;
|
||||||
|
|
||||||
|
|
||||||
|
class GPSStateline {
|
||||||
|
private double mAzimuth;
|
||||||
|
private double mElevation;
|
||||||
|
private boolean mHasAlmanac;
|
||||||
|
private boolean mHasEphemeris;
|
||||||
|
private int mPnr;
|
||||||
|
private double mSnr;
|
||||||
|
private boolean mUseInFix;
|
||||||
|
|
||||||
|
|
||||||
|
public double getAzimuth() {
|
||||||
|
return this.mAzimuth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getElevation() {
|
||||||
|
return this.mElevation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPnr() {
|
||||||
|
return this.mPnr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getSnr() {
|
||||||
|
return this.mSnr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHasAlmanac() {
|
||||||
|
return this.mHasAlmanac;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHasEphemeris() {
|
||||||
|
return this.mHasEphemeris;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isUseInFix() {
|
||||||
|
return this.mUseInFix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAzimuth(double azimuth) {
|
||||||
|
this.mAzimuth = azimuth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setElevation(double elevation) {
|
||||||
|
this.mElevation = elevation;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasAlmanac(boolean hasAlmanac) {
|
||||||
|
this.mHasAlmanac = hasAlmanac;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasEphemeris(boolean hasEphemeris) {
|
||||||
|
this.mHasEphemeris = hasEphemeris;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPnr(int pnr) {
|
||||||
|
this.mPnr = pnr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSnr(double snr) {
|
||||||
|
this.mSnr = snr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUseInFix(boolean useInFix) {
|
||||||
|
this.mUseInFix = useInFix;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GPSStateline(int pnr, double snr, double elevation, double azimuth, boolean useInFix, boolean hasAlmanac, boolean hasEphemeris) {
|
||||||
|
this.mPnr = pnr;
|
||||||
|
this.mSnr = snr;
|
||||||
|
this.mElevation = elevation;
|
||||||
|
this.mAzimuth = azimuth;
|
||||||
|
this.mUseInFix = useInFix;
|
||||||
|
this.mHasAlmanac = hasAlmanac;
|
||||||
|
this.mHasEphemeris = hasEphemeris;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,154 @@
|
|||||||
|
package com.xposed.hook.location;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.SystemClock;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2017/8/6.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LocationHandler extends Handler {
|
||||||
|
|
||||||
|
private static LocationHandler instance;
|
||||||
|
public static double latitude, longitude;
|
||||||
|
|
||||||
|
public static LocationHandler getInstance() {
|
||||||
|
if (instance == null) {
|
||||||
|
synchronized (LocationHandler.class) {
|
||||||
|
if (instance == null)
|
||||||
|
instance = new LocationHandler();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
private LocationHandler() {
|
||||||
|
super(Looper.getMainLooper());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void attach(Context context) {
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
try {
|
||||||
|
Object transport = context.getSystemService(Context.LOCATION_SERVICE);
|
||||||
|
try {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
|
notifyGPSStatus(LocationManager.mGnssStatusListeners.get(transport));
|
||||||
|
notifyMNmeaListener(LocationManager.mGnssNmeaListeners.get(transport));
|
||||||
|
notifyGPSStatus(LocationManager.mGpsStatusListeners.get(transport));
|
||||||
|
notifyMNmeaListener(LocationManager.mGpsNmeaListeners.get(transport));
|
||||||
|
} else {
|
||||||
|
notifyGPSStatus(LocationManager.mGpsStatusListeners.get(transport));
|
||||||
|
notifyMNmeaListener(LocationManager.mNmeaListeners.get(transport));
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
notifyLocation(LocationManager.mListeners.get(transport));
|
||||||
|
sendEmptyMessageDelayed(0, 10000);
|
||||||
|
Log.e(LocationHook.TAG, "Avalon Hook Location Success");
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Location createLocation(double latitude, double longitude) {
|
||||||
|
Location l = new Location(android.location.LocationManager.GPS_PROVIDER);
|
||||||
|
l.setLatitude(latitude);
|
||||||
|
l.setLongitude(longitude);
|
||||||
|
l.setAccuracy(8f);
|
||||||
|
l.setTime(System.currentTimeMillis());
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||||
|
l.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());
|
||||||
|
}
|
||||||
|
Bundle extraBundle = new Bundle();
|
||||||
|
l.setExtras(extraBundle);
|
||||||
|
int svCount = VirtualGPSSatalines.get().getSvCount();
|
||||||
|
extraBundle.putInt("satellites", svCount);
|
||||||
|
extraBundle.putInt("satellitesvalue", svCount);
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateLocation(Location location, double latitude, double longitude) {
|
||||||
|
location.setLatitude(latitude);
|
||||||
|
location.setLongitude(longitude);
|
||||||
|
location.setTime(System.currentTimeMillis());
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
||||||
|
location.setElapsedRealtimeNanos(SystemClock.elapsedRealtimeNanos());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void start() {
|
||||||
|
removeMessages(0);
|
||||||
|
sendEmptyMessageDelayed(0, 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void notifyGPSStatus(Map listeners) {
|
||||||
|
if (listeners != null && !listeners.isEmpty()) {
|
||||||
|
//noinspection unchecked
|
||||||
|
Set<Map.Entry> entries = listeners.entrySet();
|
||||||
|
for (Map.Entry entry : entries) {
|
||||||
|
try {
|
||||||
|
Object value = entry.getValue();
|
||||||
|
if (value != null) {
|
||||||
|
MockLocationHelper.invokeSvStatusChanged(value);
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void notifyLocation(Map listeners) {
|
||||||
|
if (listeners != null && !listeners.isEmpty()) {
|
||||||
|
Location location = createLocation(latitude, longitude);
|
||||||
|
//noinspection unchecked
|
||||||
|
Set<Map.Entry> entries = listeners.entrySet();
|
||||||
|
for (Map.Entry entry : entries) {
|
||||||
|
Object value = entry.getValue();
|
||||||
|
if (value != null) {
|
||||||
|
try {
|
||||||
|
Log.e(LocationHook.TAG, value.toString());
|
||||||
|
LocationManager.ListenerTransport.onLocationChanged.call(value, location);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void notifyMNmeaListener(Map listeners) {
|
||||||
|
if (listeners != null && !listeners.isEmpty()) {
|
||||||
|
//noinspection unchecked
|
||||||
|
Set<Map.Entry> entries = listeners.entrySet();
|
||||||
|
for (Map.Entry entry : entries) {
|
||||||
|
try {
|
||||||
|
Object value = entry.getValue();
|
||||||
|
if (value != null) {
|
||||||
|
MockLocationHelper.invokeNmeaReceived(value);
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,234 @@
|
|||||||
|
package com.xposed.hook.location;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationListener;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.telephony.PhoneStateListener;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import com.xposed.hook.location.LocationHandler;
|
||||||
|
import com.xposed.hook.location.PhoneStateListenerDelegate;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
|
|
||||||
|
import de.robv.android.xposed.XC_MethodHook;
|
||||||
|
import de.robv.android.xposed.XposedBridge;
|
||||||
|
import de.robv.android.xposed.XposedHelpers;
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2017/7/23.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LocationHook {
|
||||||
|
|
||||||
|
public static String TAG = "LocationHook";
|
||||||
|
|
||||||
|
public static void hookAndChange(XC_LoadPackage.LoadPackageParam mLpp, final double latitude, final double longitude, final int lac, final int cid) {
|
||||||
|
|
||||||
|
Log.e(TAG, "Avalon Hook Location Test: " + mLpp.packageName);
|
||||||
|
LocationHandler.latitude = latitude;
|
||||||
|
LocationHandler.longitude = longitude;
|
||||||
|
|
||||||
|
hookMethod("android.content.ContextWrapper", mLpp.classLoader, "getApplicationContext", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
LocationHandler.getInstance().attach((Context) param.getResult());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.net.wifi.WifiManager", mLpp.classLoader, "getScanResults",
|
||||||
|
new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param)
|
||||||
|
throws Throwable {
|
||||||
|
param.setResult(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.telephony.TelephonyManager", mLpp.classLoader, "getCellLocation",
|
||||||
|
new XC_MethodHook() {
|
||||||
|
/**
|
||||||
|
* android.telephony.TelephonyManager的getCellLocation方法
|
||||||
|
* Returns the current location of the device.
|
||||||
|
* Return null if current location is not available.
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param)
|
||||||
|
throws Throwable {
|
||||||
|
param.setResult(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.telephony.TelephonyManager", mLpp.classLoader, "getNeighboringCellInfo",
|
||||||
|
new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param)
|
||||||
|
throws Throwable {
|
||||||
|
param.setResult(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethods("android.location.LocationManager", "requestLocationUpdates",
|
||||||
|
new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
|
||||||
|
if (param.args[3] instanceof LocationListener) {
|
||||||
|
//位置监听器,当位置改变时会触发onLocationChanged方法
|
||||||
|
LocationListener ll = (LocationListener) param.args[3];
|
||||||
|
Log.e(TAG, "requestLocationUpdates::: args0: " + param.args[0] + "; arg1: " + param.args[1] + "; arg2: " + param.args[2]);
|
||||||
|
LocationHandler.getInstance().start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.location.LocationManager", mLpp.classLoader, "getLastLocation", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Location l = (Location) param.getResult();
|
||||||
|
if (l != null) {
|
||||||
|
LocationHandler.updateLocation(l, latitude, longitude);
|
||||||
|
param.setResult(l);
|
||||||
|
} else
|
||||||
|
param.setResult(LocationHandler.createLocation(latitude, longitude));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethods("android.location.LocationManager", "getLastKnownLocation", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Location l = (Location) param.getResult();
|
||||||
|
if (l != null) {
|
||||||
|
LocationHandler.updateLocation(l, latitude, longitude);
|
||||||
|
param.setResult(l);
|
||||||
|
} else
|
||||||
|
param.setResult(LocationHandler.createLocation(latitude, longitude));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.location.Location", mLpp.classLoader, "getLatitude", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
param.setResult(latitude);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.location.Location", mLpp.classLoader, "getLongitude", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
param.setResult(longitude);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.net.wifi.WifiInfo", mLpp.classLoader, "getMacAddress", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
param.setResult("00-00-00-00-00-00-00-E0");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.net.wifi.WifiInfo", mLpp.classLoader, "getSSID", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
param.setResult(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethod("android.net.wifi.WifiInfo", mLpp.classLoader, "getBSSID", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
param.setResult("00:00:00:00:00:00");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethods("android.telephony.TelephonyManager", "getSimState", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Log.e(TAG, "getSimState");
|
||||||
|
param.setResult(0);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethods("android.location.LocationManager", "getBestProvider", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Log.e(TAG, "getBestProvider");
|
||||||
|
param.setResult("gps");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethods("android.location.LocationManager", "getProviders", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Log.e(TAG, "getProviders");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
hookMethods("android.location.LocationManager", "isProviderEnabled", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Log.e(TAG, "isProviderEnabled: " + param.args[0]);
|
||||||
|
if ("gps".equals(param.args[0]))
|
||||||
|
param.setResult(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.JELLY_BEAN) {
|
||||||
|
hookMethod("android.telephony.TelephonyManager", mLpp.classLoader,
|
||||||
|
"getAllCellInfo", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Log.e(TAG, "getAllCellInfo");
|
||||||
|
param.setResult(null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
hookMethods("android.telephony.TelephonyManager", "listen", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Log.e(TAG, "TelephonyManager listen");
|
||||||
|
param.args[0] = new PhoneStateListenerDelegate((PhoneStateListener) param.args[0], lac, cid);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//不带参数的方法拦截
|
||||||
|
private static void hookMethod(Class<?> clazz, String methodName, Object... parameterTypesAndCallback) {
|
||||||
|
try {
|
||||||
|
XposedHelpers.findAndHookMethod(clazz, methodName, parameterTypesAndCallback);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.e(TAG, e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//不带参数的方法拦截
|
||||||
|
private static void hookMethod(String className, ClassLoader classLoader, String methodName,
|
||||||
|
Object... parameterTypesAndCallback) {
|
||||||
|
try {
|
||||||
|
XposedHelpers.findAndHookMethod(className, classLoader, methodName, parameterTypesAndCallback);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.e(TAG, e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//带参数的方法拦截
|
||||||
|
private static void hookMethods(String className, String methodName, XC_MethodHook xmh) {
|
||||||
|
try {
|
||||||
|
Class<?> clazz = Class.forName(className);
|
||||||
|
|
||||||
|
for (Method method : clazz.getDeclaredMethods())
|
||||||
|
if (method.getName().equals(methodName)
|
||||||
|
&& !Modifier.isAbstract(method.getModifiers())
|
||||||
|
&& Modifier.isPublic(method.getModifiers())) {
|
||||||
|
XposedBridge.hookMethod(method, xmh);
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.e(TAG, e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,82 @@
|
|||||||
|
package com.xposed.hook.location;
|
||||||
|
|
||||||
|
import android.location.Location;
|
||||||
|
import android.location.LocationListener;
|
||||||
|
import android.os.Bundle;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import mirror.MethodParams;
|
||||||
|
import mirror.RefClass;
|
||||||
|
import mirror.RefMethod;
|
||||||
|
import mirror.RefObject;
|
||||||
|
|
||||||
|
public class LocationManager {
|
||||||
|
public static Class<?> TYPE = RefClass.load(LocationManager.class, "android.location.LocationManager");
|
||||||
|
public static RefObject<HashMap> mGnssNmeaListeners;
|
||||||
|
public static RefObject<HashMap> mGnssStatusListeners;
|
||||||
|
public static RefObject<HashMap> mGpsNmeaListeners;
|
||||||
|
public static RefObject<HashMap> mGpsStatusListeners;
|
||||||
|
public static RefObject<HashMap> mListeners;
|
||||||
|
public static RefObject<HashMap> mNmeaListeners;
|
||||||
|
|
||||||
|
public static class GnssStatusListenerTransport {
|
||||||
|
public static Class<?> TYPE = RefClass.load(GnssStatusListenerTransport.class, "android.location.LocationManager$GnssStatusListenerTransport");
|
||||||
|
public static RefObject<Object> mGpsListener;
|
||||||
|
public static RefObject<Object> mGpsNmeaListener;
|
||||||
|
@MethodParams({int.class})
|
||||||
|
public static RefMethod<Void> onFirstFix;
|
||||||
|
public static RefMethod<Void> onGnssStarted;
|
||||||
|
@MethodParams({long.class, String.class})
|
||||||
|
public static RefMethod<Void> onNmeaReceived;
|
||||||
|
@MethodParams({int.class, int[].class, float[].class, float[].class, float[].class})
|
||||||
|
public static RefMethod<Void> onSvStatusChanged;
|
||||||
|
public static RefObject<Object> this$0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class GpsStatusListenerTransport {
|
||||||
|
public static Class<?> TYPE = RefClass.load(GpsStatusListenerTransport.class, "android.location.LocationManager$GpsStatusListenerTransport");
|
||||||
|
public static RefObject<Object> mListener;
|
||||||
|
public static RefObject<Object> mNmeaListener;
|
||||||
|
@MethodParams({int.class})
|
||||||
|
public static RefMethod<Void> onFirstFix;
|
||||||
|
public static RefMethod<Void> onGpsStarted;
|
||||||
|
@MethodParams({long.class, String.class})
|
||||||
|
public static RefMethod<Void> onNmeaReceived;
|
||||||
|
@MethodParams({int.class, int[].class, float[].class, float[].class, float[].class, int.class, int.class, int.class})
|
||||||
|
public static RefMethod<Void> onSvStatusChanged;
|
||||||
|
public static RefObject<Object> this$0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class GpsStatusListenerTransportOPPO_R815T {
|
||||||
|
public static Class<?> TYPE = RefClass.load(GpsStatusListenerTransportOPPO_R815T.class, "android.location.LocationManager$GpsStatusListenerTransport");
|
||||||
|
@MethodParams({int.class, int[].class, float[].class, float[].class, float[].class, int[].class, int[].class, int[].class, int.class})
|
||||||
|
public static RefMethod<Void> onSvStatusChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class GpsStatusListenerTransportSumsungS5 {
|
||||||
|
public static Class<?> TYPE = RefClass.load(GpsStatusListenerTransportSumsungS5.class, "android.location.LocationManager$GpsStatusListenerTransport");
|
||||||
|
@MethodParams({int.class, int[].class, float[].class, float[].class, float[].class, int.class, int.class, int.class, int[].class})
|
||||||
|
public static RefMethod<Void> onSvStatusChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class GpsStatusListenerTransportVIVO {
|
||||||
|
public static Class<?> TYPE = RefClass.load(GpsStatusListenerTransportVIVO.class, "android.location.LocationManager$GpsStatusListenerTransport");
|
||||||
|
@MethodParams({int.class, int[].class, float[].class, float[].class, float[].class, int.class, int.class, int.class, long[].class})
|
||||||
|
public static RefMethod<Void> onSvStatusChanged;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class ListenerTransport {
|
||||||
|
public static Class<?> TYPE = RefClass.load(ListenerTransport.class, "android.location.LocationManager$ListenerTransport");
|
||||||
|
public static RefObject<LocationListener> mListener;
|
||||||
|
@MethodParams({Location.class})
|
||||||
|
public static RefMethod<Void> onLocationChanged;
|
||||||
|
@MethodParams({String.class})
|
||||||
|
public static RefMethod<Void> onProviderDisabled;
|
||||||
|
@MethodParams({String.class})
|
||||||
|
public static RefMethod<Void> onProviderEnabled;
|
||||||
|
@MethodParams({String.class, int.class, Bundle.class})
|
||||||
|
public static RefMethod<Void> onStatusChanged;
|
||||||
|
public static RefObject<Object> this$0;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,152 @@
|
|||||||
|
package com.xposed.hook.location;
|
||||||
|
|
||||||
|
import android.location.Location;
|
||||||
|
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Lody
|
||||||
|
*/
|
||||||
|
public class MockLocationHelper {
|
||||||
|
|
||||||
|
public static void invokeNmeaReceived(Object listener) {
|
||||||
|
if (listener != null) {
|
||||||
|
VirtualGPSSatalines satalines = VirtualGPSSatalines.get();
|
||||||
|
try {
|
||||||
|
Location location = LocationHandler.createLocation(LocationHandler.latitude, LocationHandler.longitude);
|
||||||
|
if (location != null) {
|
||||||
|
String date = new SimpleDateFormat("HHmmss:SS", Locale.US).format(new Date());
|
||||||
|
String lat = getGPSLat(LocationHandler.latitude);
|
||||||
|
String lon = getGPSLat(LocationHandler.longitude);
|
||||||
|
String latNW = getNorthWest(LocationHandler.latitude);
|
||||||
|
String lonSE = getSouthEast(LocationHandler.longitude);
|
||||||
|
String $GPGGA = checksum(String.format("$GPGGA,%s,%s,%s,%s,%s,1,%s,692,.00,M,.00,M,,,", date, lat, latNW, lon, lonSE, satalines.getSvCount()));
|
||||||
|
String $GPRMC = checksum(String.format("$GPRMC,%s,A,%s,%s,%s,%s,0,0,260717,,,A,", date, lat, latNW, lon, lonSE));
|
||||||
|
if (LocationManager.GnssStatusListenerTransport.onNmeaReceived != null) {
|
||||||
|
LocationManager.GnssStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), "$GPGSV,1,1,04,12,05,159,36,15,41,087,15,19,38,262,30,31,56,146,19,*73");
|
||||||
|
LocationManager.GnssStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), $GPGGA);
|
||||||
|
LocationManager.GnssStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), "$GPVTG,0,T,0,M,0,N,0,K,A,*25");
|
||||||
|
LocationManager.GnssStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), $GPRMC);
|
||||||
|
LocationManager.GnssStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), "$GPGSA,A,2,12,15,19,31,,,,,,,,,604,712,986,*27");
|
||||||
|
} else if (LocationManager.GpsStatusListenerTransport.onNmeaReceived != null) {
|
||||||
|
LocationManager.GpsStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), "$GPGSV,1,1,04,12,05,159,36,15,41,087,15,19,38,262,30,31,56,146,19,*73");
|
||||||
|
LocationManager.GpsStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), $GPGGA);
|
||||||
|
LocationManager.GpsStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), "$GPVTG,0,T,0,M,0,N,0,K,A,*25");
|
||||||
|
LocationManager.GpsStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), $GPRMC);
|
||||||
|
LocationManager.GpsStatusListenerTransport.onNmeaReceived.call(listener, System.currentTimeMillis(), "$GPGSA,A,2,12,15,19,31,,,,,,,,,604,712,986,*27");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void invokeSvStatusChanged(Object transport) {
|
||||||
|
if (transport != null) {
|
||||||
|
VirtualGPSSatalines satalines = VirtualGPSSatalines.get();
|
||||||
|
try {
|
||||||
|
Class<?> aClass = transport.getClass();
|
||||||
|
int svCount;
|
||||||
|
float[] snrs;
|
||||||
|
float[] elevations;
|
||||||
|
float[] azimuths;
|
||||||
|
if (aClass == LocationManager.GnssStatusListenerTransport.TYPE) {
|
||||||
|
svCount = satalines.getSvCount();
|
||||||
|
int[] prnWithFlags = satalines.getPrnWithFlags();
|
||||||
|
snrs = satalines.getSnrs();
|
||||||
|
elevations = satalines.getElevations();
|
||||||
|
azimuths = satalines.getAzimuths();
|
||||||
|
LocationManager.GnssStatusListenerTransport.onSvStatusChanged.call(transport, svCount, prnWithFlags, snrs, elevations, azimuths);
|
||||||
|
} else if (aClass == LocationManager.GpsStatusListenerTransport.TYPE) {
|
||||||
|
svCount = satalines.getSvCount();
|
||||||
|
int[] prns = satalines.getPrns();
|
||||||
|
snrs = satalines.getSnrs();
|
||||||
|
elevations = satalines.getElevations();
|
||||||
|
azimuths = satalines.getAzimuths();
|
||||||
|
int ephemerisMask = satalines.getEphemerisMask();
|
||||||
|
int almanacMask = satalines.getAlmanacMask();
|
||||||
|
int usedInFixMask = satalines.getUsedInFixMask();
|
||||||
|
if (LocationManager.GpsStatusListenerTransport.onSvStatusChanged != null) {
|
||||||
|
LocationManager.GpsStatusListenerTransport.onSvStatusChanged.call(transport, svCount, prns, snrs, elevations, azimuths, ephemerisMask, almanacMask, usedInFixMask);
|
||||||
|
} else if (LocationManager.GpsStatusListenerTransportVIVO.onSvStatusChanged != null) {
|
||||||
|
LocationManager.GpsStatusListenerTransportVIVO.onSvStatusChanged.call(transport, svCount, prns, snrs, elevations, azimuths, ephemerisMask, almanacMask, usedInFixMask, new long[svCount]);
|
||||||
|
} else if (LocationManager.GpsStatusListenerTransportSumsungS5.onSvStatusChanged != null) {
|
||||||
|
LocationManager.GpsStatusListenerTransportSumsungS5.onSvStatusChanged.call(transport, svCount, prns, snrs, elevations, azimuths, ephemerisMask, almanacMask, usedInFixMask, new int[svCount]);
|
||||||
|
} else if (LocationManager.GpsStatusListenerTransportOPPO_R815T.onSvStatusChanged != null) {
|
||||||
|
int len = prns.length;
|
||||||
|
int[] ephemerisMasks = new int[len];
|
||||||
|
for (int i = 0; i < len; i++) {
|
||||||
|
ephemerisMasks[i] = satalines.getEphemerisMask();
|
||||||
|
}
|
||||||
|
int[] almanacMasks = new int[len];
|
||||||
|
for (int i = 0; i < len; i++) {
|
||||||
|
almanacMasks[i] = satalines.getAlmanacMask();
|
||||||
|
}
|
||||||
|
int[] usedInFixMasks = new int[len];
|
||||||
|
for (int i = 0; i < len; i++) {
|
||||||
|
usedInFixMasks[i] = satalines.getUsedInFixMask();
|
||||||
|
}
|
||||||
|
LocationManager.GpsStatusListenerTransportOPPO_R815T.onSvStatusChanged.call(transport, svCount, prns, snrs, elevations, azimuths, ephemerisMasks, almanacMasks, usedInFixMasks, svCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getSouthEast(double longitude) {
|
||||||
|
if (longitude > 0.0d) {
|
||||||
|
return "E";
|
||||||
|
}
|
||||||
|
return "W";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getNorthWest(double latitude) {
|
||||||
|
if (latitude > 0.0d) {
|
||||||
|
return "N";
|
||||||
|
}
|
||||||
|
return "S";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getGPSLat(double v) {
|
||||||
|
int du = (int) v;
|
||||||
|
double fen = (v - (double) du) * 60.0d;
|
||||||
|
return du + leftZeroPad((int) fen, 2) + ":" + String.valueOf(fen).substring(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String leftZeroPad(int num, int size) {
|
||||||
|
return leftZeroPad(String.valueOf(num), size);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String leftZeroPad(String num, int size) {
|
||||||
|
StringBuilder sb = new StringBuilder(size);
|
||||||
|
int i;
|
||||||
|
if (num == null) {
|
||||||
|
for (i = 0; i < size; i++) {
|
||||||
|
sb.append('0');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i = 0; i < size - num.length(); i++) {
|
||||||
|
sb.append('0');
|
||||||
|
}
|
||||||
|
sb.append(num);
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String checksum(String nema) {
|
||||||
|
String checkStr = nema;
|
||||||
|
if (nema.startsWith("$")) {
|
||||||
|
checkStr = nema.substring(1);
|
||||||
|
}
|
||||||
|
int sum = 0;
|
||||||
|
for (int i = 0; i < checkStr.length(); i++) {
|
||||||
|
sum ^= (byte) checkStr.charAt(i);
|
||||||
|
}
|
||||||
|
return nema + "*" + String.format("%02X", sum).toLowerCase();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,30 @@
|
|||||||
|
package com.xposed.hook.location;
|
||||||
|
|
||||||
|
import android.telephony.CellLocation;
|
||||||
|
import android.telephony.PhoneStateListener;
|
||||||
|
import android.telephony.gsm.GsmCellLocation;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/1/25.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class PhoneStateListenerDelegate extends PhoneStateListener {
|
||||||
|
|
||||||
|
private PhoneStateListener delegate;
|
||||||
|
private int lac;
|
||||||
|
private int cid;
|
||||||
|
|
||||||
|
public PhoneStateListenerDelegate(PhoneStateListener delegate, int lac, int cid) {
|
||||||
|
this.delegate = delegate;
|
||||||
|
this.lac = lac;
|
||||||
|
this.cid = cid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onCellLocationChanged(CellLocation location) {
|
||||||
|
if(location instanceof GsmCellLocation) {
|
||||||
|
((GsmCellLocation) location).setLacAndCid(lac, cid);
|
||||||
|
delegate.onCellLocationChanged(location);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,133 @@
|
|||||||
|
package com.xposed.hook.location;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class VirtualGPSSatalines {
|
||||||
|
private static VirtualGPSSatalines INSTANCE;
|
||||||
|
private int mAlmanacMask;
|
||||||
|
private float[] mAzimuths;
|
||||||
|
private float[] mElevations;
|
||||||
|
private int mEphemerisMask;
|
||||||
|
private float[] mSnrs;
|
||||||
|
private int mUsedInFixMask;
|
||||||
|
private int[] pnrs;
|
||||||
|
private int[] prnWithFlags;
|
||||||
|
private int svCount;
|
||||||
|
|
||||||
|
static {
|
||||||
|
INSTANCE = new VirtualGPSSatalines();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getAlmanacMask() {
|
||||||
|
return this.mAlmanacMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float[] getAzimuths() {
|
||||||
|
return this.mAzimuths;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float[] getElevations() {
|
||||||
|
return this.mElevations;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getEphemerisMask() {
|
||||||
|
return this.mEphemerisMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getPrns() {
|
||||||
|
return this.pnrs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public float[] getSnrs() {
|
||||||
|
return this.mSnrs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUsedInFixMask() {
|
||||||
|
return this.mUsedInFixMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static VirtualGPSSatalines get() {
|
||||||
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
private VirtualGPSSatalines() {
|
||||||
|
List<GPSStateline> statelines = new ArrayList<>();
|
||||||
|
statelines.add(new GPSStateline(5, 1.0d, 5.0d, 112.0d, false, true, true));
|
||||||
|
statelines.add(new GPSStateline(13, 13.5d, 23.0d, 53.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(14, 19.1d, 6.0d, 247.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(15, 31.0d, 58.0d, 45.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(18, 0.0d, 52.0d, 309.0d, false, true, true));
|
||||||
|
statelines.add(new GPSStateline(20, 30.1d, 54.0d, 105.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(21, 33.2d, 56.0d, 251.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(22, 0.0d, 14.0d, 299.0d, false, true, true));
|
||||||
|
statelines.add(new GPSStateline(24, 25.9d, 57.0d, 157.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(27, 18.0d, 3.0d, 309.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(28, 18.2d, 3.0d, 42.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(41, 28.8d, 0.0d, 0.0d, false, false, false));
|
||||||
|
statelines.add(new GPSStateline(50, 29.2d, 0.0d, 0.0d, false, true, true));
|
||||||
|
statelines.add(new GPSStateline(67, 14.4d, 2.0d, 92.0d, false, false, false));
|
||||||
|
statelines.add(new GPSStateline(68, 21.2d, 45.0d, 60.0d, false, false, false));
|
||||||
|
statelines.add(new GPSStateline(69, 17.5d, 50.0d, 330.0d, false, true, true));
|
||||||
|
statelines.add(new GPSStateline(70, 22.4d, 7.0d, 291.0d, false, false, false));
|
||||||
|
statelines.add(new GPSStateline(77, 23.8d, 10.0d, 23.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(78, 18.0d, 47.0d, 70.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(79, 22.8d, 41.0d, 142.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(83, 0.2d, 9.0d, 212.0d, false, false, false));
|
||||||
|
statelines.add(new GPSStateline(84, 16.7d, 30.0d, 264.0d, true, true, true));
|
||||||
|
statelines.add(new GPSStateline(85, 12.1d, 20.0d, 317.0d, true, true, true));
|
||||||
|
this.svCount = statelines.size();
|
||||||
|
this.pnrs = new int[statelines.size()];
|
||||||
|
for (int i = 0; i < statelines.size(); i++) {
|
||||||
|
this.pnrs[i] = statelines.get(i).getPnr();
|
||||||
|
}
|
||||||
|
this.mSnrs = new float[statelines.size()];
|
||||||
|
for (int i = 0; i < statelines.size(); i++) {
|
||||||
|
this.mSnrs[i] = (float) statelines.get(i).getSnr();
|
||||||
|
}
|
||||||
|
this.mElevations = new float[statelines.size()];
|
||||||
|
for (int i = 0; i < statelines.size(); i++) {
|
||||||
|
this.mElevations[i] = (float) statelines.get(i).getElevation();
|
||||||
|
}
|
||||||
|
this.mAzimuths = new float[statelines.size()];
|
||||||
|
for (int i = 0; i < statelines.size(); i++) {
|
||||||
|
this.mAzimuths[i] = (float) statelines.get(i).getAzimuth();
|
||||||
|
}
|
||||||
|
this.mEphemerisMask = 0;
|
||||||
|
for (int i = 0; i < statelines.size(); i++) {
|
||||||
|
if (statelines.get(i).isHasEphemeris()) {
|
||||||
|
this.mEphemerisMask |= 1 << (statelines.get(i).getPnr() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.mAlmanacMask = 0;
|
||||||
|
for (int i = 0; i < statelines.size(); i++) {
|
||||||
|
if (statelines.get(i).isHasAlmanac()) {
|
||||||
|
this.mAlmanacMask |= 1 << (statelines.get(i).getPnr() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.mUsedInFixMask = 0;
|
||||||
|
for (int i = 0; statelines.size() > i; i++) {
|
||||||
|
if (statelines.get(i).isUseInFix()) {
|
||||||
|
this.mUsedInFixMask |= 1 << (statelines.get(i).getPnr() - 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.prnWithFlags = new int[statelines.size()];
|
||||||
|
for (int i = 0; i < statelines.size(); i++) {
|
||||||
|
GPSStateline gpsStateline = statelines.get(i);
|
||||||
|
this.prnWithFlags[i] =
|
||||||
|
(gpsStateline.isHasEphemeris() ? 1 : 0)
|
||||||
|
| (gpsStateline.isHasAlmanac() ? 1 : 0) << 1
|
||||||
|
| (gpsStateline.isUseInFix() ? 1 : 0) << 2
|
||||||
|
| 8
|
||||||
|
| (gpsStateline.getPnr() << 7);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSvCount() {
|
||||||
|
return this.svCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int[] getPrnWithFlags() {
|
||||||
|
return this.prnWithFlags;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,33 @@
|
|||||||
|
package com.xposed.hook.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
|
||||||
|
import com.xposed.hook.config.PkgConfig;
|
||||||
|
import com.xposed.hook.entity.AppInfo;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public class AppUtil {
|
||||||
|
|
||||||
|
public static ArrayList<AppInfo> getAppList(Context context) {
|
||||||
|
ArrayList<AppInfo> apps = new ArrayList<>();
|
||||||
|
List<PackageInfo> installedPackages = context.getPackageManager().getInstalledPackages(0);
|
||||||
|
for (PackageInfo installedPackage : installedPackages) {
|
||||||
|
if ((installedPackage.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0) {
|
||||||
|
AppInfo app = new AppInfo();
|
||||||
|
app.packageName = installedPackage.packageName;
|
||||||
|
app.title = installedPackage.applicationInfo.loadLabel(context.getPackageManager()).toString();
|
||||||
|
app.icon = installedPackage.applicationInfo.loadIcon(context.getPackageManager());
|
||||||
|
if (PkgConfig.pkg_dingtalk.equals(app.packageName))
|
||||||
|
apps.add(0, app);
|
||||||
|
else
|
||||||
|
apps.add(app);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return apps;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
package com.xposed.hook.utils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/9/18.
|
||||||
|
*/
|
||||||
|
public class Tag {
|
||||||
|
|
||||||
|
private String mPath;
|
||||||
|
private String mName;
|
||||||
|
private ArrayList<Tag> mChildren = new ArrayList<>();
|
||||||
|
private String mContent;
|
||||||
|
|
||||||
|
Tag(String path, String name) {
|
||||||
|
mPath = path;
|
||||||
|
mName = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
void addChild(Tag tag) {
|
||||||
|
mChildren.add(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
void setContent(String content) {
|
||||||
|
boolean hasContent = false;
|
||||||
|
if (content != null) {
|
||||||
|
for (int i = 0; i < content.length(); ++i) {
|
||||||
|
char c = content.charAt(i);
|
||||||
|
if ((c != ' ') && (c != '\n')) {
|
||||||
|
hasContent = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (hasContent) {
|
||||||
|
mContent = content;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String getName() {
|
||||||
|
return mName;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getContent() {
|
||||||
|
return mContent;
|
||||||
|
}
|
||||||
|
|
||||||
|
ArrayList<Tag> getChildren() {
|
||||||
|
return mChildren;
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean hasChildren() {
|
||||||
|
return (mChildren.size() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int getChildrenCount() {
|
||||||
|
return mChildren.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
Tag getChild(int index) {
|
||||||
|
if ((index >= 0) && (index < mChildren.size())) {
|
||||||
|
return mChildren.get(index);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
HashMap<String, ArrayList<Tag>> getGroupedElements() {
|
||||||
|
HashMap<String, ArrayList<Tag>> groups = new HashMap<>();
|
||||||
|
for (Tag child : mChildren) {
|
||||||
|
String key = child.getName();
|
||||||
|
ArrayList<Tag> group = groups.get(key);
|
||||||
|
if (group == null) {
|
||||||
|
group = new ArrayList<>();
|
||||||
|
groups.put(key, group);
|
||||||
|
}
|
||||||
|
group.add(child);
|
||||||
|
}
|
||||||
|
return groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
String getPath() {
|
||||||
|
return mPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "Tag: " + mName + ", " + mChildren.size() + " children, Content: " + mContent;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,25 @@
|
|||||||
|
package com.xposed.hook.utils;
|
||||||
|
|
||||||
|
import android.util.SparseArray;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/1/24.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class ViewHolder {
|
||||||
|
|
||||||
|
public static <T extends View> T get(View view, int id) {
|
||||||
|
SparseArray<View> viewHolder = (SparseArray<View>) view.getTag();
|
||||||
|
if (viewHolder == null) {
|
||||||
|
viewHolder = new SparseArray<View>();
|
||||||
|
view.setTag(viewHolder);
|
||||||
|
}
|
||||||
|
View childView = viewHolder.get(id);
|
||||||
|
if (childView == null) {
|
||||||
|
childView = view.findViewById(id);
|
||||||
|
viewHolder.put(id, childView);
|
||||||
|
}
|
||||||
|
return (T) childView;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,433 @@
|
|||||||
|
package com.xposed.hook.utils;
|
||||||
|
|
||||||
|
import android.support.annotation.NonNull;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import org.xmlpull.v1.XmlPullParser;
|
||||||
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
import org.xmlpull.v1.XmlPullParserFactory;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.StringReader;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/9/18.
|
||||||
|
*/
|
||||||
|
public class XmlToJson {
|
||||||
|
|
||||||
|
private static final String TAG = "XmlToJson";
|
||||||
|
private static final String DEFAULT_CONTENT_NAME = "content";
|
||||||
|
private static final String DEFAULT_ENCODING = "utf-8";
|
||||||
|
private static final String DEFAULT_INDENTATION = " ";
|
||||||
|
private String mIndentationPattern = DEFAULT_INDENTATION;
|
||||||
|
|
||||||
|
// default values when a Tag is empty
|
||||||
|
private static final String DEFAULT_EMPTY_STRING = "";
|
||||||
|
private static final int DEFAULT_EMPTY_INTEGER = 0;
|
||||||
|
private static final long DEFAULT_EMPTY_LONG = 0;
|
||||||
|
private static final double DEFAULT_EMPTY_DOUBLE = 0;
|
||||||
|
private static final boolean DEFAULT_EMPTY_BOOLEAN = false;
|
||||||
|
|
||||||
|
|
||||||
|
public static class Builder {
|
||||||
|
|
||||||
|
private StringReader mStringSource;
|
||||||
|
private String mInputEncoding = DEFAULT_ENCODING;
|
||||||
|
private HashSet<String> mForceListPaths = new HashSet<>();
|
||||||
|
private HashMap<String, String> mAttributeNameReplacements = new HashMap<>();
|
||||||
|
private HashMap<String, String> mContentNameReplacements = new HashMap<>();
|
||||||
|
private HashMap<String, Class> mForceClassForPath = new HashMap<>(); // Integer, Long, Double, Boolean
|
||||||
|
private HashSet<String> mSkippedAttributes = new HashSet<>();
|
||||||
|
private HashSet<String> mSkippedTags = new HashSet<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Constructor
|
||||||
|
*
|
||||||
|
* @param xmlSource XML source
|
||||||
|
*/
|
||||||
|
public Builder(@NonNull String xmlSource) {
|
||||||
|
mStringSource = new StringReader(xmlSource);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the XmlToJson object
|
||||||
|
*/
|
||||||
|
public JSONObject build() {
|
||||||
|
try {
|
||||||
|
return new JSONObject(new XmlToJson(this).toString());
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private StringReader mStringSource;
|
||||||
|
private InputStream mInputStreamSource;
|
||||||
|
private String mInputEncoding;
|
||||||
|
private HashSet<String> mForceListPaths;
|
||||||
|
private HashMap<String, String> mAttributeNameReplacements;
|
||||||
|
private HashMap<String, String> mContentNameReplacements;
|
||||||
|
private HashMap<String, Class> mForceClassForPath;
|
||||||
|
private HashSet<String> mSkippedAttributes = new HashSet<>();
|
||||||
|
private HashSet<String> mSkippedTags = new HashSet<>();
|
||||||
|
private JSONObject mJsonObject; // Used for caching the result
|
||||||
|
|
||||||
|
private XmlToJson(Builder builder) {
|
||||||
|
mStringSource = builder.mStringSource;
|
||||||
|
mInputEncoding = builder.mInputEncoding;
|
||||||
|
mForceListPaths = builder.mForceListPaths;
|
||||||
|
mAttributeNameReplacements = builder.mAttributeNameReplacements;
|
||||||
|
mContentNameReplacements = builder.mContentNameReplacements;
|
||||||
|
mForceClassForPath = builder.mForceClassForPath;
|
||||||
|
mSkippedAttributes = builder.mSkippedAttributes;
|
||||||
|
mSkippedTags = builder.mSkippedTags;
|
||||||
|
|
||||||
|
mJsonObject = convertToJSONObject(); // Build now so that the InputStream can be closed just after
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private
|
||||||
|
@Nullable
|
||||||
|
JSONObject convertToJSONObject() {
|
||||||
|
try {
|
||||||
|
Tag parentTag = new Tag("", "xml");
|
||||||
|
|
||||||
|
XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
|
||||||
|
factory.setNamespaceAware(false); // tags with namespace are taken as-is ("namespace:tagname")
|
||||||
|
XmlPullParser xpp = factory.newPullParser();
|
||||||
|
|
||||||
|
setInput(xpp);
|
||||||
|
|
||||||
|
int eventType = xpp.getEventType();
|
||||||
|
while (eventType != XmlPullParser.START_DOCUMENT) {
|
||||||
|
eventType = xpp.next();
|
||||||
|
}
|
||||||
|
readTags(parentTag, xpp);
|
||||||
|
|
||||||
|
unsetInput();
|
||||||
|
|
||||||
|
return convertTagToJson(parentTag, false);
|
||||||
|
} catch (XmlPullParserException | IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setInput(XmlPullParser xpp) {
|
||||||
|
if (mStringSource != null) {
|
||||||
|
try {
|
||||||
|
xpp.setInput(mStringSource);
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
try {
|
||||||
|
xpp.setInput(mInputStreamSource, mInputEncoding);
|
||||||
|
} catch (XmlPullParserException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void unsetInput() {
|
||||||
|
if (mStringSource != null) {
|
||||||
|
mStringSource.close();
|
||||||
|
}
|
||||||
|
// else the InputStream has been given by the user, it is not our role to close it
|
||||||
|
}
|
||||||
|
|
||||||
|
private void readTags(Tag parent, XmlPullParser xpp) {
|
||||||
|
try {
|
||||||
|
int eventType;
|
||||||
|
do {
|
||||||
|
eventType = xpp.next();
|
||||||
|
if (eventType == XmlPullParser.START_TAG) {
|
||||||
|
String tagName = xpp.getName();
|
||||||
|
String path = parent.getPath() + "/" + tagName;
|
||||||
|
|
||||||
|
boolean skipTag = mSkippedTags.contains(path);
|
||||||
|
|
||||||
|
Tag child = new Tag(path, tagName);
|
||||||
|
if (!skipTag) {
|
||||||
|
parent.addChild(child);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Attributes are taken into account as key/values in the child
|
||||||
|
int attrCount = xpp.getAttributeCount();
|
||||||
|
for (int i = 0; i < attrCount; ++i) {
|
||||||
|
String attrName = xpp.getAttributeName(i);
|
||||||
|
String attrValue = xpp.getAttributeValue(i);
|
||||||
|
String attrPath = parent.getPath() + "/" + child.getName() + "/" + attrName;
|
||||||
|
|
||||||
|
// Skip Attributes
|
||||||
|
if (mSkippedAttributes.contains(attrPath)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
attrName = getAttributeNameReplacement(attrPath, attrName);
|
||||||
|
Tag attribute = new Tag(attrPath, attrName);
|
||||||
|
attribute.setContent(attrValue);
|
||||||
|
child.addChild(attribute);
|
||||||
|
}
|
||||||
|
|
||||||
|
readTags(child, xpp);
|
||||||
|
} else if (eventType == XmlPullParser.TEXT) {
|
||||||
|
String text = xpp.getText();
|
||||||
|
parent.setContent(text);
|
||||||
|
} else if (eventType == XmlPullParser.END_TAG) {
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
Log.i(TAG, "unknown xml eventType " + eventType);
|
||||||
|
}
|
||||||
|
} while (eventType != XmlPullParser.END_DOCUMENT);
|
||||||
|
} catch (XmlPullParserException | IOException | NullPointerException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private JSONObject convertTagToJson(Tag tag, boolean isListElement) {
|
||||||
|
JSONObject json = new JSONObject();
|
||||||
|
|
||||||
|
// Content is injected as a key/value
|
||||||
|
if (tag.getContent() != null) {
|
||||||
|
String path = tag.getPath();
|
||||||
|
String name = getContentNameReplacement(path, DEFAULT_CONTENT_NAME);
|
||||||
|
putContent(path, json, name, tag.getContent());
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
|
||||||
|
HashMap<String, ArrayList<Tag>> groups = tag.getGroupedElements(); // groups by tag names so that we can detect lists or single elements
|
||||||
|
for (ArrayList<Tag> group : groups.values()) {
|
||||||
|
|
||||||
|
if (group.size() == 1) { // element, or list of 1
|
||||||
|
Tag child = group.get(0);
|
||||||
|
if (isForcedList(child)) { // list of 1
|
||||||
|
JSONArray list = new JSONArray();
|
||||||
|
list.put(convertTagToJson(child, true));
|
||||||
|
String childrenNames = child.getName();
|
||||||
|
json.put(childrenNames, list);
|
||||||
|
} else { // stand alone element
|
||||||
|
if (child.hasChildren()) {
|
||||||
|
JSONObject jsonChild = convertTagToJson(child, false);
|
||||||
|
json.put(child.getName(), jsonChild);
|
||||||
|
} else {
|
||||||
|
String path = child.getPath();
|
||||||
|
putContent(path, json, child.getName(), child.getContent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else { // list
|
||||||
|
JSONArray list = new JSONArray();
|
||||||
|
for (Tag child : group) {
|
||||||
|
list.put(convertTagToJson(child, true));
|
||||||
|
}
|
||||||
|
String childrenNames = group.get(0).getName();
|
||||||
|
json.put(childrenNames, list);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return json;
|
||||||
|
|
||||||
|
} catch (JSONException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void putContent(String path, JSONObject json, String tag, String content) {
|
||||||
|
try {
|
||||||
|
// checks if the user wants to force a class (Int, Double... for a given path)
|
||||||
|
Class forcedClass = mForceClassForPath.get(path);
|
||||||
|
if (forcedClass == null) { // default behaviour, put it as a String
|
||||||
|
if (content == null) {
|
||||||
|
content = DEFAULT_EMPTY_STRING;
|
||||||
|
}
|
||||||
|
json.put(tag, content);
|
||||||
|
} else {
|
||||||
|
if (forcedClass == Integer.class) {
|
||||||
|
try {
|
||||||
|
Integer number = Integer.parseInt(content);
|
||||||
|
json.put(tag, number);
|
||||||
|
} catch (NumberFormatException exception) {
|
||||||
|
json.put(tag, DEFAULT_EMPTY_INTEGER);
|
||||||
|
}
|
||||||
|
} else if (forcedClass == Long.class) {
|
||||||
|
try {
|
||||||
|
Long number = Long.parseLong(content);
|
||||||
|
json.put(tag, number);
|
||||||
|
} catch (NumberFormatException exception) {
|
||||||
|
json.put(tag, DEFAULT_EMPTY_LONG);
|
||||||
|
}
|
||||||
|
} else if (forcedClass == Double.class) {
|
||||||
|
try {
|
||||||
|
Double number = Double.parseDouble(content);
|
||||||
|
json.put(tag, number);
|
||||||
|
} catch (NumberFormatException exception) {
|
||||||
|
json.put(tag, DEFAULT_EMPTY_DOUBLE);
|
||||||
|
}
|
||||||
|
} else if (forcedClass == Boolean.class) {
|
||||||
|
if (content == null) {
|
||||||
|
json.put(tag, DEFAULT_EMPTY_BOOLEAN);
|
||||||
|
} else if (content.equalsIgnoreCase("true")) {
|
||||||
|
json.put(tag, true);
|
||||||
|
} else if (content.equalsIgnoreCase("false")) {
|
||||||
|
json.put(tag, false);
|
||||||
|
} else {
|
||||||
|
json.put(tag, DEFAULT_EMPTY_BOOLEAN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (JSONException exception) {
|
||||||
|
// keep continue in case of error
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isForcedList(Tag tag) {
|
||||||
|
String path = tag.getPath();
|
||||||
|
return mForceListPaths.contains(path);
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getAttributeNameReplacement(String path, String defaultValue) {
|
||||||
|
String result = mAttributeNameReplacements.get(path);
|
||||||
|
if (result != null) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String getContentNameReplacement(String path, String defaultValue) {
|
||||||
|
String result = mContentNameReplacements.get(path);
|
||||||
|
if (result != null) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
if (mJsonObject != null) {
|
||||||
|
return mJsonObject.toString();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Format the Json with indentation and line breaks.
|
||||||
|
* Uses the last intendation pattern used, or the default one (3 spaces)
|
||||||
|
*
|
||||||
|
* @return the Builder
|
||||||
|
*/
|
||||||
|
public String toFormattedString() {
|
||||||
|
if (mJsonObject != null) {
|
||||||
|
String indent = "";
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
builder.append("{\n");
|
||||||
|
format(mJsonObject, builder, indent);
|
||||||
|
builder.append("}\n");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void format(JSONObject jsonObject, StringBuilder builder, String indent) {
|
||||||
|
Iterator<String> keys = jsonObject.keys();
|
||||||
|
while (keys.hasNext()) {
|
||||||
|
String key = keys.next();
|
||||||
|
builder.append(indent);
|
||||||
|
builder.append(mIndentationPattern);
|
||||||
|
builder.append("\"");
|
||||||
|
builder.append(key);
|
||||||
|
builder.append("\": ");
|
||||||
|
Object value = jsonObject.opt(key);
|
||||||
|
if (value instanceof JSONObject) {
|
||||||
|
JSONObject child = (JSONObject) value;
|
||||||
|
builder.append(indent);
|
||||||
|
builder.append("{\n");
|
||||||
|
format(child, builder, indent + mIndentationPattern);
|
||||||
|
builder.append(indent);
|
||||||
|
builder.append(mIndentationPattern);
|
||||||
|
builder.append("}");
|
||||||
|
} else if (value instanceof JSONArray) {
|
||||||
|
JSONArray array = (JSONArray) value;
|
||||||
|
formatArray(array, builder, indent + mIndentationPattern);
|
||||||
|
} else {
|
||||||
|
formatValue(value, builder);
|
||||||
|
}
|
||||||
|
if (keys.hasNext()) {
|
||||||
|
builder.append(",\n");
|
||||||
|
} else {
|
||||||
|
builder.append("\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void formatArray(JSONArray array, StringBuilder builder, String indent) {
|
||||||
|
builder.append("[\n");
|
||||||
|
|
||||||
|
for (int i = 0; i < array.length(); ++i) {
|
||||||
|
Object element = array.opt(i);
|
||||||
|
if (element instanceof JSONObject) {
|
||||||
|
JSONObject child = (JSONObject) element;
|
||||||
|
builder.append(indent);
|
||||||
|
builder.append(mIndentationPattern);
|
||||||
|
builder.append("{\n");
|
||||||
|
format(child, builder, indent + mIndentationPattern);
|
||||||
|
builder.append(indent);
|
||||||
|
builder.append(mIndentationPattern);
|
||||||
|
builder.append("}");
|
||||||
|
} else if (element instanceof JSONArray) {
|
||||||
|
JSONArray child = (JSONArray) element;
|
||||||
|
formatArray(child, builder, indent + mIndentationPattern);
|
||||||
|
} else {
|
||||||
|
formatValue(element, builder);
|
||||||
|
}
|
||||||
|
if (i < array.length() - 1) {
|
||||||
|
builder.append(",");
|
||||||
|
}
|
||||||
|
builder.append("\n");
|
||||||
|
}
|
||||||
|
builder.append(indent);
|
||||||
|
builder.append("]");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void formatValue(Object value, StringBuilder builder) {
|
||||||
|
if (value instanceof String) {
|
||||||
|
String string = (String) value;
|
||||||
|
|
||||||
|
// Escape special characters
|
||||||
|
string = string.replaceAll("\\\\", "\\\\\\\\"); // escape backslash
|
||||||
|
string = string.replaceAll("\"", Matcher.quoteReplacement("\\\"")); // escape double quotes
|
||||||
|
string = string.replaceAll("/", "\\\\/"); // escape slash
|
||||||
|
string = string.replaceAll("\n", "\\\\n").replaceAll("\t", "\\\\t"); // escape \n and \t
|
||||||
|
|
||||||
|
builder.append("\"");
|
||||||
|
builder.append(string);
|
||||||
|
builder.append("\"");
|
||||||
|
} else if (value instanceof Long) {
|
||||||
|
Long longValue = (Long) value;
|
||||||
|
builder.append(longValue);
|
||||||
|
} else if (value instanceof Integer) {
|
||||||
|
Integer intValue = (Integer) value;
|
||||||
|
builder.append(intValue);
|
||||||
|
} else if (value instanceof Boolean) {
|
||||||
|
Boolean bool = (Boolean) value;
|
||||||
|
builder.append(bool);
|
||||||
|
} else if (value instanceof Double) {
|
||||||
|
Double db = (Double) value;
|
||||||
|
builder.append(db);
|
||||||
|
} else {
|
||||||
|
builder.append(value.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,206 @@
|
|||||||
|
package com.xposed.hook.wechat;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Looper;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.widget.Button;
|
||||||
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.xposed.hook.location.LocationHook;
|
||||||
|
import com.xposed.hook.utils.XmlToJson;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.lang.ref.WeakReference;
|
||||||
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import de.robv.android.xposed.XC_MethodHook;
|
||||||
|
import de.robv.android.xposed.XSharedPreferences;
|
||||||
|
import de.robv.android.xposed.XposedBridge;
|
||||||
|
import de.robv.android.xposed.XposedHelpers;
|
||||||
|
import de.robv.android.xposed.callbacks.XC_LoadPackage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/2/2.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class LuckyMoneyHook {
|
||||||
|
|
||||||
|
public static final String WECHAT_PACKAGE_NAME = "com.tencent.mm";
|
||||||
|
|
||||||
|
private static final String tinkerEnableClass = "com.tencent.tinker.loader.shareutil.ShareTinkerInternals";
|
||||||
|
private static final String tinkerEnableMethodName = "abV";
|
||||||
|
|
||||||
|
private static final String luckyMoneyReceiveUI = WECHAT_PACKAGE_NAME + ".plugin.luckymoney.ui.LuckyMoneyNotHookReceiveUI";
|
||||||
|
private static final String receiveUIFunctionName = "onSceneEnd";
|
||||||
|
private static final String receiveUIParamName = WECHAT_PACKAGE_NAME + ".al.n";
|
||||||
|
|
||||||
|
private static final String chatRoomInfoUI = WECHAT_PACKAGE_NAME + ".chatroom.ui.ChatroomInfoUI";
|
||||||
|
private static final String launcherUI = WECHAT_PACKAGE_NAME + ".ui.LauncherUI";
|
||||||
|
private static final String openUIClass = WECHAT_PACKAGE_NAME + ".bs.d";//MicroMsg.PluginHelper
|
||||||
|
private static final String openUIMethodName = "b";
|
||||||
|
|
||||||
|
private static HashSet<String> autoReceiveIds = new HashSet<>();
|
||||||
|
private static WeakReference<Activity> launcherUiActivity;
|
||||||
|
|
||||||
|
private static ToastHandler handler;
|
||||||
|
|
||||||
|
private static long msgId;
|
||||||
|
private static int delay;
|
||||||
|
|
||||||
|
public static void hook(final XC_LoadPackage.LoadPackageParam mLpp) {
|
||||||
|
if (WECHAT_PACKAGE_NAME.equals(mLpp.packageName)) {
|
||||||
|
disableTinker(mLpp);
|
||||||
|
XSharedPreferences preferences = new XSharedPreferences("com.xposed.hook", "lucky_money");
|
||||||
|
delay = preferences.getInt("lucky_money_delay", 0);
|
||||||
|
try {
|
||||||
|
XposedHelpers.findAndHookMethod("android.app.Application", mLpp.classLoader, "attach", Context.class, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Context context = (Context) param.args[0];
|
||||||
|
handler = new ToastHandler(context);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (preferences.getBoolean("quick_open", true))
|
||||||
|
XposedHelpers.findAndHookMethod(luckyMoneyReceiveUI, mLpp.classLoader, receiveUIFunctionName, int.class, int.class, String.class, receiveUIParamName, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
try {
|
||||||
|
Button button = (Button) XposedHelpers.findFirstFieldByExactType(param.thisObject.getClass(), Button.class).get(param.thisObject);
|
||||||
|
if (button.isShown() && button.isClickable()) {
|
||||||
|
button.performClick();
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
Log.e(LocationHook.TAG, e.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (preferences.getBoolean("auto_receive", true)) {
|
||||||
|
XposedHelpers.findAndHookMethod(WechatUnrecalledHook.SQLiteDatabaseClass, mLpp.classLoader, "insert", String.class, String.class, ContentValues.class, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
ContentValues contentValues = (ContentValues) param.args[2];
|
||||||
|
String tableName = (String) param.args[0];
|
||||||
|
if (TextUtils.isEmpty(tableName) || !tableName.equals("message")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Integer type = contentValues.getAsInteger("type");
|
||||||
|
if (null == type) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Long id = contentValues.getAsLong("msgId");
|
||||||
|
if (id != null) {
|
||||||
|
if (id == msgId)
|
||||||
|
XposedBridge.log("wechat msg:" + contentValues.getAsString("content"));
|
||||||
|
msgId = id;
|
||||||
|
}
|
||||||
|
if (handler != null && (type == 436207665 || type == 469762097)) {
|
||||||
|
handler.obtainMessage(0, "Lucky Money is Coming").sendToTarget();
|
||||||
|
openLuckyMoneyReceiveUI(contentValues, mLpp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
XposedHelpers.findAndHookMethod(chatRoomInfoUI, mLpp.classLoader, "onCreate", Bundle.class, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
if (handler != null) {
|
||||||
|
Activity activity = (Activity) param.thisObject;
|
||||||
|
String wechatId = activity.getIntent().getStringExtra("RoomInfo_Id");
|
||||||
|
String status = "Opened";
|
||||||
|
if (autoReceiveIds.contains(wechatId)) {
|
||||||
|
autoReceiveIds.remove(wechatId);
|
||||||
|
status = "Closed";
|
||||||
|
} else
|
||||||
|
autoReceiveIds.add(wechatId);
|
||||||
|
handler.obtainMessage(0, "Group Chat ID:" + wechatId + ",Auto Open LuckyMoneyReceiveUI " + status).sendToTarget();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
XposedHelpers.findAndHookMethod(launcherUI, mLpp.classLoader, "onCreate", Bundle.class, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
launcherUiActivity = new WeakReference<>((Activity) param.thisObject);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
XposedBridge.log(e);
|
||||||
|
}
|
||||||
|
if (preferences.getBoolean("recalled", true))
|
||||||
|
new WechatUnrecalledHook(WECHAT_PACKAGE_NAME).hook(mLpp.classLoader);
|
||||||
|
if (preferences.getBoolean("3_days_Moments", false))
|
||||||
|
WechatUnrecalledHook.hook3DaysMoments(mLpp.classLoader);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void openLuckyMoneyReceiveUI(ContentValues contentValues, XC_LoadPackage.LoadPackageParam lpparam) {
|
||||||
|
int status = contentValues.getAsInteger("status");
|
||||||
|
if (status == 4)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String talker = contentValues.getAsString("talker");
|
||||||
|
if (!autoReceiveIds.contains(talker))
|
||||||
|
return;
|
||||||
|
|
||||||
|
String content = contentValues.getAsString("content");
|
||||||
|
if (!content.startsWith("<msg"))
|
||||||
|
content = content.substring(content.indexOf("<msg"));
|
||||||
|
try {
|
||||||
|
JSONObject wcpayinfo = new XmlToJson.Builder(content).build()
|
||||||
|
.getJSONObject("msg").getJSONObject("appmsg").getJSONObject("wcpayinfo");
|
||||||
|
String nativeUrlString = wcpayinfo.getString("nativeurl");
|
||||||
|
|
||||||
|
if (launcherUiActivity != null && launcherUiActivity.get() != null && handler != null) {
|
||||||
|
handler.postDelayed(() -> {
|
||||||
|
try {
|
||||||
|
Intent param = new Intent();
|
||||||
|
param.putExtra("key_way", 1);
|
||||||
|
param.putExtra("key_native_url", nativeUrlString);
|
||||||
|
param.putExtra("key_username", talker);
|
||||||
|
XposedHelpers.callStaticMethod(XposedHelpers.findClass(openUIClass, lpparam.classLoader),
|
||||||
|
openUIMethodName, launcherUiActivity.get(), "luckymoney", ".ui.LuckyMoneyNotHookReceiveUI", param);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
XposedBridge.log(e);
|
||||||
|
}
|
||||||
|
}, delay);
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
XposedBridge.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void disableTinker(XC_LoadPackage.LoadPackageParam lpparam) {
|
||||||
|
try {
|
||||||
|
XposedHelpers.findAndHookMethod(tinkerEnableClass, lpparam.classLoader, tinkerEnableMethodName, int.class, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
param.setResult(false);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Throwable e) {
|
||||||
|
XposedBridge.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class ToastHandler extends Handler {
|
||||||
|
|
||||||
|
private Context context;
|
||||||
|
|
||||||
|
ToastHandler(Context context) {
|
||||||
|
super(Looper.getMainLooper());
|
||||||
|
this.context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
Toast.makeText(context, (String) msg.obj, Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,194 @@
|
|||||||
|
package com.xposed.hook.wechat;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import static de.robv.android.xposed.XposedHelpers.callMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/2/6.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class WechatMainDBHelper {
|
||||||
|
private Object SQLDB;
|
||||||
|
private HashMap<String, String> mNicknameCache;
|
||||||
|
private HashMap<String, String> mChatroomMemberMap;
|
||||||
|
|
||||||
|
public WechatMainDBHelper(Object dbObject) {
|
||||||
|
SQLDB = dbObject;
|
||||||
|
mNicknameCache = new HashMap<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertSQL(String table, String selection, ContentValues contentValues) {
|
||||||
|
callMethod(SQLDB, "insert", table, selection, contentValues);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cursor rawQuery(String query) {
|
||||||
|
return rawQuery(query, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cursor rawQuery(String query, String[] args) {
|
||||||
|
return (Cursor) callMethod(SQLDB, "rawQuery", query, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SQLUpdate(String table, ContentValues contentValues, String selection, String[] args) {
|
||||||
|
callMethod(SQLDB, "update", table, contentValues, selection, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cursor getMessageBySvrId(String msgSrvId) {
|
||||||
|
String sql = "select * from message where msgsvrid=?";
|
||||||
|
String[] sqlArgs = {msgSrvId};
|
||||||
|
|
||||||
|
return rawQuery(sql, sqlArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertMessage(String talker, int talkerId, String msg) {
|
||||||
|
insertMessage(talker, talkerId, msg, 1, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertSystemMessage(String talker, int talkerId, String msg) {
|
||||||
|
insertMessage(talker, talkerId, msg, 10000, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertSystemMessage(String talker, int talkerId, String msg, long createTime) {
|
||||||
|
insertMessage(talker, talkerId, msg, 10000, createTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void insertMessage(String talker, int talkerId, String msg, int type, long createTime) {
|
||||||
|
int status = 3;
|
||||||
|
long msgSvrId = createTime + (new Random().nextInt());
|
||||||
|
long msgId = getNextMsgId();
|
||||||
|
ContentValues v = new ContentValues();
|
||||||
|
v.put("msgId", msgId);
|
||||||
|
v.put("msgSvrid", msgSvrId);
|
||||||
|
v.put("type", type);
|
||||||
|
v.put("status", status);
|
||||||
|
v.put("createTime", createTime);
|
||||||
|
v.put("talker", talker);
|
||||||
|
v.put("content", msg);
|
||||||
|
if (talkerId != -1) {
|
||||||
|
v.put("talkerid", talkerId);
|
||||||
|
}
|
||||||
|
insertSQL("message", "", v);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getNextMsgId() {
|
||||||
|
Cursor cursor = rawQuery("SELECT max(msgId) FROM message");
|
||||||
|
if (cursor == null || !cursor.moveToFirst())
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
long id = cursor.getInt(0) + 1;
|
||||||
|
cursor.close();
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cursor getLastMsg(String username) {
|
||||||
|
String query = "SELECT * FROM message WHERE msgId = (SELECT max(msgId) FROM message WHERE talker='" +
|
||||||
|
username + "')";
|
||||||
|
return rawQuery(query);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getUnreadCount(String username) {
|
||||||
|
Cursor cursor = rawQuery("select unReadCount from rconversation where " +
|
||||||
|
"username = '" + username
|
||||||
|
+ "' and ( parentref is null or parentref = '' ) ");
|
||||||
|
|
||||||
|
if (cursor == null || !cursor.moveToFirst())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
int cnt = cursor.getInt(cursor.getColumnIndex("unReadCount"));
|
||||||
|
cursor.close();
|
||||||
|
return cnt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getNickname(String username) {
|
||||||
|
if (mNicknameCache.containsKey(username)) {
|
||||||
|
return mNicknameCache.get(username);
|
||||||
|
}
|
||||||
|
|
||||||
|
Cursor cursor = getContact(username);
|
||||||
|
if (cursor == null || !cursor.moveToFirst())
|
||||||
|
return username;
|
||||||
|
|
||||||
|
String name = cursor.getString(cursor.getColumnIndex("conRemark"));
|
||||||
|
if (TextUtils.isEmpty(name)) {
|
||||||
|
name = cursor.getString(cursor.getColumnIndex("nickname"));
|
||||||
|
}
|
||||||
|
name = name.trim();
|
||||||
|
cursor.close();
|
||||||
|
mNicknameCache.put(username, name);
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public HashMap<String, String> getChatRoomMembers() {
|
||||||
|
String query = "SELECT * FROM chatroom";
|
||||||
|
Cursor cursor = rawQuery(query);
|
||||||
|
|
||||||
|
HashMap<String, String> map = new HashMap<>();
|
||||||
|
|
||||||
|
if (cursor == null || !cursor.moveToFirst())
|
||||||
|
return map;
|
||||||
|
|
||||||
|
do {
|
||||||
|
String memberlist = cursor.getString(cursor.getColumnIndex("memberlist"));
|
||||||
|
String displayname = cursor.getString(cursor.getColumnIndex("displayname"));
|
||||||
|
|
||||||
|
String[] members = memberlist.split(";");
|
||||||
|
String[] names;
|
||||||
|
if (displayname.contains("、")) {
|
||||||
|
names = displayname.split("、");
|
||||||
|
} else {
|
||||||
|
names = displayname.split(",");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < members.length; i++) {
|
||||||
|
map.put(members[i].trim(), names[i].trim());
|
||||||
|
}
|
||||||
|
|
||||||
|
} while (cursor.moveToNext());
|
||||||
|
cursor.close();
|
||||||
|
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChatroomName(String username) {
|
||||||
|
String name = getNickname(username);
|
||||||
|
if (!TextUtils.isEmpty(name))
|
||||||
|
return name;
|
||||||
|
|
||||||
|
String query = "SELECT * FROM chatroom WHERE chatroomname = ?";
|
||||||
|
Cursor cursor = rawQuery(query, new String[]{username});
|
||||||
|
if (cursor == null || !cursor.moveToFirst())
|
||||||
|
return null;
|
||||||
|
|
||||||
|
name = cursor.getString(cursor.getColumnIndex("displayname"));
|
||||||
|
cursor.close();
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getChatroomMemberName(String username) {
|
||||||
|
if (mChatroomMemberMap == null) {
|
||||||
|
mChatroomMemberMap = getChatRoomMembers();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mChatroomMemberMap.containsKey(username)) {
|
||||||
|
return mChatroomMemberMap.get(username);
|
||||||
|
}
|
||||||
|
|
||||||
|
// reload
|
||||||
|
mChatroomMemberMap = getChatRoomMembers();
|
||||||
|
if (mChatroomMemberMap.containsKey(username)) {
|
||||||
|
return mChatroomMemberMap.get(username);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cursor getContact(String username) {
|
||||||
|
String query = "SELECT * FROM rcontact WHERE username = ?";
|
||||||
|
return rawQuery(query, new String[]{username});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,286 @@
|
|||||||
|
package com.xposed.hook.wechat;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
|
import android.database.Cursor;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import de.robv.android.xposed.XC_MethodHook;
|
||||||
|
import de.robv.android.xposed.XposedBridge;
|
||||||
|
import de.robv.android.xposed.XposedHelpers;
|
||||||
|
|
||||||
|
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod;
|
||||||
|
import static de.robv.android.xposed.XposedHelpers.findClass;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by lin on 2018/2/6.
|
||||||
|
*/
|
||||||
|
|
||||||
|
public class WechatUnrecalledHook {
|
||||||
|
|
||||||
|
private static final int EXEC_SUC = 1;
|
||||||
|
|
||||||
|
static final String SQLiteDatabaseClass = "com.tencent.wcdb.database.SQLiteDatabase";
|
||||||
|
|
||||||
|
private static final String recallClass = LuckyMoneyHook.WECHAT_PACKAGE_NAME + ".sdk.platformtools.bw";
|
||||||
|
private static final String recallMethod = "S";
|
||||||
|
private static final String storageClass = LuckyMoneyHook.WECHAT_PACKAGE_NAME + ".storage.w";
|
||||||
|
private static final String storageMethodParam = LuckyMoneyHook.WECHAT_PACKAGE_NAME + ".sdk.e.e";
|
||||||
|
private static final String incMsgLocalIdClass = LuckyMoneyHook.WECHAT_PACKAGE_NAME + ".storage.bl";
|
||||||
|
private static final String incMsgLocalIdMethod = "aHd";
|
||||||
|
private static final String updateMsgLocalIdMethod = "ao";
|
||||||
|
private static final String updateMsgLocalIdMethodParam = LuckyMoneyHook.WECHAT_PACKAGE_NAME + ".storage.bk";
|
||||||
|
|
||||||
|
private static final boolean mDebug = true;
|
||||||
|
private WechatMainDBHelper mDb;
|
||||||
|
private Object mObject;
|
||||||
|
private Object updateMsgLocalIdMethodParamObj;
|
||||||
|
|
||||||
|
private Map<String, Boolean> mSettings = new HashMap<>();
|
||||||
|
|
||||||
|
WechatUnrecalledHook(String packageName) {
|
||||||
|
mSettings.put("prevent_moments_recall", true);
|
||||||
|
mSettings.put("prevent_comments_recall", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void findAndHookConstructor(String className, ClassLoader classLoader, Object... parameters) {
|
||||||
|
Class<?> cls = findClass(className, classLoader);
|
||||||
|
Class<?>[] parameterTypes = new Class[parameters.length - 1];
|
||||||
|
for (int i = 0; i < parameters.length - 1; i++) {
|
||||||
|
if (parameters[i] instanceof String) {
|
||||||
|
parameterTypes[i] = findClass((String) parameters[i], classLoader);
|
||||||
|
} else if (parameters[i] instanceof Class) {
|
||||||
|
parameterTypes[i] = (Class<?>) parameters[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Constructor<?> constructor = cls.getDeclaredConstructor(parameterTypes);
|
||||||
|
constructor.setAccessible(true);
|
||||||
|
XC_MethodHook callback = (XC_MethodHook) parameters[parameters.length - 1];
|
||||||
|
XposedBridge.hookMethod(constructor, callback);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
XposedBridge.log(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void hook(final ClassLoader loader) {
|
||||||
|
try {
|
||||||
|
hookRecall(loader);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
XposedBridge.log(e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
hookDatabase(loader);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
XposedBridge.log(e);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
hookDbObject(loader);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
XposedBridge.log(t);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
hookMsgLocalId(loader);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
XposedBridge.log(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hookRecall(final ClassLoader loader) {
|
||||||
|
findAndHookMethod(recallClass, loader,
|
||||||
|
recallMethod, String.class, String.class,
|
||||||
|
new XC_MethodHook() {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
preventMsgRecall(param);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hookDatabase(ClassLoader loader) {
|
||||||
|
findAndHookMethod(SQLiteDatabaseClass, loader,
|
||||||
|
"updateWithOnConflict", String.class, ContentValues.class, String.class,
|
||||||
|
String[].class, int.class,
|
||||||
|
new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
preventCommentRecall(param);
|
||||||
|
preventMomentRecall(param);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
findAndHookMethod(SQLiteDatabaseClass, loader,
|
||||||
|
"executeSql", String.class, Object[].class, "com.tencent.wcdb.support.CancellationSignal", new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
String query = (String) param.args[0];
|
||||||
|
if (mSettings.get("prevent_moments_recall") &&
|
||||||
|
query.toLowerCase().contains("snsinfo set sourcetype")) {
|
||||||
|
XposedBridge.log("preventMomentRecall executeSql");
|
||||||
|
param.setResult(EXEC_SUC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void hook3DaysMoments(ClassLoader loader) {
|
||||||
|
findAndHookMethod(SQLiteDatabaseClass, loader, "rawQueryWithFactory",
|
||||||
|
SQLiteDatabaseClass + ".CursorFactory", String.class, Object[].class, String.class, "com.tencent.wcdb.support.CancellationSignal",
|
||||||
|
new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
Log.e("rawQueryWithFactory", param.args[1] + ":" + param.args[3]);
|
||||||
|
String sourceType = "sourceType in (8,72,10,74,12,76,14,78,24,88,26,90,28,92,30,94)";
|
||||||
|
String type = "type in ( 1,2 , 3 , 4 , 18 , 5 , 12 , 9 , 14 , 15 , 13 , 21 , 25 , 26,28,29,30)";
|
||||||
|
if (param.args[1] != null && param.args[1].toString().contains("from SnsInfo") &&
|
||||||
|
param.args[1].toString().contains(sourceType) &&
|
||||||
|
param.args[1].toString().contains(type)) {
|
||||||
|
param.args[1] = param.args[1].toString().replace(sourceType, "1=1")
|
||||||
|
.replace(type, "1=1")
|
||||||
|
.replace("snsId >=", "0 !=");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hookDbObject(final ClassLoader loader) {
|
||||||
|
// get database object
|
||||||
|
findAndHookConstructor(storageClass, loader,
|
||||||
|
storageMethodParam, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
// look for: LinkedBlockingQueue
|
||||||
|
if (mDb == null) {
|
||||||
|
try {
|
||||||
|
mDb = new WechatMainDBHelper(param.args[0]);
|
||||||
|
} catch (Throwable t) {
|
||||||
|
log(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void hookMsgLocalId(ClassLoader loader) {
|
||||||
|
findAndHookMethod(incMsgLocalIdClass, loader, incMsgLocalIdMethod, String.class, new XC_MethodHook() {
|
||||||
|
@Override
|
||||||
|
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
|
||||||
|
if ("message".equals(param.args[0]))
|
||||||
|
mObject = param.getResult();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
Class cls = XposedHelpers.findClass(updateMsgLocalIdMethodParam, loader);
|
||||||
|
updateMsgLocalIdMethodParamObj = cls.newInstance();
|
||||||
|
} catch (Throwable e) {
|
||||||
|
XposedBridge.log(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void preventMsgRecall(XC_MethodHook.MethodHookParam param) {
|
||||||
|
String xml = (String) param.args[0];
|
||||||
|
String tag = (String) param.args[1];
|
||||||
|
if (TextUtils.isEmpty(xml) || TextUtils.isEmpty(tag) ||
|
||||||
|
!tag.equals("sysmsg") || !xml.contains("revokemsg")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked") Map<String, String> map =
|
||||||
|
(Map<String, String>) param.getResult();
|
||||||
|
if (map == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
String key = ".sysmsg.$type";
|
||||||
|
if (!map.containsKey(key))
|
||||||
|
return;
|
||||||
|
|
||||||
|
String type = map.get(key);
|
||||||
|
if (type == null || !type.equals("revokemsg"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
final String talker = map.get(".sysmsg.revokemsg.session");
|
||||||
|
String replacemsg = map.get(".sysmsg.revokemsg.replacemsg");
|
||||||
|
String msgsvrid = map.get(".sysmsg.revokemsg.newmsgid");
|
||||||
|
|
||||||
|
if (replacemsg.startsWith("你") || replacemsg.toLowerCase().startsWith("you")) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
String[] strings = replacemsg.split("\"");
|
||||||
|
replacemsg = "\"" + strings[1] + "\" " + "尝试撤回上一条消息 (已阻止)";
|
||||||
|
|
||||||
|
map.put(key, null);
|
||||||
|
param.setResult(map);
|
||||||
|
|
||||||
|
try {
|
||||||
|
Cursor cursor = mDb.getMessageBySvrId(msgsvrid);
|
||||||
|
if (cursor == null || !cursor.moveToFirst())
|
||||||
|
return;
|
||||||
|
|
||||||
|
long createTime = cursor.getLong(cursor.getColumnIndex("createTime"));
|
||||||
|
int idx = cursor.getColumnIndex("talkerId");
|
||||||
|
int talkerId = -1;
|
||||||
|
if (idx != -1) {
|
||||||
|
talkerId = cursor.getInt(cursor.getColumnIndex("talkerId"));
|
||||||
|
}
|
||||||
|
cursor.close();
|
||||||
|
mDb.insertSystemMessage(talker, talkerId, replacemsg, createTime + 1);
|
||||||
|
updateMessageCount();
|
||||||
|
} catch (Throwable t) {
|
||||||
|
XposedBridge.log(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateMessageCount() {
|
||||||
|
if (mObject != null) {
|
||||||
|
XposedHelpers.callMethod(mObject, updateMsgLocalIdMethod, updateMsgLocalIdMethodParamObj);
|
||||||
|
XposedBridge.log("updateMessageCount");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void preventCommentRecall(XC_MethodHook.MethodHookParam param) {
|
||||||
|
String table = (String) param.args[0];
|
||||||
|
if (!table.equalsIgnoreCase("snscomment"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ContentValues v = (ContentValues) param.args[1];
|
||||||
|
if (v.containsKey("commentflag") && v.getAsInteger("commentflag") == 1 &&
|
||||||
|
mSettings.get("prevent_comments_recall")) {
|
||||||
|
XposedBridge.log("preventCommentRecall");
|
||||||
|
param.setResult(EXEC_SUC); // prevent call
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void preventMomentRecall(XC_MethodHook.MethodHookParam param) {
|
||||||
|
String table = (String) param.args[0];
|
||||||
|
if (!table.equalsIgnoreCase("snsinfo"))
|
||||||
|
return;
|
||||||
|
|
||||||
|
ContentValues v = (ContentValues) param.args[1];
|
||||||
|
if (mSettings.get("prevent_moments_recall") &&
|
||||||
|
v.containsKey("sourceType") && v.containsKey("type")) {
|
||||||
|
int sourceType = v.getAsInteger("sourceType");
|
||||||
|
int type = v.getAsInteger("type");
|
||||||
|
//type: 2: text, 21 luckymoneyphoto,
|
||||||
|
if (sourceType == 0 || (type != 2 && sourceType == 8/*set to private*/)) {
|
||||||
|
XposedBridge.log("preventMomentRecall");
|
||||||
|
param.setResult(EXEC_SUC); // prevent call
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void log(Throwable t) {
|
||||||
|
if (mDebug) {
|
||||||
|
XposedBridge.log(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Target({ElementType.FIELD})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface MethodParams {
|
||||||
|
Class<?>[] value();
|
||||||
|
}
|
@ -0,0 +1,12 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
|
||||||
|
@Target({ElementType.FIELD})
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
public @interface MethodReflectParams {
|
||||||
|
String[] value();
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class RefBoolean {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefBoolean(Class<?> cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean get(Object object) {
|
||||||
|
try {
|
||||||
|
return this.field.getBoolean(object);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Object obj, boolean value) {
|
||||||
|
try {
|
||||||
|
this.field.setBoolean(obj, value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,57 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.Modifier;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public final class RefClass {
|
||||||
|
|
||||||
|
private static HashMap<Class<?>,Constructor<?>> REF_TYPES = new HashMap<Class<?>, Constructor<?>>();
|
||||||
|
static {
|
||||||
|
try {
|
||||||
|
REF_TYPES.put(RefObject.class, RefObject.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefMethod.class, RefMethod.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefInt.class, RefInt.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefLong.class, RefLong.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefFloat.class, RefFloat.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefDouble.class, RefDouble.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefBoolean.class, RefBoolean.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefStaticObject.class, RefStaticObject.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefStaticInt.class, RefStaticInt.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefStaticMethod.class, RefStaticMethod.class.getConstructor(Class.class, Field.class));
|
||||||
|
REF_TYPES.put(RefConstructor.class, RefConstructor.class.getConstructor(Class.class, Field.class));
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Class<?> load(Class<?> mappingClass, String className) {
|
||||||
|
try {
|
||||||
|
return load(mappingClass, Class.forName(className));
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Class load(Class mappingClass, Class<?> realClass) {
|
||||||
|
Field[] fields = mappingClass.getDeclaredFields();
|
||||||
|
for (Field field : fields) {
|
||||||
|
try {
|
||||||
|
if (Modifier.isStatic(field.getModifiers())) {
|
||||||
|
Constructor<?> constructor = REF_TYPES.get(field.getType());
|
||||||
|
if (constructor != null) {
|
||||||
|
field.set(null, constructor.newInstance(realClass, field));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return realClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,49 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class RefConstructor<T> {
|
||||||
|
private Constructor<?> ctor;
|
||||||
|
|
||||||
|
public RefConstructor(Class<?> cls, Field field) throws NoSuchMethodException {
|
||||||
|
if (field.isAnnotationPresent(MethodParams.class)) {
|
||||||
|
Class<?>[] types = field.getAnnotation(MethodParams.class).value();
|
||||||
|
ctor = cls.getDeclaredConstructor(types);
|
||||||
|
} else if (field.isAnnotationPresent(MethodReflectParams.class)) {
|
||||||
|
String[] values = field.getAnnotation(MethodReflectParams.class).value();
|
||||||
|
Class[] parameterTypes = new Class[values.length];
|
||||||
|
int N = 0;
|
||||||
|
while (N < values.length) {
|
||||||
|
try {
|
||||||
|
parameterTypes[N] = Class.forName(values[N]);
|
||||||
|
N++;
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ctor = cls.getDeclaredConstructor(parameterTypes);
|
||||||
|
} else {
|
||||||
|
ctor = cls.getDeclaredConstructor();
|
||||||
|
}
|
||||||
|
if (ctor != null && !ctor.isAccessible()) {
|
||||||
|
ctor.setAccessible(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T newInstance() {
|
||||||
|
try {
|
||||||
|
return (T) ctor.newInstance();
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T newInstance(Object... params) {
|
||||||
|
try {
|
||||||
|
return (T) ctor.newInstance(params);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class RefDouble {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefDouble(Class cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public double get(Object object) {
|
||||||
|
try {
|
||||||
|
return this.field.getDouble(object);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Object obj, double value) {
|
||||||
|
try {
|
||||||
|
this.field.setDouble(obj, value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class RefFloat {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefFloat(Class cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public float get(Object object) {
|
||||||
|
try {
|
||||||
|
return this.field.getFloat(object);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Object obj, float value) {
|
||||||
|
try {
|
||||||
|
this.field.setFloat(obj, value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class RefInt {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefInt(Class cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int get(Object object) {
|
||||||
|
try {
|
||||||
|
return this.field.getInt(object);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Object obj, int intValue) {
|
||||||
|
try {
|
||||||
|
this.field.setInt(obj, intValue);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class RefLong {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefLong(Class cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public long get(Object object) {
|
||||||
|
try {
|
||||||
|
return this.field.getLong(object);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Object obj, long value) {
|
||||||
|
try {
|
||||||
|
this.field.setLong(obj, value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,90 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import static mirror.RefStaticMethod.getProtoType;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public class RefMethod<T> {
|
||||||
|
private Method method;
|
||||||
|
|
||||||
|
public RefMethod(Class<?> cls, Field field) throws NoSuchMethodException {
|
||||||
|
if (field.isAnnotationPresent(MethodParams.class)) {
|
||||||
|
Class<?>[] types = field.getAnnotation(MethodParams.class).value();
|
||||||
|
for (int i = 0; i < types.length; i++) {
|
||||||
|
Class<?> clazz = types[i];
|
||||||
|
if (clazz.getClassLoader() == getClass().getClassLoader()) {
|
||||||
|
try {
|
||||||
|
Class.forName(clazz.getName());
|
||||||
|
Class<?> realClass = (Class<?>) clazz.getField("TYPE").get(null);
|
||||||
|
types[i] = realClass;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.method = cls.getDeclaredMethod(field.getName(), types);
|
||||||
|
this.method.setAccessible(true);
|
||||||
|
} else if (field.isAnnotationPresent(MethodReflectParams.class)) {
|
||||||
|
String[] typeNames = field.getAnnotation(MethodReflectParams.class).value();
|
||||||
|
Class<?>[] types = new Class<?>[typeNames.length];
|
||||||
|
for (int i = 0; i < typeNames.length; i++) {
|
||||||
|
Class<?> type = getProtoType(typeNames[i]);
|
||||||
|
if (type == null) {
|
||||||
|
try {
|
||||||
|
type = Class.forName(typeNames[i]);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
types[i] = type;
|
||||||
|
}
|
||||||
|
this.method = cls.getDeclaredMethod(field.getName(), types);
|
||||||
|
this.method.setAccessible(true);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
for (Method method : cls.getDeclaredMethods()) {
|
||||||
|
if (method.getName().equals(field.getName())) {
|
||||||
|
this.method = method;
|
||||||
|
this.method.setAccessible(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (this.method == null) {
|
||||||
|
throw new NoSuchMethodException(field.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public T call(Object receiver, Object... args) {
|
||||||
|
try {
|
||||||
|
return (T) this.method.invoke(receiver, args);
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
if (e.getCause() != null) {
|
||||||
|
e.getCause().printStackTrace();
|
||||||
|
} else {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T callWithException(Object receiver, Object... args) throws Throwable {
|
||||||
|
try {
|
||||||
|
return (T) this.method.invoke(receiver, args);
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
if (e.getCause() != null) {
|
||||||
|
throw e.getCause();
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Class<?>[] paramList() {
|
||||||
|
return method.getParameterTypes();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public class RefObject<T> {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefObject(Class<?> cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public T get(Object object) {
|
||||||
|
try {
|
||||||
|
return (T) this.field.get(object);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(Object obj, T value) {
|
||||||
|
try {
|
||||||
|
this.field.set(obj, value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,28 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
public class RefStaticInt {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefStaticInt(Class<?> cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int get() {
|
||||||
|
try {
|
||||||
|
return this.field.getInt(null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(int value) {
|
||||||
|
try {
|
||||||
|
this.field.setInt(null, value);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,136 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public class RefStaticMethod<T> {
|
||||||
|
private Method method;
|
||||||
|
|
||||||
|
public RefStaticMethod(Class<?> cls, Field field) throws NoSuchMethodException {
|
||||||
|
if (field.isAnnotationPresent(MethodParams.class)) {
|
||||||
|
Class<?>[] types = field.getAnnotation(MethodParams.class).value();
|
||||||
|
for (int i = 0; i < types.length; i++) {
|
||||||
|
Class<?> clazz = types[i];
|
||||||
|
if (clazz.getClassLoader() == getClass().getClassLoader()) {
|
||||||
|
try {
|
||||||
|
Class.forName(clazz.getName());
|
||||||
|
Class<?> realClass = (Class<?>) clazz.getField("TYPE").get(null);
|
||||||
|
types[i] = realClass;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.method = cls.getDeclaredMethod(field.getName(), types);
|
||||||
|
this.method.setAccessible(true);
|
||||||
|
} else if (field.isAnnotationPresent(MethodReflectParams.class)) {
|
||||||
|
boolean arrayset=false;
|
||||||
|
String[] typeNames = field.getAnnotation(MethodReflectParams.class).value();
|
||||||
|
Class<?>[] types = new Class<?>[typeNames.length];
|
||||||
|
Class<?>[] types2 = new Class<?>[typeNames.length];
|
||||||
|
for (int i = 0; i < typeNames.length; i++) {
|
||||||
|
Class<?> type = getProtoType(typeNames[i]);
|
||||||
|
if (type == null) {
|
||||||
|
try {
|
||||||
|
type = Class.forName(typeNames[i]);
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
types[i] = type;
|
||||||
|
if("java.util.HashSet".equals(typeNames[i])){
|
||||||
|
arrayset=true;
|
||||||
|
Class<?> type2 =type;
|
||||||
|
try {
|
||||||
|
type2 = Class.forName("android.util.ArraySet");
|
||||||
|
} catch (ClassNotFoundException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if(type2 != null) {
|
||||||
|
types2[i] = type2;
|
||||||
|
}else{
|
||||||
|
types2[i] = type;
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
types2[i] = type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
this.method = cls.getDeclaredMethod(field.getName(), types);
|
||||||
|
}catch (Exception e){
|
||||||
|
e.printStackTrace();
|
||||||
|
if(arrayset){
|
||||||
|
this.method = cls.getDeclaredMethod(field.getName(), types2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.method.setAccessible(true);
|
||||||
|
} else {
|
||||||
|
for (Method method : cls.getDeclaredMethods()) {
|
||||||
|
if (method.getName().equals(field.getName())) {
|
||||||
|
this.method = method;
|
||||||
|
this.method.setAccessible(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.method == null) {
|
||||||
|
throw new NoSuchMethodException(field.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static Class<?> getProtoType(String typeName) {
|
||||||
|
if (typeName.equals("int")) {
|
||||||
|
return Integer.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("long")) {
|
||||||
|
return Long.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("boolean")) {
|
||||||
|
return Boolean.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("byte")) {
|
||||||
|
return Byte.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("short")) {
|
||||||
|
return Short.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("char")) {
|
||||||
|
return Character.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("float")) {
|
||||||
|
return Float.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("double")) {
|
||||||
|
return Double.TYPE;
|
||||||
|
}
|
||||||
|
if (typeName.equals("void")) {
|
||||||
|
return Void.TYPE;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public T call(Object... params) {
|
||||||
|
T obj = null;
|
||||||
|
try {
|
||||||
|
obj = (T) method.invoke(null, params);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public T callWithException(Object... params) throws Throwable {
|
||||||
|
try {
|
||||||
|
return (T) this.method.invoke(null, params);
|
||||||
|
} catch (InvocationTargetException e) {
|
||||||
|
if (e.getCause() != null) {
|
||||||
|
throw e.getCause();
|
||||||
|
}
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,35 @@
|
|||||||
|
package mirror;
|
||||||
|
|
||||||
|
import java.lang.reflect.Field;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public class RefStaticObject<T> {
|
||||||
|
private Field field;
|
||||||
|
|
||||||
|
public RefStaticObject(Class<?> cls, Field field) throws NoSuchFieldException {
|
||||||
|
this.field = cls.getDeclaredField(field.getName());
|
||||||
|
this.field.setAccessible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Class<?> type() {
|
||||||
|
return field.getType();
|
||||||
|
}
|
||||||
|
|
||||||
|
public T get() {
|
||||||
|
T obj = null;
|
||||||
|
try {
|
||||||
|
obj = (T) this.field.get(null);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(T obj) {
|
||||||
|
try {
|
||||||
|
this.field.set(null, obj);
|
||||||
|
} catch (Exception e) {
|
||||||
|
//Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp">
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/quick_open_lucky_money" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.SwitchCompat
|
||||||
|
android:id="@+id/cb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/show_lucky_money_coming_toast" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.SwitchCompat
|
||||||
|
android:id="@+id/cb2"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/prevent_message_recalled" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.SwitchCompat
|
||||||
|
android:id="@+id/cb3"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/disable_3_days_of_Moments_limit" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.SwitchCompat
|
||||||
|
android:id="@+id/cb4"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/lucky_money_delay" />
|
||||||
|
|
||||||
|
<EditText
|
||||||
|
android:id="@+id/et_lucky_money_delay"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="number" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_reboot_app"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:text="@string/reboot_app" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/lv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,145 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingLeft="15dp"
|
||||||
|
android:paddingRight="15dp">
|
||||||
|
|
||||||
|
<android.support.design.widget.TabLayout
|
||||||
|
android:id="@+id/tab_layout"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_horizontal" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_gps"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="latitude">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:id="@+id/et_latitude"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="numberDecimal" />
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="longitude">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:id="@+id/et_longitude"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="numberDecimal" />
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_latitude"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_longitude"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_auto_fill_gps"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/auto_fill"
|
||||||
|
android:visibility="invisible" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/ll_cell"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="lac">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:id="@+id/et_lac"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="number" />
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:hint="cid">
|
||||||
|
|
||||||
|
<android.support.design.widget.TextInputEditText
|
||||||
|
android:id="@+id/et_cid"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:inputType="number" />
|
||||||
|
</android.support.design.widget.TextInputLayout>
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_lac"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_cid"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_auto_fill_cell"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/auto_fill"
|
||||||
|
android:visibility="invisible" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<FrameLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="40dp"
|
||||||
|
android:layout_marginTop="30dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical"
|
||||||
|
android:text="@string/open_location_hook" />
|
||||||
|
|
||||||
|
<android.support.v7.widget.SwitchCompat
|
||||||
|
android:id="@+id/cb"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical|end" />
|
||||||
|
|
||||||
|
</FrameLayout>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_save"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/save" />
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/btn_reboot_app"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="30dp"
|
||||||
|
android:text="@string/reboot_app" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,35 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:padding="12dp">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/iv_icon"
|
||||||
|
android:layout_width="36dp"
|
||||||
|
android:layout_height="36dp" />
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_gravity="center_vertical" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_package"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="3dp"
|
||||||
|
android:textSize="12sp" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
</LinearLayout>
|
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/item_luck_money"
|
||||||
|
android:title="@string/wechat_hook"/>
|
||||||
|
</menu>
|
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 10 KiB |
@ -0,0 +1,22 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">FakeLocation2.0</string>
|
||||||
|
|
||||||
|
<string name="gps_location">GPS定位</string>
|
||||||
|
<string name="cell_location">基站定位</string>
|
||||||
|
<string name="current_lac">当前位置基站信息 Lac:%1$s</string>
|
||||||
|
<string name="current_cid">当前位置基站信息 Cid:%1$s</string>
|
||||||
|
<string name="current_latitude">当前位置GPS信息 Latitude:%1$s</string>
|
||||||
|
<string name="current_longitude">当前位置GPS信息 Longitude:%1$s</string>
|
||||||
|
<string name="auto_fill">自动填入当前位置</string>
|
||||||
|
<string name="open_location_hook">开启定位修改</string>
|
||||||
|
<string name="save">保存</string>
|
||||||
|
<string name="save_success">保存成功</string>
|
||||||
|
<string name="reboot_app">重启App</string>
|
||||||
|
|
||||||
|
<string name="wechat_hook">微信红包</string>
|
||||||
|
<string name="quick_open_lucky_money">快速打开红包</string>
|
||||||
|
<string name="show_lucky_money_coming_toast">有红包消息时toast提示</string>
|
||||||
|
<string name="prevent_message_recalled">消息防撤回</string>
|
||||||
|
<string name="disable_3_days_of_Moments_limit">解除好友朋友圈仅3天可见限制</string>
|
||||||
|
<string name="lucky_money_delay">自动抢红包延时</string>
|
||||||
|
</resources>
|
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="colorPrimary">#ff212121</color>
|
||||||
|
<color name="colorPrimaryDark">#ff000000</color>
|
||||||
|
<color name="colorAccent">#ff009688</color>
|
||||||
|
</resources>
|
@ -0,0 +1,22 @@
|
|||||||
|
<resources>
|
||||||
|
<string name="app_name">FakeLocation2.0</string>
|
||||||
|
|
||||||
|
<string name="gps_location">GPS Location</string>
|
||||||
|
<string name="cell_location">Cell Location</string>
|
||||||
|
<string name="current_lac">Current Lac:%1$s</string>
|
||||||
|
<string name="current_cid">Current Cid:%1$s</string>
|
||||||
|
<string name="current_latitude">Current Latitude:%1$s</string>
|
||||||
|
<string name="current_longitude">Current Longitude:%1$s</string>
|
||||||
|
<string name="auto_fill">Auto Fill</string>
|
||||||
|
<string name="open_location_hook">open hook</string>
|
||||||
|
<string name="save">Save</string>
|
||||||
|
<string name="save_success">Save Success</string>
|
||||||
|
<string name="reboot_app">Reboot App</string>
|
||||||
|
|
||||||
|
<string name="wechat_hook">Wechat Hook</string>
|
||||||
|
<string name="quick_open_lucky_money">quick open lucky money</string>
|
||||||
|
<string name="show_lucky_money_coming_toast">show lucky money coming toast</string>
|
||||||
|
<string name="prevent_message_recalled">prevent message recalled</string>
|
||||||
|
<string name="disable_3_days_of_Moments_limit">disable 3 days of Moments limit</string>
|
||||||
|
<string name="lucky_money_delay">lucky money delay</string>
|
||||||
|
</resources>
|
@ -0,0 +1,11 @@
|
|||||||
|
<resources>
|
||||||
|
|
||||||
|
<!-- Base application theme. -->
|
||||||
|
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
|
||||||
|
<!-- Customize your theme here. -->
|
||||||
|
<item name="colorPrimary">@color/colorPrimary</item>
|
||||||
|
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
|
||||||
|
<item name="colorAccent">@color/colorAccent</item>
|
||||||
|
</style>
|
||||||
|
|
||||||
|
</resources>
|
@ -0,0 +1,25 @@
|
|||||||
|
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||||
|
|
||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:3.6.3'
|
||||||
|
|
||||||
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
|
// in the individual module build.gradle files
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
jcenter()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task clean(type: Delete) {
|
||||||
|
delete rootProject.buildDir
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
# Project-wide Gradle settings.
|
||||||
|
|
||||||
|
# IDE (e.g. Android Studio) users:
|
||||||
|
# Gradle settings configured through the IDE *will override*
|
||||||
|
# any settings specified in this file.
|
||||||
|
|
||||||
|
# For more details on how to configure your build environment visit
|
||||||
|
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
||||||
|
|
||||||
|
# Specifies the JVM arguments used for the daemon process.
|
||||||
|
# The setting is particularly useful for tweaking memory settings.
|
||||||
|
org.gradle.jvmargs=-Xmx1536m
|
||||||
|
|
||||||
|
# When configured, Gradle will run in incubating parallel mode.
|
||||||
|
# This option should only be used with decoupled projects. More details, visit
|
||||||
|
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
||||||
|
# org.gradle.parallel=true
|
@ -0,0 +1,6 @@
|
|||||||
|
#Wed May 27 21:46:47 CST 2020
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
|
@ -0,0 +1,160 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## Gradle start up script for UN*X
|
||||||
|
##
|
||||||
|
##############################################################################
|
||||||
|
|
||||||
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
DEFAULT_JVM_OPTS=""
|
||||||
|
|
||||||
|
APP_NAME="Gradle"
|
||||||
|
APP_BASE_NAME=`basename "$0"`
|
||||||
|
|
||||||
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
|
MAX_FD="maximum"
|
||||||
|
|
||||||
|
warn ( ) {
|
||||||
|
echo "$*"
|
||||||
|
}
|
||||||
|
|
||||||
|
die ( ) {
|
||||||
|
echo
|
||||||
|
echo "$*"
|
||||||
|
echo
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
# OS specific support (must be 'true' or 'false').
|
||||||
|
cygwin=false
|
||||||
|
msys=false
|
||||||
|
darwin=false
|
||||||
|
case "`uname`" in
|
||||||
|
CYGWIN* )
|
||||||
|
cygwin=true
|
||||||
|
;;
|
||||||
|
Darwin* )
|
||||||
|
darwin=true
|
||||||
|
;;
|
||||||
|
MINGW* )
|
||||||
|
msys=true
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Attempt to set APP_HOME
|
||||||
|
# Resolve links: $0 may be a link
|
||||||
|
PRG="$0"
|
||||||
|
# Need this for relative symlinks.
|
||||||
|
while [ -h "$PRG" ] ; do
|
||||||
|
ls=`ls -ld "$PRG"`
|
||||||
|
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||||
|
if expr "$link" : '/.*' > /dev/null; then
|
||||||
|
PRG="$link"
|
||||||
|
else
|
||||||
|
PRG=`dirname "$PRG"`"/$link"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
SAVED="`pwd`"
|
||||||
|
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||||
|
APP_HOME="`pwd -P`"
|
||||||
|
cd "$SAVED" >/dev/null
|
||||||
|
|
||||||
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
# Determine the Java command to use to start the JVM.
|
||||||
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
|
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||||
|
else
|
||||||
|
JAVACMD="$JAVA_HOME/bin/java"
|
||||||
|
fi
|
||||||
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
JAVACMD="java"
|
||||||
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
location of your Java installation."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Increase the maximum file descriptors if we can.
|
||||||
|
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
|
||||||
|
MAX_FD_LIMIT=`ulimit -H -n`
|
||||||
|
if [ $? -eq 0 ] ; then
|
||||||
|
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||||
|
MAX_FD="$MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
ulimit -n $MAX_FD
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Darwin, add options to specify how the application appears in the dock
|
||||||
|
if $darwin; then
|
||||||
|
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||||
|
fi
|
||||||
|
|
||||||
|
# For Cygwin, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; then
|
||||||
|
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||||
|
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||||
|
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||||
|
|
||||||
|
# We build the pattern for arguments to be converted via cygpath
|
||||||
|
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||||
|
SEP=""
|
||||||
|
for dir in $ROOTDIRSRAW ; do
|
||||||
|
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||||
|
SEP="|"
|
||||||
|
done
|
||||||
|
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||||
|
# Add a user-defined pattern to the cygpath arguments
|
||||||
|
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||||
|
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||||
|
fi
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
i=0
|
||||||
|
for arg in "$@" ; do
|
||||||
|
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||||
|
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||||
|
|
||||||
|
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||||
|
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||||
|
else
|
||||||
|
eval `echo args$i`="\"$arg\""
|
||||||
|
fi
|
||||||
|
i=$((i+1))
|
||||||
|
done
|
||||||
|
case $i in
|
||||||
|
(0) set -- ;;
|
||||||
|
(1) set -- "$args0" ;;
|
||||||
|
(2) set -- "$args0" "$args1" ;;
|
||||||
|
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||||
|
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||||
|
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||||
|
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||||
|
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||||
|
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||||
|
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
|
||||||
|
function splitJvmOpts() {
|
||||||
|
JVM_OPTS=("$@")
|
||||||
|
}
|
||||||
|
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
|
||||||
|
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
|
||||||
|
|
||||||
|
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
|
@ -0,0 +1,90 @@
|
|||||||
|
@if "%DEBUG%" == "" @echo off
|
||||||
|
@rem ##########################################################################
|
||||||
|
@rem
|
||||||
|
@rem Gradle startup script for Windows
|
||||||
|
@rem
|
||||||
|
@rem ##########################################################################
|
||||||
|
|
||||||
|
@rem Set local scope for the variables with windows NT shell
|
||||||
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS=
|
||||||
|
|
||||||
|
set DIRNAME=%~dp0
|
||||||
|
if "%DIRNAME%" == "" set DIRNAME=.
|
||||||
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
|
|
||||||
|
@rem Find java.exe
|
||||||
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
|
set JAVA_EXE=java.exe
|
||||||
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
|
if "%ERRORLEVEL%" == "0" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
|
|
||||||
|
if exist "%JAVA_EXE%" goto init
|
||||||
|
|
||||||
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
echo location of your Java installation.
|
||||||
|
|
||||||
|
goto fail
|
||||||
|
|
||||||
|
:init
|
||||||
|
@rem Get command-line arguments, handling Windowz variants
|
||||||
|
|
||||||
|
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||||
|
if "%@eval[2+2]" == "4" goto 4NT_args
|
||||||
|
|
||||||
|
:win9xME_args
|
||||||
|
@rem Slurp the command line arguments.
|
||||||
|
set CMD_LINE_ARGS=
|
||||||
|
set _SKIP=2
|
||||||
|
|
||||||
|
:win9xME_args_slurp
|
||||||
|
if "x%~1" == "x" goto execute
|
||||||
|
|
||||||
|
set CMD_LINE_ARGS=%*
|
||||||
|
goto execute
|
||||||
|
|
||||||
|
:4NT_args
|
||||||
|
@rem Get arguments from the 4NT Shell from JP Software
|
||||||
|
set CMD_LINE_ARGS=%$
|
||||||
|
|
||||||
|
:execute
|
||||||
|
@rem Setup the command line
|
||||||
|
|
||||||
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
|
|
||||||
|
@rem Execute Gradle
|
||||||
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||||
|
|
||||||
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
|
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||||
|
|
||||||
|
:fail
|
||||||
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
|
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||||
|
exit /b 1
|
||||||
|
|
||||||
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
|
|
||||||
|
:omega
|
@ -0,0 +1 @@
|
|||||||
|
include ':app'
|
@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
|
||||||
|
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
|
||||||
|
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
|
||||||
|
<classpathentry kind="src" path="src"/>
|
||||||
|
<classpathentry kind="src" path="gen"/>
|
||||||
|
<classpathentry kind="lib" path="XposedBridgeApi-20150213.jar"/>
|
||||||
|
<classpathentry kind="output" path="bin/classes"/>
|
||||||
|
</classpath>
|
@ -0,0 +1,23 @@
|
|||||||
|
# built application files
|
||||||
|
*.apk
|
||||||
|
*.ap_
|
||||||
|
|
||||||
|
# files for the dex VM
|
||||||
|
*.dex
|
||||||
|
|
||||||
|
# Java class files
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# generated files
|
||||||
|
bin/
|
||||||
|
gen/
|
||||||
|
|
||||||
|
# Local configuration file (sdk path, etc)
|
||||||
|
local.properties
|
||||||
|
|
||||||
|
# Eclipse project files
|
||||||
|
#.classpath
|
||||||
|
.project
|
||||||
|
|
||||||
|
#proguard
|
||||||
|
proguard/
|
@ -0,0 +1,291 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.6
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.6
|
||||||
|
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_assignment=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
|
||||||
|
org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_after_package=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_field=0
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_method=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_before_package=0
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
|
||||||
|
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
|
||||||
|
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
|
||||||
|
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_block_comments=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_header=false
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_html=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_line_comments=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.format_source_code=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
|
||||||
|
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
|
||||||
|
org.eclipse.jdt.core.formatter.comment.line_length=80
|
||||||
|
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
|
||||||
|
org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
|
||||||
|
org.eclipse.jdt.core.formatter.compact_else_if=true
|
||||||
|
org.eclipse.jdt.core.formatter.continuation_indentation=2
|
||||||
|
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
|
||||||
|
org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
|
||||||
|
org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
|
||||||
|
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_empty_lines=false
|
||||||
|
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
|
||||||
|
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
|
||||||
|
org.eclipse.jdt.core.formatter.indentation.size=4
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
|
||||||
|
org.eclipse.jdt.core.formatter.join_lines_in_comments=true
|
||||||
|
org.eclipse.jdt.core.formatter.join_wrapped_lines=true
|
||||||
|
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
|
||||||
|
org.eclipse.jdt.core.formatter.lineSplit=120
|
||||||
|
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
|
||||||
|
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
|
||||||
|
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
|
||||||
|
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
|
||||||
|
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
|
||||||
|
org.eclipse.jdt.core.formatter.tabulation.char=tab
|
||||||
|
org.eclipse.jdt.core.formatter.tabulation.size=4
|
||||||
|
org.eclipse.jdt.core.formatter.use_on_off_tags=true
|
||||||
|
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
|
||||||
|
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
|
||||||
|
org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
|
||||||
|
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
|
@ -0,0 +1,3 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
formatter_profile=_Long lines
|
||||||
|
formatter_settings_version=12
|
@ -0,0 +1,209 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="biz.bokhorst.xprivacy"
|
||||||
|
android:installLocation="internalOnly"
|
||||||
|
android:versionCode="481"
|
||||||
|
android:versionName="3.6.19" >
|
||||||
|
|
||||||
|
<uses-sdk
|
||||||
|
android:minSdkVersion="15"
|
||||||
|
android:targetSdkVersion="22" />
|
||||||
|
|
||||||
|
<permission-tree
|
||||||
|
android:name="biz.bokhorst.xprivacy"
|
||||||
|
android:description="@string/app_name"
|
||||||
|
android:icon="@drawable/ic_launcher" />
|
||||||
|
|
||||||
|
<permission
|
||||||
|
android:name="biz.bokhorst.xprivacy.MANAGE_PACKAGES"
|
||||||
|
android:description="@string/permission_manage"
|
||||||
|
android:label="@string/permission_manage"
|
||||||
|
android:protectionLevel="dangerous" />
|
||||||
|
<permission
|
||||||
|
android:name="biz.bokhorst.xprivacy.MANAGE_XPRIVACY"
|
||||||
|
android:description="@string/permission_restrictions"
|
||||||
|
android:label="@string/permission_restrictions"
|
||||||
|
android:protectionLevel="dangerous" />
|
||||||
|
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||||
|
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
|
||||||
|
<uses-permission android:name="android.permission.READ_CONTACTS" />
|
||||||
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
|
<uses-permission android:name="biz.bokhorst.xprivacy.MANAGE_PACKAGES" />
|
||||||
|
<uses-permission android:name="biz.bokhorst.xprivacy.MANAGE_XPRIVACY" />
|
||||||
|
<uses-permission android:name="biz.bokhorst.xprivacy.pro.CHECK" />
|
||||||
|
|
||||||
|
<supports-screens
|
||||||
|
android:anyDensity="true"
|
||||||
|
android:largeScreens="true"
|
||||||
|
android:normalScreens="true"
|
||||||
|
android:resizeable="true"
|
||||||
|
android:smallScreens="true"
|
||||||
|
android:xlargeScreens="true" />
|
||||||
|
|
||||||
|
<application
|
||||||
|
android:name="ApplicationEx"
|
||||||
|
android:allowBackup="false"
|
||||||
|
android:icon="@drawable/ic_launcher"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:theme="@style/CustomTheme.Light" >
|
||||||
|
|
||||||
|
<!-- Xposed -->
|
||||||
|
<meta-data
|
||||||
|
android:name="xposedmodule"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="xposedminversion"
|
||||||
|
android:value="54" />
|
||||||
|
<meta-data
|
||||||
|
android:name="xposeddescription"
|
||||||
|
android:value="@string/app_description" />
|
||||||
|
|
||||||
|
<!-- Samsung multi window support -->
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.support.multiwindow"
|
||||||
|
android:value="true" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W"
|
||||||
|
android:resource="@dimen/app_defaultsize_w" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H"
|
||||||
|
android:resource="@dimen/app_defaultsize_h" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W"
|
||||||
|
android:resource="@dimen/app_minimumsize_w" />
|
||||||
|
<meta-data
|
||||||
|
android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H"
|
||||||
|
android:resource="@dimen/app_minimumsize_h" />
|
||||||
|
|
||||||
|
<activity
|
||||||
|
android:name=".ActivityMain"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:label="@string/app_name"
|
||||||
|
android:launchMode="singleTop" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER" />
|
||||||
|
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
|
||||||
|
</intent-filter>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.VIEW" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
|
||||||
|
<data android:scheme="file" />
|
||||||
|
<data android:host="*" />
|
||||||
|
<data android:mimeType="*/*" />
|
||||||
|
<data android:pathPattern=".*XPrivacy_license\\.txt" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ActivityApp"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:parentActivityName=".ActivityMain" >
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value="biz.bokhorst.xprivacy.ActivityMain" />
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.APPLICATION" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ActivitySettings"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:parentActivityName=".ActivityMain"
|
||||||
|
android:windowSoftInputMode="stateHidden" >
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value="biz.bokhorst.xprivacy.ActivityMain" />
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.SETTINGS" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ActivityUsage"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:parentActivityName=".ActivityMain" >
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value="biz.bokhorst.xprivacy.ActivityMain" />
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.USAGE" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<activity
|
||||||
|
android:name=".ActivityShare"
|
||||||
|
android:configChanges="keyboardHidden|orientation|screenSize"
|
||||||
|
android:parentActivityName=".ActivityMain" >
|
||||||
|
<meta-data
|
||||||
|
android:name="android.support.PARENT_ACTIVITY"
|
||||||
|
android:value="biz.bokhorst.xprivacy.ActivityMain" />
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.IMPORT" />
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.EXPORT" />
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.FETCH" />
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.SUBMIT" />
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.TOGGLE" />
|
||||||
|
|
||||||
|
<category android:name="android.intent.category.DEFAULT" />
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
|
||||||
|
<receiver android:name=".PackageChange" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.PACKAGE_ADDED" />
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REPLACED" />
|
||||||
|
<action android:name="android.intent.action.PACKAGE_REMOVED" />
|
||||||
|
|
||||||
|
<data android:scheme="package" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
<receiver android:name=".BootReceiver" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.BOOT_COMPLETED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
<receiver
|
||||||
|
android:name=".DeviceAdministratorReceiver"
|
||||||
|
android:permission="android.permission.BIND_DEVICE_ADMIN" >
|
||||||
|
<meta-data
|
||||||
|
android:name="android.app.device_admin"
|
||||||
|
android:resource="@xml/device_admin" />
|
||||||
|
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED" />
|
||||||
|
<action android:name="android.app.action.ACTION_DEVICE_ADMIN_DISABLE_REQUESTED" />
|
||||||
|
<action android:name="android.app.action.ACTION_DEVICE_ADMIN_DISABLED" />
|
||||||
|
</intent-filter>
|
||||||
|
</receiver>
|
||||||
|
|
||||||
|
<service
|
||||||
|
android:name=".UpdateService"
|
||||||
|
android:enabled="true"
|
||||||
|
android:exported="true"
|
||||||
|
android:permission="biz.bokhorst.xprivacy.MANAGE_XPRIVACY"
|
||||||
|
android:process=":update" >
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.FLUSH" />
|
||||||
|
<action android:name="biz.bokhorst.xprivacy.action.UPDATE" />
|
||||||
|
</intent-filter>
|
||||||
|
</service>
|
||||||
|
</application>
|
||||||
|
|
||||||
|
</manifest>
|
@ -0,0 +1,693 @@
|
|||||||
|
Changelog
|
||||||
|
=========
|
||||||
|
|
||||||
|
**Release types**
|
||||||
|
|
||||||
|
* UNSUPPORTED: only install if you know how to fix things
|
||||||
|
* EXPERIMENTAL: only install if you know how to fix things
|
||||||
|
* TEST: new or updated features with a higher risk for bugs
|
||||||
|
* BETA: new or updated features with a lower risk for bugs
|
||||||
|
* STABLE: all known bugs are fixed; low risk for bugs
|
||||||
|
|
||||||
|
**Downloads**
|
||||||
|
|
||||||
|
* [Xposed module repository](http://repo.xposed.info/module/biz.bokhorst.xprivacy) (stable versions)
|
||||||
|
* [GitHub releases](https://github.com/M66B/XPrivacy/releases) (test and beta versions)
|
||||||
|
|
||||||
|
**Important**
|
||||||
|
|
||||||
|
* **Please send the support info if XPrivacy asks for it**
|
||||||
|
|
||||||
|
**Next release**
|
||||||
|
|
||||||
|
* Updated Russian translation
|
||||||
|
|
||||||
|
[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
|
||||||
|
|
||||||
|
**Version 3.6.19 STABLE**
|
||||||
|
|
||||||
|
* Fixed IPC restrictions for Lollipop (compatibility mode only)
|
||||||
|
|
||||||
|
**Version 3.6.18 STABLE**
|
||||||
|
|
||||||
|
* Fixed location restrictions in AOSP mode on Android Lollipop ([issue](/../../issues/2219))
|
||||||
|
|
||||||
|
**Version 3.6.17 STABLE**
|
||||||
|
|
||||||
|
* Fixed bootloop in some cases for Android versions before Lollipop ([issue](/../../issues/2209))
|
||||||
|
|
||||||
|
**Version 3.6.16 BETA**
|
||||||
|
|
||||||
|
* Fixed crash on clear cache (flush) on Lollipop
|
||||||
|
* Fixed translation of isolated process uids (debug info)
|
||||||
|
* Reading property *xprivacy.options=ignoreselinux* from */system/build.prop* to ignore SELinux
|
||||||
|
* Settings this property enables reading of these files again, but might result in a bootloop for some:
|
||||||
|
* */data/system/xprivacy/disabled*
|
||||||
|
* */data/system/xprivacy/aosp*
|
||||||
|
* This file can be created/deleted by toggling the main setting *AOSP mode*
|
||||||
|
|
||||||
|
**Version 3.6.15 BETA**
|
||||||
|
|
||||||
|
* Fixed privacy service not running with older Xposed releases ([issue](/../../issues/2206))
|
||||||
|
|
||||||
|
**Version 3.6.14 BETA**
|
||||||
|
|
||||||
|
* Fixed on demand restricting for some custom ROMs (OPPO)
|
||||||
|
* Fixed (telephony) restrictions for Android versions before Lollipop ([issue](/../../issues/2202))
|
||||||
|
* Running XPrivacy in compatibility mode on Android 5.x, except for stock ROMs ([issue](/../../issues/2201))
|
||||||
|
|
||||||
|
**Version 3.6.13 BETA**
|
||||||
|
|
||||||
|
* Fixed *getDeviceId* (IMEI) restriction for Android 5.0.x ([issue](/../../issues/2200))
|
||||||
|
* Added an second folder for importing the pro license
|
||||||
|
|
||||||
|
**Version 3.6.12 BETA**
|
||||||
|
|
||||||
|
* Fixed Android 5.x *getDeviceId* (IMEI) restriction ([issue](/../../issues/2198))
|
||||||
|
* Added Android 5.x multi-SIM restriction support
|
||||||
|
|
||||||
|
**Version 3.6.11 TEST**
|
||||||
|
|
||||||
|
* Fixed Android 5.x restrictions ([issue](/../../issues/2195))
|
||||||
|
|
||||||
|
**Version 3.6.10 TEST**
|
||||||
|
|
||||||
|
* Android 5.x compatibility
|
||||||
|
|
||||||
|
Big thanks to [dk-zero-cool](https://github.com/dk-zero-cool) !
|
||||||
|
|
||||||
|
**Version 3.6.9 STABLE**
|
||||||
|
|
||||||
|
**This release does not fix anything for Android 5.x**
|
||||||
|
|
||||||
|
**Please read the [release announcement](http://forum.xda-developers.com/showpost.php?p=60176107&postcount=14481)**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Fixed restrictions *getToken* and *getTokenWithNotification* ([issue](/../../issues/2169))
|
||||||
|
* Fixed restriction *AdvertisingId* ([issue](/../../issues/2166))
|
||||||
|
* Added restriction *GMS5.getCurrentPlace*
|
||||||
|
* Updated Norwegian translation
|
||||||
|
|
||||||
|
**Version 3.6.8 UNSUPPORTED**
|
||||||
|
|
||||||
|
* Running in compatibility mode on Lollipop
|
||||||
|
* Updated to SDK 22 (Android 5.1)
|
||||||
|
|
||||||
|
**Version 3.6.7 UNSUPPORTED**
|
||||||
|
|
||||||
|
* Fixed need for editing kernel image by using an SELinux loophole
|
||||||
|
* Fixed bootloop caused by accessing */data/data* in SELinux restrictive mode
|
||||||
|
|
||||||
|
**Version 3.6.6 UNSUPPORTED**
|
||||||
|
|
||||||
|
* Android 5.x (Lollipop) support
|
||||||
|
* Reverted "Manage white/black lists from usage data" ([issue](/../../issues/2093))
|
||||||
|
* Added menu *Manage whitelists* to usage data view for a single application ([issue](/../../issues/2093))
|
||||||
|
* Updated Czech translation
|
||||||
|
|
||||||
|
**Version 3.6.5 BETA**
|
||||||
|
|
||||||
|
* Use application whitelist for *getPackagesForUid* and *Srv_getPackagesForUid* ([issue](/../../issues/2116))
|
||||||
|
* Manage white/black lists from usage data ([issue](/../../issues/2093))
|
||||||
|
* Long pressing the uid will toggle the whitelist entry and show the whitelist manager
|
||||||
|
|
||||||
|
**Version 3.6.2 STABLE**
|
||||||
|
|
||||||
|
* Block *ACTION_NEW_OUTGOING_CALL* and *ACTION_PHONE_STATE_CHANGED* instead of faking phone number ([issue](/../../issues/2132))
|
||||||
|
* Renamed restriction *View.WebView* into *View.initUserAgentString*
|
||||||
|
* Added restriction *View.postUrl*
|
||||||
|
* Changed restriction *View.loadUrl* to restrict loading URLs instead of restriction the user agent string ([issue](/../../issues/2123))
|
||||||
|
* Existing *loadUrl* restrictions will be reset and set to ask
|
||||||
|
|
||||||
|
**Version 3.6.1 STABLE**
|
||||||
|
|
||||||
|
* Fixed location restriction in AOSP mode ([issue](/../../issues/2129))
|
||||||
|
|
||||||
|
**Version 3.6 STABLE**
|
||||||
|
|
||||||
|
* Stable re-release of version 3.5.11
|
||||||
|
|
||||||
|
**Version 3.5.11 BETA**
|
||||||
|
|
||||||
|
* Prevent opening wrong application details ([issue](/../../issues/2109))
|
||||||
|
* Fixed restriction *USB.getSerialNumber*
|
||||||
|
* Added restriction *Cast.getDeviceId* and *Cast.getIpAddress* ([issue](/../../issues/2108))
|
||||||
|
|
||||||
|
**Version 3.5.10 BETA**
|
||||||
|
|
||||||
|
* Fixed disabling location updates in compatibility mode ([issue](/../../issues/2105))
|
||||||
|
* Removed Cydia Substrate library
|
||||||
|
* Updated Hindi translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
**Version 3.5.9 BETA**
|
||||||
|
|
||||||
|
* Prevent accidental application icon/name clicks ([issue](/../../issues/2095))
|
||||||
|
* Scale application icons ([issue](/../../issues/2095))
|
||||||
|
|
||||||
|
**Version 3.5.8 BETA**
|
||||||
|
|
||||||
|
* Disabled application icon caching ([issue](/../../issues/2094))
|
||||||
|
* Removed Cydia Substrate support ([issue](/../../issues/2087))
|
||||||
|
|
||||||
|
**Version 3.5.7 BETA**
|
||||||
|
|
||||||
|
* Fixed allowing applications
|
||||||
|
* Updated Catalan translation
|
||||||
|
|
||||||
|
**Version 3.5.6 TEST**
|
||||||
|
|
||||||
|
KitKat or before:
|
||||||
|
|
||||||
|
* Added restriction *Srv_getAccountsForPackage*
|
||||||
|
* Added account type parameter for *Srv_getAccounts* and *Srv_getAccountsAsUser*
|
||||||
|
* Added restrictions for [LinkProperties](http://developer.android.com/reference/android/net/LinkProperties.html)
|
||||||
|
* Added quirk *nousage* to disable usage data for specific applications ([issue](/../../issues/2085))
|
||||||
|
* Updated support library
|
||||||
|
* Updated Catalan translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
Lollipop:
|
||||||
|
|
||||||
|
* Added restriction *Srv_startActivityAsCaller* ([issue](/../../issues/1757))
|
||||||
|
* Check external storage directory for *open* restriction ([issue](/../../issues/1757))
|
||||||
|
* Added restriction *getInstalledProvidersForProfile* ([issue](/../../issues/1757))
|
||||||
|
* Allow white listing / show parameter of *getExternalStorageState* ([issue](/../../issues/1757))
|
||||||
|
* Added restrictions for [UsageStatsManager](https://developer.android.com/reference/android/app/usage/UsageStatsManager.html) ([issue](/../../issues/1757))
|
||||||
|
* Added restrictions *IpPrefix.getAddress* and *IpPrefix.getRawAddress* ([issue](/../../issues/1757))
|
||||||
|
* Added restrictions *InetAddress.getAllByNameOnNet* and *InetAddress.getByNameOnNet* ([issue](/../../issues/1757))
|
||||||
|
* Added restriction *Srv_getCurrentSyncsAsUser* ([issue](/../../issues/1757))
|
||||||
|
* Added restrictions *Srv_addGpsMeasurementsListener* and *Srv_addGpsNavigationMessageListener* ([issue](/../../issues/1757))
|
||||||
|
* Added restrictions *getCarrierConfigValues* and *sendMultimediaMessage* ([issue](/../../issues/1757))
|
||||||
|
* Added restrictions *Srv_getImei*, *Srv_getIsimIst* and *Srv_getIsimPcscf* ([issue](/../../issues/1757))
|
||||||
|
* Added restrictions *Srv_enableLocationUpdatesForSubscriber*, *Srv_getCdmaMdn*, *Srv_getCdmaMin*, *getLine1AlphaTagForDisplay* and *Srv_getLine1NumberForDisplay* ([issue](/../../issues/1757))
|
||||||
|
|
||||||
|
**Version 3.5.5 BETA**
|
||||||
|
|
||||||
|
* Silently allow *Srv_getPackageInfo*/*Srv_getApplicationInfo* for own packages again
|
||||||
|
|
||||||
|
**Version 3.5.4 BETA**
|
||||||
|
|
||||||
|
* Broadcast *biz.bokhorst.xprivacy.action.EXCEPTION* if the database could not be read ([issue](/../../issues/2081))
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Allow querying information about own package in most cases ([issue](/../../issues/2079))
|
||||||
|
* Updated French translation
|
||||||
|
* Updated Indonesian translation
|
||||||
|
* Updated Polish translation
|
||||||
|
|
||||||
|
**Version 3.5.3 BETA**
|
||||||
|
|
||||||
|
* Restart notification for *requestLocationUpdates*, *requestSingleUpdate* and *Srv_requestLocationUpdates*
|
||||||
|
* Notify and do not send the intent *biz.bokhorst.xprivacy.action.ACTIVE* when the privacy database was corrupt (discussed on XDA)
|
||||||
|
|
||||||
|
**Version 3.5.2 BETA**
|
||||||
|
|
||||||
|
* Fixed global *freeze* quirk
|
||||||
|
|
||||||
|
**Version 3.5.1 BETA**
|
||||||
|
|
||||||
|
* Show parameter to *getPackagesForUid*/*Srv_getPackagesForUid*
|
||||||
|
* Fixed renaming long template names ([issue](/../../issues/2052))
|
||||||
|
* Fixed using *Srv_requestLocationUpdates* in compatibility mode ([issue](/../../issues/2050))
|
||||||
|
* Allow quirk *freeze* per application
|
||||||
|
|
||||||
|
[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
|
||||||
|
|
||||||
|
**Version 3.5 STABLE**
|
||||||
|
|
||||||
|
* Material design
|
||||||
|
* New icon, thanks @[Primokorn](http://forum.xda-developers.com/member.php?u=4958579)
|
||||||
|
|
||||||
|
**Version 3.4.14 BETA**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Added support for Android TV
|
||||||
|
* Using accent color for in view progress bar
|
||||||
|
* New icon, thanks @[daniel_m](http://forum.xda-developers.com/member.php?u=4885896)
|
||||||
|
* Added Korean translation
|
||||||
|
* Updated Arabic translation
|
||||||
|
* Updated Norwegian translation
|
||||||
|
|
||||||
|
**Version 3.4.13 BETA**
|
||||||
|
|
||||||
|
* Fixed search by reverting to holo search ([issue](/../../issues/2043))
|
||||||
|
|
||||||
|
**Version 3.4.12 BETA**
|
||||||
|
|
||||||
|
* Usage data for functions which cannot be restricted
|
||||||
|
* Fixed double tap search
|
||||||
|
* Allow more identification functions to be restricted for XPrivacy itself
|
||||||
|
* Updated French translation
|
||||||
|
|
||||||
|
**Version 3.4.11 BETA**
|
||||||
|
|
||||||
|
* Use material design toolbar
|
||||||
|
* Updated Lithuanian translation
|
||||||
|
|
||||||
|
**Version 3.4.10 BETA**
|
||||||
|
|
||||||
|
* Progress dialog bar in accent color
|
||||||
|
|
||||||
|
**Version 3.4.9 BETA**
|
||||||
|
|
||||||
|
* Changed accent color to orange
|
||||||
|
|
||||||
|
**Version 3.4.8 TEST**
|
||||||
|
|
||||||
|
* Use material design switch in application details view
|
||||||
|
|
||||||
|
**Version 3.4.7 TEST**
|
||||||
|
|
||||||
|
* Using teal as material design colors
|
||||||
|
|
||||||
|
**Version 3.4.6 TEST**
|
||||||
|
|
||||||
|
* Use accent color for custom check boxes and list item press
|
||||||
|
|
||||||
|
**Version 3.4.5 TEST**
|
||||||
|
|
||||||
|
* Fixed search view ([issue](/../../issues/2037))
|
||||||
|
|
||||||
|
**Version 3.4.4 TEST**
|
||||||
|
|
||||||
|
* Custom material design colors
|
||||||
|
|
||||||
|
**Version 3.4.3 TEST**
|
||||||
|
|
||||||
|
* Fixed settings save/cancel action
|
||||||
|
|
||||||
|
**Version 3.4.2 TEST**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Updated Android support library project
|
||||||
|
* Using Android SDK CardView library
|
||||||
|
* Material design
|
||||||
|
* Use subtitle for operation name
|
||||||
|
* Updated Norwegian translation
|
||||||
|
|
||||||
|
**Version 3.4.1 BETA**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Fixed warning *Native call method*
|
||||||
|
* Fixed documentation icons not appearing when opening from notification ([issue](/../../issues/2025))
|
||||||
|
* Added title to original value in usage data
|
||||||
|
* Added support for [Omega ROM](http://omegadroid.co/omega-roms/)
|
||||||
|
* Updated Indonesian translation
|
||||||
|
* Updated Russian translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
* Updated Vietnamese translation
|
||||||
|
|
||||||
|
**Version 3.4 STABLE**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
|
||||||
|
**Version 3.3.4 BETA**
|
||||||
|
|
||||||
|
* Strip IP address from IP address / domain name pair for better wildcards ([issue](/../../issues/2014))
|
||||||
|
* Added Welsh translation
|
||||||
|
|
||||||
|
**Version 3.3.3 BETA**
|
||||||
|
|
||||||
|
* Fixed displaying applications with the same name once in select to allow list ([issue](/../../issues/2013))
|
||||||
|
|
||||||
|
**Version 3.3.2 BETA**
|
||||||
|
|
||||||
|
* Improved IP address / host name parsing
|
||||||
|
|
||||||
|
**Version 3.3.1 BETA**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Strip leading slash from IP address for improved wildcards
|
||||||
|
* Better [Cydia Substrate](http://www.xda-developers.com/android/cydia-substrate-released-by-saurik-for-android/) support
|
||||||
|
* Updated Malay translation
|
||||||
|
* Updated Polish translation
|
||||||
|
* Updated Russian translation
|
||||||
|
|
||||||
|
**Version 3.3 STABLE**
|
||||||
|
|
||||||
|
* Display legend on first run
|
||||||
|
* Updated Japanese translation
|
||||||
|
* Updated Lithuanian translation
|
||||||
|
|
||||||
|
**Version 3.2.5 BETA**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Updated Indonesian translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
|
||||||
|
|
||||||
|
**Version 3.2.4 TEST**
|
||||||
|
|
||||||
|
* Persist/show original values for: ([pro license](http://www.xprivacy.eu/) only) ([issue](/../../issues/1297))
|
||||||
|
* advertisement ID
|
||||||
|
* phone number
|
||||||
|
* Android ID
|
||||||
|
* Persisting/showing fake values would require an extra call to the privacy service, which would impact performance
|
||||||
|
* Added settings menu to usage data view
|
||||||
|
* Using [CardView library](https://github.com/yongjhih/CardView)
|
||||||
|
* There are no rounded corners when using the dark theme
|
||||||
|
* Added [Material Design](https://developer.android.com/preview/material/index.html) styles (this will **not** work on Android KitKat and before)
|
||||||
|
|
||||||
|
**Version 3.2.3 TEST**
|
||||||
|
|
||||||
|
* Persist/show original values ([pro license](http://www.xprivacy.eu/) only) ([issue](/../../issues/1297))
|
||||||
|
* Persisting/showing fake values would require an extra call to the privacy service, which would impact performance
|
||||||
|
* Proof of concept with *SERIAL*
|
||||||
|
* Flush local application caches too
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Indonesian translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
**Version 3.2.2 BETA**
|
||||||
|
|
||||||
|
* Added option to rename templates ([issue](/../../issues/1723))
|
||||||
|
* Restored select all ([issue](/../../issues/1977)) ([issue](/../../issues/1986))
|
||||||
|
* Updated Dutch translation
|
||||||
|
|
||||||
|
**Version 3.2.1 BETA**
|
||||||
|
|
||||||
|
* Fixed details view tutorial header
|
||||||
|
* Made disabled main list entries clickable
|
||||||
|
* Show half check box only to expert users
|
||||||
|
* Always show default for on demand restricting time out
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated traditional Chinese translation
|
||||||
|
|
||||||
|
**Version 3.2 STABLE**
|
||||||
|
|
||||||
|
* Updated Slovak translation
|
||||||
|
* Updated Spanish translation
|
||||||
|
|
||||||
|
**Version 3.1.5 BETA**
|
||||||
|
|
||||||
|
* Select all enabled applications ([issue](/../../issues/1977))
|
||||||
|
|
||||||
|
**Version 3.1.4 BETA**
|
||||||
|
|
||||||
|
* Added help text to application specific settings ([issue](/../../issues/1968))
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Indonesian translation
|
||||||
|
|
||||||
|
**Version 3.1.3 BETA**
|
||||||
|
|
||||||
|
* Mark application as changed / update last modification time when white/black listing
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
**Version 3.1.2 BETA**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Added usage data white/black list help text
|
||||||
|
* Mark application as changed / update last modification time when white/black listing
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Indonesian translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
|
||||||
|
**Version 3.1.1 STABLE**
|
||||||
|
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Showing message when enabling expert mode / using an expert function
|
||||||
|
* Scroll view for toggle restrictions radio buttons
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated Indonesian translation
|
||||||
|
|
||||||
|
**Version 3.1 STABLE**
|
||||||
|
|
||||||
|
* Showing appropriate main and details help ([issue](/../../issues/1921))
|
||||||
|
* Showing application name above usage data ([issue](/../../issues/1949))
|
||||||
|
* Showing category help ("i"-icon application list) in web view ([issue](/../../issues/1943))
|
||||||
|
* Showing category help ("i"-icon application details) in dialog
|
||||||
|
* Removed menu *Check for updates*
|
||||||
|
|
||||||
|
**Version 3.0.3 BETA**
|
||||||
|
|
||||||
|
* Improved settings layout ([pull request](/../../issues/1946))
|
||||||
|
* Improved function help layout ([pull request](/../../issues/1947))
|
||||||
|
|
||||||
|
**Version 3.0.2 BETA**
|
||||||
|
|
||||||
|
* Layout improvements
|
||||||
|
* Fixed tutorial header
|
||||||
|
* Fixed Indonesian translation
|
||||||
|
* Updated Lithuanian translation
|
||||||
|
|
||||||
|
**Version 3.0.1 BETA**
|
||||||
|
|
||||||
|
* Improved database locking ([pull request](/../../issues/1939))
|
||||||
|
* Changed settings dialog to settings activity ([pull request](/../../issues/1938))
|
||||||
|
* Moved flush button to expert mode section ([issue](/../../issues/1934))
|
||||||
|
* Added category merge/reset ([issue](/../../issues/1909))
|
||||||
|
* Display introductory tutorial only on first run after *About* ([issue](/../../issues/1942))
|
||||||
|
* Moved search to action bar ([issue](/../../issues/1918))
|
||||||
|
* Added Indonesian translation
|
||||||
|
* Updated simplified Chinese translation
|
||||||
|
|
||||||
|
**Version 3.0 STABLE**
|
||||||
|
|
||||||
|
Main changes since stable version 2.2.1:
|
||||||
|
|
||||||
|
* Reviewed all about 250 restrictions, resulting in numerous changes, mainly visible as performance improvements
|
||||||
|
* Added about 150 new restrictions to fix the unhook vulnerability, see [FAQ #68](https://github.com/M66B/XPrivacy#FAQ68) for details
|
||||||
|
* Reorganized menus, action bar items and other user interface elements to improve usability
|
||||||
|
* Fixed all reported bugs and implemented lots of requested features
|
||||||
|
* See for all details the changelogs of version 2.99.x
|
||||||
|
|
||||||
|
Other changes:
|
||||||
|
|
||||||
|
* Updated Italian translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
* Updated Norwegian translation
|
||||||
|
|
||||||
|
**Version 2.99.43 BETA**
|
||||||
|
|
||||||
|
* Layout improvement ([pull request](/../../issues/1933))
|
||||||
|
* Show usage statistics as subtitle
|
||||||
|
|
||||||
|
**Version 2.99.42 BETA**
|
||||||
|
|
||||||
|
* Layout and text improvements
|
||||||
|
* Updated Arabic translation
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Lithuanian translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
**Version 2.99.41 BETA**
|
||||||
|
|
||||||
|
* Replaced *Play* action by *Operations* menu
|
||||||
|
* Moved *Help* action bar item to *Legend* menu
|
||||||
|
* Renamed filter button *Clear all* to *Default* ([issue](/../../issues/1920))
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
|
||||||
|
**Version 2.99.40 BETA**
|
||||||
|
|
||||||
|
* Fixed long application names not showing
|
||||||
|
|
||||||
|
**Version 2.99.39 BETA**
|
||||||
|
|
||||||
|
* Moved clear all data to settings dialog
|
||||||
|
|
||||||
|
**Version 2.99.38 BETA**
|
||||||
|
|
||||||
|
* Clear filters will reset the filters to their default state
|
||||||
|
* Changed on demand restricting progress bar to holo style
|
||||||
|
* Clicking the application name will open the application details view
|
||||||
|
* Changed multiple selection background color
|
||||||
|
* Reorganized menus and action bar items
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Lithuanian translation
|
||||||
|
* Updated Russian translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
**Version 2.99.37 BETA**
|
||||||
|
|
||||||
|
* Clear will also clear usage data and application specific settings
|
||||||
|
* Changed application specific fake values icon to a star ([issue](/../../issues/1831))
|
||||||
|
* Showing changelog if new version installed
|
||||||
|
* Updated Arabic translation
|
||||||
|
* Updated Italian translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
|
||||||
|
**Version 2.99.36 BETA**
|
||||||
|
|
||||||
|
* Displaying AOSP mode setting for KitKat and later only
|
||||||
|
* Added help texts
|
||||||
|
* Added option to merge template to reset functions (not categories)
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
* Updated Lithuanian translation
|
||||||
|
* Updated Norwegian translation
|
||||||
|
* Updated simplified Chinese translation
|
||||||
|
* Updated traditional Chinese translation
|
||||||
|
|
||||||
|
**Version 2.99.35 BETA**
|
||||||
|
|
||||||
|
* Added support for [Mahdi ROM](https://plus.google.com/u/0/communities/116540622179206449806)
|
||||||
|
* Added option to enable/disable AOSP mode
|
||||||
|
* Updated in application documentation
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
* Updated traditional Chinese translation
|
||||||
|
|
||||||
|
**Version 2.99.34 BETA**
|
||||||
|
|
||||||
|
* Displaying if an application has specific fake values ([issue](/../../issues/1831))
|
||||||
|
* Allow own package name for *Srv_getPackageInfo* and *Srv_getApplicationInfo*
|
||||||
|
* Updated Dutch translation
|
||||||
|
|
||||||
|
**Version 2.99.33 BETA**
|
||||||
|
|
||||||
|
* Fixed crash caused by legacy restrictions ([issue](/../../issues/1893))
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
**Version 2.99.32 BETA**
|
||||||
|
|
||||||
|
* Added parameter package name to *Srv_getPackageInfo* and *Srv_getApplicationInfo*
|
||||||
|
* Added support for [Android Revolution HD](http://forum.xda-developers.com/showthread.php?t=1925402)
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Updated French translation
|
||||||
|
* Updated German translation
|
||||||
|
|
||||||
|
**Version 2.99.31 BETA**
|
||||||
|
|
||||||
|
* Flush will clear the asked once cache too
|
||||||
|
* Display if update service is busy in reboot layout ([issue](/../../issues/1887))
|
||||||
|
* Fixed asking again in some cases ([issue](/../../issues/1885))
|
||||||
|
* Performance improvement (caching category restrictions)
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated French translation
|
||||||
|
* Updated Slovenian translation
|
||||||
|
|
||||||
|
**Version 2.99.30 BETA**
|
||||||
|
|
||||||
|
* Added help items to template ([issue](/../../issues/1827))
|
||||||
|
* Added restrictions *Srv_getPackageInfo* and *Srv_getApplicationInfo* ([issue](/../../issues/1834))
|
||||||
|
|
||||||
|
**Version 2.99.29 BETA**
|
||||||
|
|
||||||
|
* Added application specific quirks ([issue](/../../issues/1844))
|
||||||
|
* Added intent for update check ([issue](/../../issues/1867))
|
||||||
|
* Changed the default to *noresolve* and added quirk *resolve*
|
||||||
|
* Fixed all problems reported through the debug info
|
||||||
|
* Updated Simplified Chinese translation
|
||||||
|
|
||||||
|
**Version 2.99.27 BETA**
|
||||||
|
|
||||||
|
* Added restriction *registerListener* to the *Sensors* category, which will limit the rate of the gyroscope to 100 Hz to prevent eavesdropping ([issue](/../../issues/1878))
|
||||||
|
* Added restriction [GMS5.view](https://developer.android.com/reference/com/google/android/gms/appindexing/AppIndexApi.html) ([issue](/../../issues/1778))
|
||||||
|
* Updated French translation
|
||||||
|
* Updated Slovenian translation
|
||||||
|
|
||||||
|
**Version 2.99.26 BETA**
|
||||||
|
|
||||||
|
* Added restriction *GMS5.getLastLocation* and *GMS5.requestLocationUpdates* ([issue](/../../issues/1774))
|
||||||
|
* Added restriction *GMS.requestActivityUpdates* ([issue](/../../issues/1774))
|
||||||
|
|
||||||
|
**Version 2.99.25 BETA**
|
||||||
|
|
||||||
|
* Performance optimizations
|
||||||
|
|
||||||
|
**Version 2.99.24 BETA**
|
||||||
|
|
||||||
|
* Fixed asking again for allow/deny once longer than 15 seconds ([issue](/../../issues/1873))
|
||||||
|
* Force drop down mode for on demand duration
|
||||||
|
|
||||||
|
**Version 2.99.23 BETA**
|
||||||
|
|
||||||
|
* Fixed a problem reported through the debug info
|
||||||
|
* *Unknown method=Camera.stopPreview*
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated Japanese translation
|
||||||
|
|
||||||
|
**Version 2.99.22 BETA**
|
||||||
|
|
||||||
|
* Option to select duration to allow/deny once ([issue](/../../issues/1873))
|
||||||
|
|
||||||
|
**Version 2.99.21 BETA**
|
||||||
|
|
||||||
|
* Restored restriction *Camera.setPreviewCallback*
|
||||||
|
* Added restrictions *Camera.setPreviewCallbackWithBuffer*, *Camera.setPreviewDisplay*, *Camera.setPreviewTexture* and *Camera.setOneShotPreviewCallback*
|
||||||
|
* Handling *Camera.stopPreview*
|
||||||
|
* Handling *MediaRecorder.prepare* and *MediaRecorder.stop*
|
||||||
|
* Handling *Audio.stop*
|
||||||
|
|
||||||
|
**Version 2.99.20 BETA**
|
||||||
|
|
||||||
|
* Restored restriction *MediaRecorder.setOutputFile* ([issue](/../../issues/1874))
|
||||||
|
|
||||||
|
**Version 2.99.19 BETA**
|
||||||
|
|
||||||
|
* Local transient values only
|
||||||
|
|
||||||
|
**Version 2.99.18 BETA**
|
||||||
|
|
||||||
|
* Fixed hooking contacts and telephony providers
|
||||||
|
|
||||||
|
**Version 2.99.17 BETA**
|
||||||
|
|
||||||
|
* Fixed support info warning (transient values)
|
||||||
|
|
||||||
|
**Version 2.99.16 BETA**
|
||||||
|
|
||||||
|
* Better browser provider compatibility
|
||||||
|
|
||||||
|
**Version 2.99.15 BETA**
|
||||||
|
|
||||||
|
* Added support for [Dirty Unicorns](http://www.teamdirt.me/)
|
||||||
|
* Added support for [Liquid Smooth](http://liquidsmooth.net/)
|
||||||
|
* Added support for some CyanogenMod based ROMs, like Spirit ROM
|
||||||
|
* Moved *getAllByName*, *getByAddress* and *getByName* to *internet*
|
||||||
|
* Since these functions were moved recently, it is not possible to automatically update them
|
||||||
|
* Performance optimizations (introduced transient values)
|
||||||
|
* Fixed all problems reported through the support data
|
||||||
|
* Allow own uid for *getPackagesForUid* and *queryContentProviders* ([issue](/../../issues/1871))
|
||||||
|
* Updated Dutch translation
|
||||||
|
* Updated Italian translation
|
||||||
|
|
||||||
|
**Version 2.99.14 BETA**
|
||||||
|
|
||||||
|
* Fixed restriction *WiFi.Srv_getConnectionInfo*
|
||||||
|
* Fixed restriction *WiFi.Srv_getDhcpInfo*
|
||||||
|
* Fixed restriction *BrowserProvider2*
|
||||||
|
|
||||||
|
**Version 2.99.13 BETA**
|
||||||
|
|
||||||
|
* Added support for [Carbon ROM](https://carbonrom.org/)
|
||||||
|
* Updated Dutch translation
|
||||||
|
|
||||||
|
**Version 2.99.12 BETA**
|
||||||
|
|
||||||
|
* Removed restrictions *MapV1.getLatitudeE6* and *MapV1.getLongitudeE6*, since these are not needed and bad for performance ([issue](/../../issues/1862))
|
||||||
|
* Handling *MapV1.disableMyLocation* when *MapV1.enableMyLocation* is restricted
|
||||||
|
|
||||||
|
**Version 2.99.11 TEST**
|
||||||
|
|
||||||
|
* Added support for [SlimKat](http://www.slimroms.net/)
|
||||||
|
|
||||||
|
**Version 2.99.10 TEST** (only available for testers)
|
||||||
|
|
||||||
|
* Added icon for unsafe restrictions
|
||||||
|
* Added system property restrictions *Srv_Default_DNS* and *Srv_WiFi_Country*
|
||||||
|
* Added restriction *Bluetooth.Srv_getName*
|
||||||
|
* Added restriction *Srv_getCompleteVoiceMailNumber*
|
||||||
|
* Added restriction *WiFi.Srv_getBatchedScanResults*
|
||||||
|
* Replaced unsafe restrictions by safe restrictions where possible (not in legacy mode)
|
||||||
|
* Updated German translation
|
||||||
|
* Updated Slovak translation
|
||||||
|
|
||||||
|
<a name="xprivacy2"></a>
|
||||||
|
For XPrivacy version 2.x, see the [older changelogs](CHANGELOG-LEGACY.md)
|
@ -0,0 +1,674 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
the GNU General Public License is intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users. We, the Free Software Foundation, use the
|
||||||
|
GNU General Public License for most of our software; it applies also to
|
||||||
|
any other work released this way by its authors. You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to prevent others from denying you
|
||||||
|
these rights or asking you to surrender the rights. Therefore, you have
|
||||||
|
certain responsibilities if you distribute copies of the software, or if
|
||||||
|
you modify it: responsibilities to respect the freedom of others.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must pass on to the recipients the same
|
||||||
|
freedoms that you received. You must make sure that they, too, receive
|
||||||
|
or can get the source code. And you must show them these terms so they
|
||||||
|
know their rights.
|
||||||
|
|
||||||
|
Developers that use the GNU GPL protect your rights with two steps:
|
||||||
|
(1) assert copyright on the software, and (2) offer you this License
|
||||||
|
giving you legal permission to copy, distribute and/or modify it.
|
||||||
|
|
||||||
|
For the developers' and authors' protection, the GPL clearly explains
|
||||||
|
that there is no warranty for this free software. For both users' and
|
||||||
|
authors' sake, the GPL requires that modified versions be marked as
|
||||||
|
changed, so that their problems will not be attributed erroneously to
|
||||||
|
authors of previous versions.
|
||||||
|
|
||||||
|
Some devices are designed to deny users access to install or run
|
||||||
|
modified versions of the software inside them, although the manufacturer
|
||||||
|
can do so. This is fundamentally incompatible with the aim of
|
||||||
|
protecting users' freedom to change the software. The systematic
|
||||||
|
pattern of such abuse occurs in the area of products for individuals to
|
||||||
|
use, which is precisely where it is most unacceptable. Therefore, we
|
||||||
|
have designed this version of the GPL to prohibit the practice for those
|
||||||
|
products. If such problems arise substantially in other domains, we
|
||||||
|
stand ready to extend this provision to those domains in future versions
|
||||||
|
of the GPL, as needed to protect the freedom of users.
|
||||||
|
|
||||||
|
Finally, every program is threatened constantly by software patents.
|
||||||
|
States should not allow patents to restrict development and use of
|
||||||
|
software on general-purpose computers, but in those that do, we wish to
|
||||||
|
avoid the special danger that patents applied to a free program could
|
||||||
|
make it effectively proprietary. To prevent this, the GPL assures that
|
||||||
|
patents cannot be used to render the program non-free.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Use with the GNU Affero General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU Affero General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the special requirements of the GNU Affero General Public License,
|
||||||
|
section 13, concerning interaction through a network will apply to the
|
||||||
|
combination as such.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program does terminal interaction, make it output a short
|
||||||
|
notice like this when it starts in an interactive mode:
|
||||||
|
|
||||||
|
<program> Copyright (C) <year> <name of author>
|
||||||
|
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, your program's commands
|
||||||
|
might be different; for a GUI interface, you would use an "about box".
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU GPL, see
|
||||||
|
<http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
The GNU General Public License does not permit incorporating your program
|
||||||
|
into proprietary programs. If your program is a subroutine library, you
|
||||||
|
may consider it more useful to permit linking proprietary applications with
|
||||||
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
|
Public License instead of this License. But first, please read
|
||||||
|
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
@ -0,0 +1,124 @@
|
|||||||
|
<h2>XPrivacy Menus</h2>
|
||||||
|
|
||||||
|
<h3>Menu - App list</h3>
|
||||||
|
* Tutorial - this will open the tutorial
|
||||||
|
* Usage data - this will show the usage data for all apps for all categories, or the category selected in the category selection drop down
|
||||||
|
* Menu - Usage data
|
||||||
|
* Toggle filter - this will toggle between all and only-denied restrictions
|
||||||
|
* Refresh - this will refresh the current view
|
||||||
|
* Clear - this will clear the entire usage data list
|
||||||
|
* Toggle restrictions - this will allow you to apply a template to selected apps for either one or all categories
|
||||||
|
* Category drop down - here you can select to which category to apply the change
|
||||||
|
* Clear - this will clear restrictions for the selected category
|
||||||
|
* Restrict (categories) - this will restrict the selected category
|
||||||
|
* Apply template (categories) - this will apply the selected template to the selected category
|
||||||
|
* Apply template (categories+functions) - this will apply the selected template to selected category and subfunctions
|
||||||
|
* Enable on demand restriction - this will enable on demand for the selected apps
|
||||||
|
* Disable on demand restrictions - this will disable on demand for the selected apps
|
||||||
|
* Clear all XPrivacy data - this will delete all restrictions, settings, and whitelists; use with caution
|
||||||
|
* Export - this will create a restriction and settings backup of all or the selected apps *1
|
||||||
|
* Import - this will import restrictions and settings from a backup for all or the selected apps *1
|
||||||
|
* Submit restrictions - this will submit restrictions for the selected apps to the crowd server
|
||||||
|
* Fetch restrictions - this will fetch restrictions for the selected apps from the crowd server *1
|
||||||
|
* Report issue - this will open a broswer to submit a new issue on GitHub
|
||||||
|
* Switch theme - this will switch the UI between the light and dark themes
|
||||||
|
* Template - this will allow you set restrictions for the default and alternate templates
|
||||||
|
* Template selector drop down - here you can select which template you want to adjust
|
||||||
|
* Note - functions marked as 'dangerous' are indicated with a red background (predefined) or an orange background (user-defined); long-pressing on a function will change its 'dangerous' status
|
||||||
|
* Settings - here you can set global settings as well as global fake values
|
||||||
|
* Update notifications - this will enable/disable update noticification for all app updates
|
||||||
|
* Restrict on demand - this will enable/disable on demand for all apps
|
||||||
|
* Show application usage data - this will toggle usage data logging on/off for all apps
|
||||||
|
* Show parameters of usage data - this will show parameters when viewing usage data; it does not affect what is actually logged; it only affects what is displayed
|
||||||
|
* Show values of usage data - this will show values when viewing usage data; it does not affect what is actually logged; it only affects what is displayed
|
||||||
|
* Debug log (requires reboot) - this will turn on additional logging for troubleshooting
|
||||||
|
* Expert mode
|
||||||
|
* Restrict system components (Android) - this will toggle restrictions for core android components (UID less than 10000) on/off
|
||||||
|
* Use secure connections - this will enable/disable whether or not communications with the XPrivacy server use the HTTPS protocol
|
||||||
|
* FAKE DATA
|
||||||
|
* Randomize on boot - this will randomize all global fake values on boot
|
||||||
|
* Randomize now - this will randomize all global fake values
|
||||||
|
* Clear - this will clear all global fake values and all 'Randomize on access' check marks
|
||||||
|
* Flush cache - this will clear the server-side restrictions cache
|
||||||
|
* Randomize on access - here you can check which values should be randomized each time it access by an app
|
||||||
|
* About - this will show information about the current XPrivacy version, as well as license status
|
||||||
|
|
||||||
|
<h3>Menu - App detail view</h3>
|
||||||
|
* Tutorial - this will open the tutorial
|
||||||
|
* Usage data - this will show the usage data for the selected app
|
||||||
|
* Menu - Usage data
|
||||||
|
* Toggle filter - this will toggle between all and only-denied restrictions
|
||||||
|
* Refresh - this will refresh the current view
|
||||||
|
* Clear - this will clear the usage data list for the selected app
|
||||||
|
* Apply template - this will allow you to apply a template to the selected app for either one or all categories
|
||||||
|
* Category drop down - here you can select to which category to apply the change
|
||||||
|
* Clear - this will clear restrictions for the selected category
|
||||||
|
* Restrict (categories) - this will restrict the select selected category
|
||||||
|
* Aplly template (categories) - this will apply the selected template to the selected category
|
||||||
|
* Apply template (categories+functions) - this will apply the selected template to selected category and subfunctions
|
||||||
|
* Enable on demand restriction - this will enable on demand for the selected app
|
||||||
|
* Disable on demand restrictions - this will disable on demand for the selected app
|
||||||
|
* Clear - this will allow you to clear the restrictions, settings, and whitelists of the selected app
|
||||||
|
* Export - this will create a restrictions and setting backup of the selected app *1
|
||||||
|
* Import - this will import restrictions and settings for the selected app *1
|
||||||
|
* Submit restrictions - this will submit restrictions for the selected app to the crowd server
|
||||||
|
* Fetch restrictions - this will fetch crowd restrictions for the seleted app *1
|
||||||
|
* Select accounts to allow - this can be used to allow certain accounts access to the account category while restricting it for others *1
|
||||||
|
* Select applications to allow - this will allow the app to see user-specified apps while restricting others *1
|
||||||
|
* Select contacts to allow - this will allow the apps to see user-specified contacts while restricting others *1
|
||||||
|
* Manage whitelists - here previously defined white/blacklist items can be allowed/denied or removed from the list *1
|
||||||
|
* Category drop down - here you can select which white list category you want to manange
|
||||||
|
* Settings - here you can set app-specific settings and fake values
|
||||||
|
* Update notifications - this will enable/disable update noticification for app updates to the selected app
|
||||||
|
* Restrict on demand - this will enable/disable on demand for the selected app
|
||||||
|
* FAKE DATA
|
||||||
|
* Randomize on boot - this will randomize app specific fake values on boot
|
||||||
|
* Randomize now - this will randomize all app specific fake values
|
||||||
|
* Clear - this will clear all app specific fake values and all 'Randomize on access' check marks
|
||||||
|
* Randomize on access - here you can check which values should be randomized each time it access by the selected app
|
||||||
|
|
||||||
|
<h3>Application list buttons</h3>
|
||||||
|
* Select all - this will select/unselect all filtered apps
|
||||||
|
* Sort by - here you can chose how the apps will be sorted
|
||||||
|
* By name - this will sort by name A-Z
|
||||||
|
* By uid- this will sort by UID number
|
||||||
|
* By date installed - this will sort by installation date
|
||||||
|
* By date updated - this will sort by update date
|
||||||
|
* By date modified (XPrivacy) - this will sort by restriction modification time
|
||||||
|
* Invert sort order - this will invert the above selected order (i.e. by name will be shown Z-A)
|
||||||
|
* Filter - here you can filter the app list
|
||||||
|
* Filter on data usage - this will filter on global data usage or data usage for the selected category (category drop down)
|
||||||
|
* Filter on internet access - this will filter on apps which have requested internet access in android
|
||||||
|
* Filter on permission - this will filter on apps that have requested permissions, either globally or for the selected category (category drop down)
|
||||||
|
* Filter on restriction - this will filter on apps that have restrictions set, either globally or for the selected category (category drop down)
|
||||||
|
* Negate - this will show apps without restrictions
|
||||||
|
* Filter by on-demand - this will filter on apps that have on demand enabled, either globally or for the selected category (category drop down)
|
||||||
|
* Negate - this will show apps where on demand is disabled
|
||||||
|
* Filter on user applications
|
||||||
|
* Filter on system appications
|
||||||
|
* Clear all - this will clear all filters
|
||||||
|
* ? - this will show the help screen
|
||||||
|
* Category drop down - this will show category restrictions in the app list for the selected category
|
||||||
|
* Info button - this will open the XPrivacy GitHub page in a browser
|
||||||
|
* Search box - here you can search for a specific app by name or UID
|
||||||
|
* Restriction check mark - this will restrict/unrestict all or the selected category (category drop down) for an app
|
||||||
|
* On demand check mark - this will enable/disable on demand for an app or apply on demand to selected category (category drop down)
|
||||||
|
|
||||||
|
<h3>Application detail view buttons</h3>
|
||||||
|
|
||||||
|
* ? - this will show the help screen
|
||||||
|
* Info button - this will open the the crowd sourced restrictions for the selected app in a browser
|
||||||
|
* On/Off toggle- this will toggle restrictions for the selected app on/off without deleting the restriction settings
|
||||||
|
* On demand ? - this will toggle on demand restrictions for the selected app
|
||||||
|
* Category drill down - this will show or hide the individual functions of a category
|
||||||
|
* Category info icon - this will open the category restrcions info on GitHub in a browser
|
||||||
|
* Function book icon - this will show additional information about the function, possibly with a link to the Google documentation
|
||||||
|
* Category restriction check mark - this will restrict/unrestrict the category for the selected app
|
||||||
|
* Category on demand check mark - this will enable/disable on demand popups to the functions in the cateogry for the selected app
|
||||||
|
* Function restrction check mark - this will restrict/unrestrict the individual function
|
||||||
|
* Functions on demand check mark - this will enable/disable on demand popups for the individual function
|
||||||
|
* Manage white list icon - this will be shown if a function has white/blacklist entries, pressing it will open the white list manager to the specific list *1
|
||||||
|
|
||||||
|
*1 - Pro feature (see [Xprivacy.eu](http://xprivacy.eu) for more info)
|
||||||
|
|
||||||
|
*This page was kindly contributed by [an0n981](https://github.com/an0n981)*
|
@ -0,0 +1 @@
|
|||||||
|
Before submitting a new issue, please read the [support section](https://github.com/M66B/XPrivacy#support) first
|
@ -0,0 +1,14 @@
|
|||||||
|
To do
|
||||||
|
=====
|
||||||
|
|
||||||
|
For interested developers:
|
||||||
|
|
||||||
|
* Accessibility: *android:labelFor="..."*
|
||||||
|
* [Open issues](https://github.com/M66B/XPrivacy/issues?state=open)
|
||||||
|
* Revoke BLUETOOTH, NFC, USE_SIP
|
||||||
|
|
||||||
|
Android source code
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
git clone https://android.googlesource.com/platform/libcore -b master
|
||||||
|
git clone https://android.googlesource.com/platform/frameworks/base -b l-preview
|
@ -0,0 +1,9 @@
|
|||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAwUTkTUZ/FeRO0IszOPLW
|
||||||
|
xN4iABx9zhX34AOntRdcTEhlvh/Iu4WjQRMgPm2JnRj0HEA7WH3FHbqgKjzZghXu
|
||||||
|
aV7Lwv6TYTuLKhPPWYDVkFapWE3PjqEei3XDWPl1wUS0eOtscQIR3/Wz/UFHatgS
|
||||||
|
lO0jnWa1jBOYNzAC1CoUoj+MF2SQ1IWHcCQve7DjKSiEq8hiQxNqn2+URW1G6hDt
|
||||||
|
i/vtXdMIvkzCbKxBePdQBQFEjjwciC42wRy0vsAGzeF2S6KG/ewqplhwqFHa6HUx
|
||||||
|
uooPZ92nt4C8U5ZF9HWwGHZ7Ug4/e9x6IuLjeAoRsjprsLf0flWm2Qcjvv3FIZlC
|
||||||
|
JQIDAQAB
|
||||||
|
-----END PUBLIC KEY-----
|
@ -0,0 +1 @@
|
|||||||
|
biz.bokhorst.xprivacy.XPrivacy
|
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 9.4 KiB |
After Width: | Height: | Size: 85 KiB |
@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<lint>
|
||||||
|
<issue id="BackButton" severity="warning" />
|
||||||
|
<issue id="EasterEgg" severity="warning" />
|
||||||
|
<issue id="FieldGetter" severity="warning" />
|
||||||
|
<issue id="IconExpectedSize" severity="warning" />
|
||||||
|
<issue id="MissingTranslation" severity="error" />
|
||||||
|
<issue id="StopShip" severity="warning" />
|
||||||
|
<issue id="StringFormatCount" severity="error" />
|
||||||
|
<issue id="StringFormatInvalid" severity="warning" />
|
||||||
|
<issue id="TypographyQuotes" severity="warning" />
|
||||||
|
<issue id="UnusedIds" severity="warning" />
|
||||||
|
<issue id="Wakelock">
|
||||||
|
<ignore path="src/biz/bokhorst/xprivacy/ActivityShare.java" />
|
||||||
|
</issue>
|
||||||
|
</lint>
|
@ -0,0 +1,32 @@
|
|||||||
|
# To enable ProGuard in your project, edit project.properties
|
||||||
|
# to define the proguard.config property as described in that file.
|
||||||
|
#
|
||||||
|
# Add project specific ProGuard rules here.
|
||||||
|
# By default, the flags in this file are appended to flags specified
|
||||||
|
# in ${sdk.dir}/tools/proguard/proguard-android.txt
|
||||||
|
# You can edit the include path and order by changing the ProGuard
|
||||||
|
# include property in project.properties.
|
||||||
|
#
|
||||||
|
# For more details, see
|
||||||
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||||
|
|
||||||
|
# Add any project specific keep options here:
|
||||||
|
|
||||||
|
# If your project uses WebView with JS, uncomment the following
|
||||||
|
# and specify the fully qualified class name to the JavaScript interface
|
||||||
|
# class:
|
||||||
|
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||||
|
# public *;
|
||||||
|
#}
|
||||||
|
|
||||||
|
#Line numbers
|
||||||
|
-renamesourcefileattribute SourceFile
|
||||||
|
-keepattributes SourceFile,LineNumberTable
|
||||||
|
|
||||||
|
#Xposed
|
||||||
|
-libraryjars XposedBridgeApi-20150213.jar
|
||||||
|
|
||||||
|
#XPrivacy
|
||||||
|
-keep class biz.bokhorst.xprivacy.XPrivacy {*; }
|
||||||
|
-keepnames class biz.bokhorst.xprivacy.X* { }
|
||||||
|
-keepclassmembers class biz.bokhorst.xprivacy.Util { public static boolean isXposedEnabled(); }
|
@ -0,0 +1,17 @@
|
|||||||
|
# This file is automatically generated by Android Tools.
|
||||||
|
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
|
||||||
|
#
|
||||||
|
# This file must be checked in Version Control Systems.
|
||||||
|
#
|
||||||
|
# To customize properties used by the Ant build system edit
|
||||||
|
# "ant.properties", and override values to adapt the script to your
|
||||||
|
# project structure.
|
||||||
|
#
|
||||||
|
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
|
||||||
|
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
|
||||||
|
|
||||||
|
# Project target.
|
||||||
|
target=android-22
|
||||||
|
android.library=false
|
||||||
|
android.library.reference.1=../../sdk/extras/android/support/v7/appcompat
|
||||||
|
android.library.reference.2=../../sdk/extras/android/support/v7/cardview
|
After Width: | Height: | Size: 431 B |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 201 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 874 B |
After Width: | Height: | Size: 208 B |
After Width: | Height: | Size: 330 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.1 KiB |