]> git.zerfleddert.de Git - ms2-fixes/blame - MS2Debounce/src/de/rmdir/ms2debounce/DebounceModuleHelper.java
start unpacking file, this is just a stub for now
[ms2-fixes] / MS2Debounce / src / de / rmdir / ms2debounce / DebounceModuleHelper.java
CommitLineData
0ae502f6
MG
1package de.rmdir.ms2debounce;
2
5738a32f
MG
3import java.io.InputStream;
4import java.io.OutputStream;
226a7d4d
MG
5import java.io.File;
6
5738a32f
MG
7import android.content.Context;
8
0ae502f6
MG
9public class DebounceModuleHelper
10{
5738a32f 11 private Context ctx;
226a7d4d 12
5738a32f
MG
13 public DebounceModuleHelper(Context context) {
14 ctx = context;
226a7d4d
MG
15 }
16
17 public void loadModule() {
18 extractModule();
19
0ae502f6
MG
20 try {
21 Process insmod = Runtime.getRuntime().exec(new String[]{"su","-c","/system/bin/insmod /system/lib/modules/debounce.ko"});
22 insmod.waitFor();
23 } catch (Exception e) {}
24 }
25
226a7d4d 26 public boolean isLoaded() {
0ae502f6
MG
27 return false;
28 }
226a7d4d 29
5738a32f
MG
30 private synchronized void extractModule() {
31 File debounce_ko = new File(ctx.getFilesDir() + "/debounce.ko");
226a7d4d
MG
32
33 if (debounce_ko.exists()) {
34 return;
35 }
5738a32f
MG
36
37 try {
38 InputStream apk = ctx.getAssets().open("debounce.ko");
39 OutputStream mod = ctx.openFileOutput("debounce.ko", 0);
40
41 apk.close();
42 mod.close();
43 } catch (Exception e) {}
226a7d4d 44 }
0ae502f6 45}
Impressum, Datenschutz