首先是去除启动APP时的放大图标动画,这个方法图标动画是从安卓十二以后谷歌添加的一个新特性,任何应用冷启动或者温启动的时候都会以 splash screen 的方式,防止应用启动时显示白屏,去掉这个动画的方法如下:
diff --git a/frameworks/base/services/core/java/com/android/server/wm/TaskOrganizerController.java b/frameworks/base/services/core/java/com/android/server/wm/TaskOrganizerController.java
old mode 100644
new mode 100755
index 3ca86e8dcf2..26ca07fa2a5
--- a/frameworks/base/services/core/java/com/android/server/wm/TaskOrganizerController.java
+++ b/frameworks/base/services/core/java/com/android/server/wm/TaskOrganizerController.java
@@ -492,7 +492,7 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
boolean addStartingWindow(Task task, ActivityRecord activity, int launchTheme,
TaskSnapshot taskSnapshot) {
- final Task rootTask = task.getRootTask();
+ /* final Task rootTask = task.getRootTask();
if (rootTask == null || activity.mStartingData == null) {
return false;
}
@@ -511,8 +511,8 @@ class TaskOrganizerController extends ITaskOrganizerController.Stub {
} catch (RemoteException e) {
Slog.e(TAG, "Exception sending onTaskStart callback", e);
return false;
- }
- return true;
+ } */
+ return false;
}
在系统中任何APP在启动时的放大图标的动画都是通过调用addStartingWindow方法,我直接把这个方法的内容注释掉,就解决了此需求。下面是怎么在鲁大师中做假,鲁大师做假的比较难一点,不像安兔兔那种直接读取的是TextView中的字符串,目前我也没弄懂鲁大师是怎么读取设备参数的,不过不影响解决客户需求,具体解决办法是直接改底层,下面是解决方法: 作假内存:
diff --git a/frameworks/base/core/java/android/app/ActivityManager.java b/frameworks/base/core/java/android/app/ActivityManager.java
old mode 100644
new mode 100755
index 60b5bdaffb5..322a65a934f
--- a/frameworks/base/core/java/android/app/ActivityManager.java
+++ b/frameworks/base/core/java/android/app/ActivityManager.java
@@ -2608,7 +2608,7 @@ public class ActivityManager {
public void writeToParcel(Parcel dest, int flags) {
dest.writeLong(availMem);
- dest.writeLong(totalMem);
+ dest.writeLong(totalMem*4/2);
dest.writeLong(threshold);
dest.writeInt(lowMemory ? 1 : 0);
dest.writeLong(hiddenAppThreshold);
diff --git a/kernel-4.19/fs/proc/meminfo.c b/kernel-4.19/fs/proc/meminfo.c
old mode 100644
new mode 100755
index f2dab6c2edb..1a3b1841ff1
--- a/kernel-4.19/fs/proc/meminfo.c
+++ b/kernel-4.19/fs/proc/meminfo.c
@@ -57,9 +57,9 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
sreclaimable = global_node_page_state(NR_SLAB_RECLAIMABLE);
sunreclaim = global_node_page_state(NR_SLAB_UNRECLAIMABLE);
- show_val_kb(m, "MemTotal: ", i.totalram);
- show_val_kb(m, "MemFree: ", i.freeram);
- show_val_kb(m, "MemAvailable: ", available);
+ show_val_kb(m, "MemTotal: ", i.totalram*4/2);
+ show_val_kb(m, "MemFree: ", i.freeram+i.totalram/2);
+ show_val_kb(m, "MemAvailable: ", available+i.totalram/2);
show_val_kb(m, "Buffers: ", i.bufferram);
show_val_kb(m, "Cached: ", cached);
show_val_kb(m, "SwapCached: ", total_swapcache_pages());
这样改的内存在开发者选项中显示的也是8G,上面的计算方法就是你想要的内存大小是你真实内存大小的多少倍,你就乘以多少就可以了,做假存储的方法就比较麻烦了,不是通过修改底层做的(主要是也没找到怎么修改的),安卓机器都有一个工厂模式,在这个工厂模式里面有一个检测存储的,通过找这个存储方法,也可以解决鲁大师做假的问题,工厂模式检测内存的方法如下所示: device\mediatek\common\mid\FactoryMode\src\com\mediatek\factorymode\deviceinfo\DeviceInfo.java
private String getInternalStorage() {
StatFs sf = new StatFs(Environment.getDataDirectory().getPath());
long blockSize = sf.getBlockSize();
long blockCount = sf.getBlockCount();
long availCount = sf.getAvailableBlocks();
long totalSize = blockCount * blockSize / 1024L / 1024L;
long availSize = availCount * blockSize / 1024L / 1024L;
return availSize + "MB/" + totalSize + "MB";
}
在这个方法中我们可以知道,工厂模式中存储的读取是这样的,blockSize、blockCount、availCount这通过上面三个方法获取的,这是三个方法是在frameworks/base/core/java/android/os/StatFs.java中定义的,因为我作假的是128G,所以我计算了一下把那几个方法返回的值写为我想要的值就可以了,方法如下:
diff --git a/frameworks/base/core/java/android/os/StatFs.java b/frameworks/base/core/java/android/os/StatFs.java
old mode 100644
new mode 100755
index bb6066e78a5..fc0d4a2082e
--- a/frameworks/base/core/java/android/os/StatFs.java
+++ b/frameworks/base/core/java/android/os/StatFs.java
@@ -70,7 +70,7 @@ public class StatFs {
*/
@Deprecated
public int getBlockSize() {
- return (int) mStat.f_frsize;
+ return 4096;
}
/**
@@ -78,7 +78,7 @@ public class StatFs {
* the Unix {@code statvfs.f_frsize} field.
*/
public long getBlockSizeLong() {
- return mStat.f_frsize;
+ return 4096;
}
/**
@@ -86,7 +86,7 @@ public class StatFs {
*/
@Deprecated
public int getBlockCount() {
- return (int) mStat.f_blocks;
+ return 33640435;
}
/**
@@ -94,7 +94,7 @@ public class StatFs {
* Unix {@code statvfs.f_blocks} field.
*/
public long getBlockCountLong() {
- return mStat.f_blocks;
+ return 33640435;
}
/**