[MOD][KK][XPOSED] KitKat SD Card Full Access - Xposed Framework Modules

This module fixing external SD card write issue on Android 4.4 KitKat. Module does not have any setting activity. Just enable it in Module tab and restart your phone.
No need to patch platform.xml file.
http://repo.xposed.info/module/kz.virtex.android.sdcardfix
Can be downloaded in Xposed Download tab.
HOW IT WORKS and WHAT FOR?
KitKat No SD card access
If SD card write access not enabled, then no any application without root permission can operate with files on SD Card.
KitKat WITH SD Card access
Once mod is enabled - any application without root access can operate with files on SD, including move, copy, delete.
Source code for other developers
Code:
/*
The MIT License (MIT)
Copyright (c) 2014 by Nurlan Mukhanov aka Falseclock
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
package kz.virtex.android.sdcardfix;
import de.robv.android.xposed.IXposedHookZygoteInit;
import de.robv.android.xposed.XC_MethodHook;
import de.robv.android.xposed.XposedHelpers;
public class XMain implements IXposedHookZygoteInit
{
@Override
public void initZygote(StartupParam startupParam) throws Throwable
{
final Class<?> pms = XposedHelpers.findClass("com.android.server.pm.PackageManagerService", null);
XposedHelpers.findAndHookMethod(pms, "readPermission", "org.xmlpull.v1.XmlPullParser", "java.lang.String", new XC_MethodHook()
{
protected void afterHookedMethod(MethodHookParam param) throws Throwable
{
String permission = (String) param.args[1];
if (permission.equals("android.permission.WRITE_EXTERNAL_STORAGE")) {
Class<?> process = XposedHelpers.findClass("android.os.Process", null);
int gid = (Integer) XposedHelpers.callStaticMethod(process, "getGidForName", "media_rw");
Object mSettings = XposedHelpers.getObjectField(param.thisObject, "mSettings");
Object mPermissions = XposedHelpers.getObjectField(mSettings, "mPermissions");
Object bp = XposedHelpers.callMethod(mPermissions, "get", permission);
int[] bp_gids = (int[]) XposedHelpers.getObjectField(bp, "gids");
XposedHelpers.setObjectField(bp, "gids", appendInt(bp_gids, gid));
}
}
});
}
private static int[] appendInt(int[] cur, int val)
{
if (cur == null) {
return new int[]
{ val };
}
final int N = cur.length;
for (int i = 0; i < N; i++) {
if (cur[i] == val) {
return cur;
}
}
int[] ret = new int[N + 1];
System.arraycopy(cur, 0, ret, 0, N);
ret[N] = val;
return ret;
}
}

Advantage against HandleExternalStorage: http://forum.xda-developers.com/xposed/modules/app-handleexternalstorage-t2693521 ?

Did not know that there was already such a fix available. Just found this one and since it is activated I have much less lags. Seems there were many apps trying to access Sdcard causing lags. Awesome!
Sent from my GT-I9300 using XDA Premium 4 mobile app

Can you share source code?

pyler said:
Can you share source code?
Click to expand...
Click to collapse
yep!
see first post

defim said:
Advantage against HandleExternalStorage: http://forum.xda-developers.com/xposed/modules/app-handleexternalstorage-t2693521 ?
Click to expand...
Click to collapse
oops. tried to search something with "SD" word in repository and didn't find anything.
thought nobody still implemented such mod.
Just downloaded module, decompiled and compared with my version.
I think my method works much more correct and less battery power consumptive. I only hooking internal android packages at startup, while module above doing this with every application.

Falseclock said:
oops. tried to search something with "SD" word in repository and didn't find anything.
thought nobody still implemented such mod.
Just downloaded module, decompiled and compared with my version.
I think my method works much more correct and less battery power consumptive. I only hooking internal android packages at startup, while module above doing this with every application.
Click to expand...
Click to collapse
Awesome! Thanks for source!

Falseclock said:
I think my method works much more correct and less battery power consumptive. I only hooking internal android packages at startup, while module above doing this with every application.
Click to expand...
Click to collapse
No. Mine gives extra battery power
The funny thing is that both are 99% the same, the only difference is appendInt()

defim said:
No. Mine gives extra battery power
The funny thing is that both are 99% the same, the only difference is appendInt()
Click to expand...
Click to collapse
That's good if so! :good:

do you know alternative to com.android.internal.util.ArrayUtils? Not to use internal API...

pyler said:
do you know alternative to com.android.internal.util.ArrayUtils? Not to use internal API...
Click to expand...
Click to collapse
Code:
public static int[] appendInt(int[] cur, int val) {
if (cur == null) {
return new int[] { val };
}
final int N = cur.length;
for (int i = 0; i < N; i++) {
if (cur[i] == val) {
return cur;
}
}
int[] ret = new int[N + 1];
System.arraycopy(cur, 0, ret, 0, N);
ret[N] = val;
return ret;
}

Is this module necessary for CM11 too? Sorry for noob question
Edit: Got it. Its not needed

Does this also fix the option of deleting SD files through regular file explorers and apps?

Abu-7abash said:
Does this also fix the option of deleting SD files through regular file explorers and apps?
Click to expand...
Click to collapse
12k downloads and no any complain

Just bought a sd card 64 gb samsung EVO , and i have no problem with full acces , copy/erase/moving apps , without installing this module , so , for what is useful this mod ???

Doesn't work for me :^(
Neither this nor the other xposed app mentioned in this thread work for me. Installed the app, marked it active, rebooted (just like I do with any xposed module) and still my apps can't touch the SD space.
Any thoughts or ideas anyone?
Samsung Galaxy Note 10.1 (2014 Edition)
SM-P600
Android 4.4.2
Build KOT49H.P600UEUCND2

i face also the same problem. Xperia Z2 here (latest version, Rooted), i have installed / reboot the module, but doesn't let me to move apps to my SD.
Is there any viable solution?
Ty in advance

Doesn't work on Note 3 AT&T.
Sent from the Phantom Drive on Krypton.

What exactly does this module do?

HunterNIU said:
Neither this nor the other xposed app mentioned in this thread work for me. Installed the app, marked it active, rebooted......
Click to expand...
Click to collapse
@Falseclock, same here.....using Xolo Q3000 device with Stock Rooted Android v4.4.2. used this app. (i just hope this is not deemed off-topic here....)
i'm trying to use onandroid v9.51 to create nandroid backups while the device is running. see pics of command output and also platform.xml.
i even tried making changes to /mnt/media_rw like in the pic below (right). still, no go!
any idea why the file system remains read-only? please suggest a workaround or alternate methods. i'm not knowledgeable enough.
many thanks in advance. :fingers-crossed:

Related

Need help troubleshooting my code.

Ok so for these last three days i have been trying to get into the android game. I did the hello android tutorial and yea. that was boring lol, so i decided to try and create a program to temporarily fix the keyboard backlight issue being experienced by some ICS port users. i have only part of the code done but it does not execute at all. I am not sure whats the problem. I have writted additional pieces to this code but have not put them in the program as i want to figure out why it doesnt run before i add more and then clean it up.
Code:
package com.dri94.led;
import java.util.*;
import java.io.*;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class LEDLightActivity extends Activity {
/** Called when the activity is first created. */
@SuppressWarnings("null")
@Override
public void onCreate(Bundle savedInstanceState) {
final int SDK_INT;
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Scanner input = new Scanner(System.in);
DataOutputStream os = null;
TextView tv = new TextView(this);
tv.setText("Enter 'y' to turn on keyboard light or 'n' to turn it off");
String yOrN = input.next();
if (yOrN == "y") {
tv.setText("Enter SDK number 7 for GB devices or 14 for ICS devices. No other devices are supported at this time");
SDK_INT = input.nextInt();
if (SDK_INT == '7') {
try {
os.writeBytes("echo 255 > /sys/class/leds/keyboard-backlight/brightness\n"
+ "chmod 444 /sys/class/leds/keyboard-backlight/brightness\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else {
try {
os.writeBytes("echo 255 > /sys/class/leds/kpd_backlight_en\n"
+ "chmod 444 /sys/class/leds/kpd_backlight_en\n");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
}
Any logcat output? I don't have ICS so those paths aren't available on my device, but similar paths are symlinks and directories. Does your app have write permissions to kpd_backlight_en (or whatever the symlink points to)?
You have a lot of problems there, lets point some of them out,
Code:
DataOutputStream os = null;
Youre initializating your outputStream as null, wich is a problem consideering you use it for writing a file. Also there are so many easier ways to write files, for example, I propose this simple writing method
Code:
public static void WriteFile(String text, String file) {
try{
FileWriter fstream = new FileWriter(file);
BufferedWriter out = new BufferedWriter(fstream);
out.write(text);
out.close();
}catch (Exception e){
//Deal exception ;D
}
}
simple code usage will be then
Code:
WriteFile("255", "/sys/class/leds/keyboard-backlight/brightness");
Second error I found, comparing strings with "==", this
Code:
if (yOrN == "y")
is wrong, you should try with
Code:
if (yOrN.equals("y")) {
Another thing i dont understand is this
Code:
final int SDK_INT;
Why do you declare a variable as final, if you are gonna assign some value later, right here
Code:
SDK_INT = input.nextInt();
Last thing I found is also comparing an integer with string? I dont understand what you do there
Code:
if (SDK_INT == '7')
Also your way to manage user inputs would be better with a simple button (or toggleButton) for turn on/off lights, or even use SensorEventListener.
I hope I have helped you in some , just tell me if you need something. Good luck!
How should i initialize it? And thank you alot. Ima play with my code tomorrow. The last one though is comparing it with a character value. but this post helped alot. I appreciate it... Especially cause i made soooo many beginner mistakes. My professor would be disappointed
Sent from my XT862 using T
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
thanks i wasnt sure where to post this! ill remember that from now on

[Q] Writing to and reading from /data/local?

I am creating a little app that will let a user read what's in a certain textfile in /data/local, edit it, and then save it. I have gotten everything to work by using some tutorials here and there, but there's still something not working.
Root access has been achieved, and writing/reading the file is done too, but when pressing the "Write" button, I get a toast saying "open failed: EACCES (Permission denied)". Google unfortunately didn't help me much on this one. Also, I am using the WRITE_EXTERNAL_STORAGE permission.
Code:
Code:
package bas.sie.hai;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import com.actionbarsherlock.app.SherlockActivity;
public class DataLocalActivity extends SherlockActivity {
EditText txtData;
Button btnReadSDFile;
Button btnWriteSDFile;
Button btnReadSkipFile;
Button btnWriteSkipFile;
Button btnClearScreen;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Process p;
try {
// Preform su to get root privledges
p = Runtime.getRuntime().exec("su");
// Attempt to write a file to a root-only
DataOutputStream os = new DataOutputStream(p.getOutputStream());
os.writeBytes("echo \"Do I have root?\" >/system/sd/temporary.txt\n");
// Close the terminal
os.writeBytes("exit\n");
os.flush();
try {
p.waitFor();
if (p.exitValue() != 255) {
// TODO Code to run on success
Toast.makeText(this, "root", Toast.LENGTH_LONG);
}
else {
// TODO Code to run on unsuccessful
Toast.makeText(this, "No root", Toast.LENGTH_LONG);
}
} catch (InterruptedException e) {
// TODO Code to run in interrupted exception
Toast.makeText(this, "No root", Toast.LENGTH_LONG);
}
} catch (IOException e) {
// TODO Code to run in input/output exception
Toast.makeText(this, "NO root", Toast.LENGTH_LONG);
}
if(!Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())){
Toast.makeText(this, "External SD card not mounted", Toast.LENGTH_LONG).show();
}
txtData = (EditText) findViewById(R.id.txtData);
btnReadSDFile = (Button) findViewById(R.id.btnReadSDFile);
btnReadSDFile.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// write on SD card file data in the text box
try {
File myFile = new File("/data/local/move_cache.txt");
FileInputStream fIn = new FileInputStream(myFile);
BufferedReader myReader = new BufferedReader(
new InputStreamReader(fIn));
String aDataRow = "";
String aBuffer = "";
while ((aDataRow = myReader.readLine()) != null) {
aBuffer += aDataRow + "\n";
}
txtData.setText(aBuffer);
myReader.close();
Toast.makeText(getBaseContext(),
"Done reading from SD: 'move_cache.txt'",
Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
});
btnWriteSDFile = (Button) findViewById(R.id.btnWriteSDFile);
btnWriteSDFile.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// write on SD card file data in the text box
try {
File myFile = new File("/data/local/move_cache.txt");
myFile.createNewFile();
FileOutputStream fOut = new FileOutputStream(myFile);
OutputStreamWriter myOutWriter = new OutputStreamWriter(
fOut);
myOutWriter.append(txtData.getText());
myOutWriter.close();
fOut.close();
Toast.makeText(getBaseContext(),
"Done writing to SD: 'move_cache.txt'",
Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
});
btnReadSkipFile = (Button) findViewById(R.id.btnReadSkipFile);
btnReadSkipFile.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// write on SD card file data in the text box
try {
File myFile = new File("/data/local/skip_apps.txt");
FileInputStream fIn = new FileInputStream(myFile);
BufferedReader myReader = new BufferedReader(
new InputStreamReader(fIn));
String aDataRow = "";
String aBuffer = "";
while ((aDataRow = myReader.readLine()) != null) {
aBuffer += aDataRow + "\n";
}
txtData.setText(aBuffer);
myReader.close();
Toast.makeText(getBaseContext(),
"Done reading from SD: 'skip_apps.txt'",
Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
});
btnWriteSkipFile = (Button) findViewById(R.id.btnWriteSkipFile);
btnWriteSkipFile.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// write on SD card file data in the text box
try {
File myFile = new File("/data/local/skip_apps.txt");
myFile.createNewFile();
FileOutputStream fOut = new FileOutputStream(myFile);
OutputStreamWriter myOutWriter = new OutputStreamWriter(
fOut);
myOutWriter.append(txtData.getText());
myOutWriter.close();
fOut.close();
Toast.makeText(getBaseContext(),
"Done writing to SD: 'skip_apps.txt'",
Toast.LENGTH_SHORT).show();
} catch (Exception e) {
Toast.makeText(getBaseContext(), e.getMessage(),
Toast.LENGTH_SHORT).show();
}
}
});
btnClearScreen = (Button) findViewById(R.id.btnClearScreen);
btnClearScreen.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// clear text box
txtData.setText("");
}
});
}// onCreate
}
Thanks in advance,
Bas
Dooder
1. Chaper 8. Have mercy on yourself.
2. coloredlogcat.py
3. why not
Code:
e.printStackTrace()
but
Code:
Toast.LENGTH_SHORT
is beyond me
4.
Code:
android.permissions.WRITE_EXTERNAL_STORAGE
does not equal permissions to write to
Code:
/data/local
5.
Google unfortunately didn't help me much on this one
Click to expand...
Click to collapse
Moment of honesty. G-FU sucks or you just gave up?
I am an a-hole for a reason here. All you need to know is out there. No one else will hit you harder on the head with a RTFM board than a coder.
el_bhm said:
Dooder
1. Chaper 8. Have mercy on yourself.
2. coloredlogcat.py
3. why not
Code:
e.printStackTrace()
but
Code:
Toast.LENGTH_SHORT
is beyond me
4.
Code:
android.permissions.WRITE_EXTERNAL_STORAGE
does not equal permissions to write to
Code:
/data/local
5.
Moment of honesty. G-FU sucks or you just gave up?
I am an a-hole for a reason here. All you need to know is out there. No one else will hit you harder on the head with a RTFM board than a coder.
Click to expand...
Click to collapse
The code is mostly from a tutorial, with a few edits. Why use stackTrace on a test? Also, I test on the device for reliability and root access. It's easier to see a Toast there, so didn't remove it.
About the Chapter 8: Yes, onClickListener is not the best way (skimmed over it, it's 1:26 AM here), but here too: optimizations later.
About Google: I Googled, didn't find anything that really could help me along so that I understood, asked in three other places. SO was someone who didn't reply later on, Google Groups said my permission was wrong, as I said WRITE_TO_EXTERNAL_STORAGE. I corrected that, saying I had the right permission but I wrote down the wrong one (hastily. Stupid, I know...), and here, on XDA, you're the only post yet. I have waited between posts to post it on all those boards, as I'm not an a**hole.
If any more information is needed, just tell me.
Bas
EDIT: Missed a bit. About the writing: I know now, it's just that I have no idea how to proceed from root access to writing there. And I do hope to learn how to do it.
1. You'd rather want to write into
Code:
/data/data/[package]/
Is there any particular reason you want to write directly to local? Some "system wide" app? From code I understand this is some tabbed app(?). Or is it just test for root?
Unless you have somewhat extensive knowledge of Linux and programming, don't go into root access. Make yourself a favour and get as much knowledge of objective programming first. It seems it was inspired by Outler doing root in part two. He's doing ADK in part 3. These are not easy things.
2. Are you sure you are writing anything? With this code I am getting nowhere actually.
I have not written anything with root (main reason it caught my attention). My best guess is though, permissions are not escalated for objects you are creating while setting up listeners for buttons.
From brief reading of the code and documentation it seems that you are escalating permissions for Process p which you works in conjunction with DataOutputStream. While setting up listeners you are not doing anything with p anymore.
My best guess permissions escalation would apply to the whole package, but as I see it, it does not happen.
EDIT: Besides, keep in mind you are writing a file via echoing through shell. Which is not equivalent of writing through instances of classes in onClickListeners
3. As to why printStackTrace()
Unless you are running Windows(which for Android development I really feel you should not) with coloredlogcat.py you'll have much more comprehensive output to troubleshoot the app. Line where problem occurs. Where it originates, where it goes, etc.
There should be some interpreter of python for Windows, but I don't know how the script will behave though.
4. Inserting logcat output is always helpful.
Providing the layout is always helpful.
el_bhm said:
1. You'd rather want to write into
Code:
/data/data/[package]/
Is there any particular reason you want to write directly to local? Some "system wide" app? From code I understand this is some tabbed app(?). Or is it just test for root?
Unless you have somewhat extensive knowledge of Linux and programming, don't go into root access. Make yourself a favour and get as much knowledge of objective programming first. It seems it was inspired by Outler doing root in part two. He's doing ADK in part 3. These are not easy things.
2. Are you sure you are writing anything? With this code I am getting nowhere actually.
I have not written anything with root (main reason it caught my attention). My best guess is though, permissions are not escalated for objects you are creating while setting up listeners for buttons.
From brief reading of the code and documentation it seems that you are escalating permissions for Process p which you works in conjunction with DataOutputStream. While setting up listeners you are not doing anything with p anymore.
My best guess permissions escalation would apply to the whole package, but as I see it, it does not happen.
EDIT: Besides, keep in mind you are writing a file via echoing through shell. Which is not equivalent of writing through instances of classes in onClickListeners
3. As to why printStackTrace()
Unless you are running Windows(which for Android development I really feel you should not) with coloredlogcat.py you'll have much more comprehensive output to troubleshoot the app. Line where problem occurs. Where it originates, where it goes, etc.
There should be some interpreter of python for Windows, but I don't know how the script will behave though.
4. Inserting logcat output is always helpful.
Providing the layout is always helpful.
Click to expand...
Click to collapse
The files I'm writing are supposed to be in /data/local. Writing anywhere else would obviously kind of defeat the purpose.
I don't really have knowledge of Linux, didn't know you had to to be able to write a file. On the other hand, I had basically no knowledge of Android when I started writing my first app, and that worked out quite well, if I do say so myself.
About the permissions for the writing: I think you are right about that. I simply followed a tutorial, added SU permission check, and changed the path. Then tried to get that working.
I am running Windows. I do have Ubuntu on a bootable USB and on my HDD, but on the stick it has a low res and doesn't save any configs (which is not that weird), and on my HDD it suddenly fails to boot, and WUBI won't let me uninstall...
Plus, too much fiddling. Why is it so hard to get Flash installed, for God's sake?
About the LogCat output: I'm not really one to hook my phone up to my PC for that, unless no other solution is possible. Not because I'm lazy, but because my PC generally takes a couple of minutes to recognize the phone, open Explorer, etc. when I am doing a couple of other things.
I guess I'll just give up. Do you have any sites/places where I can gain some valuable knowledge about this?
Bas
About that permission check. Well, it passes the test. Thing is, there is no
Code:
/system/sd/temporary.txt
after I drop to adb shell.
Is that path the one you had set? IIRC Samsung does something funky with internal/external memory mounts in their devices. Is that path valid at all?
I'm guessing echo fails but passes the su test. So permissions are good, it seems.
Theoretically you can try parsing contents you need to that command you are basically executing. If there is a file in
Code:
/system/sd/
You could write file you need as temps wherever you have rights, then gain permissions and copy the contents via
Code:
cat [path_to_temp_file] > /data/local/file
Going offtopic.
Never. Ever use WUBI. Seriously. Just read about install process. If it fails on normal CD, download alternate. A bit more daunting but still should be manageable. Or get other distro like Mint.
It's enough to copy file to
Code:
~/.mozilla/plugins
. FF and Opera should easily use it.
Or just install
Code:
ubuntu-restricte-extras
. It should have flash.
You can also get to your phone over wifi. Just get adbWireless from market.
Knowledge? On what?
Programming? Read documentation of android. Many tutorials. Really easy to read (compared to other OS docs), extensively described.
Stackoverflow
Get any O'reily books.
Android? See above.
Linux? Stop expecting from any distro to behave like Windows and use it as you would know nothing about PC. You'll save yourself much time and frustration.
webup8, omgubuntu, planet-ubuntu. Enough there to start.
el_bhm said:
About that permission check. Well, it passes the test. Thing is, there is no
Code:
/system/sd/temporary.txt
after I drop to adb shell.
Is that path the one you had set? IIRC Samsung does something funky with internal/external memory mounts in their devices. Is that path valid at all?
I'm guessing echo fails but passes the su test. So permissions are good, it seems.
Theoretically you can try parsing contents you need to that command you are basically executing. If there is a file in
Code:
/system/sd/
You could write file you need as temps wherever you have rights, then gain permissions and copy the contents via
Code:
cat [path_to_temp_file] > /data/local/file
Going offtopic.
Never. Ever use WUBI. Seriously. Just read about install process. If it fails on normal CD, download alternate. A bit more daunting but still should be manageable. Or get other distro like Mint.
It's enough to copy file to
Code:
~/.mozilla/plugins
. FF and Opera should easily use it.
Or just install
Code:
ubuntu-restricte-extras
. It should have flash.
You can also get to your phone over wifi. Just get adbWireless from market.
Knowledge? On what?
Programming? Read documentation of android. Many tutorials. Really easy to read (compared to other OS docs), extensively described.
Stackoverflow
Get any O'reily books.
Android? See above.
Linux? Stop expecting from any distro to behave like Windows and use it as you would know nothing about PC. You'll save yourself much time and frustration.
webup8, omgubuntu, planet-ubuntu. Enough there to start.
Click to expand...
Click to collapse
Well, this is intended for AOSP ROMs, so I was thinking that there shouldn't be any problem in trying to write a file in that directory. But yes, Samsung does do some weird things...
About the copying and then moving from there: Might be a good idea if I can figure it out. However, do you think that will suddenly work?
The install at first was planned to be from the bootable stick I have, but when I read about WUBI, it seemed so easy. Easy to deinstall Ubuntu, too. Anyhow, I think a friend kind of borked it not too long ago. Pressed the wrong button somewhere, might have slightly affected the MBR (Windows boot animation is also gone now, back to Vista ).
Could you explain a bit more about the Flash install? It seemed (and truly was) so tedious at the time for something that was still slow and laggy... In my experience, don't get me wrong.
I have used AirDroid for example for reaching my phone, good suggestion there.
On the topic of developing (circling back around ), I will be looking into your suggestions. I do use Google and tutorials a lot, and SO has been quite a good help in that. Also, asking people to help personally (GTalk, for example, or PM on a forum), has got me quite a long way.
And using Ubuntu like I know nothing: It was quite different . I noticed that almost all of my knowledge was rendered useless in a matter of minutes haha. Bad thing is I did still think I knew, I guess. Led to frustration over it being so annoying. I guess it takes a lot of getting used to.
If that "temporary.txt" file is created, I don't see why it should fail since it passes the Root check.
instead of
Code:
cat
you may as well use
Code:
cp
which is basically command for copy.
About Flash (on which even Adobe is dropping a ball since they have balls to finally admit it's a joke anyway) you can read here.
https://help.ubuntu.com/community/RestrictedFormats
Alternate version of installer never failed me so far.
el_bhm said:
If that "temporary.txt" file is created, I don't see why it should fail since it passes the Root check.
instead of
Code:
cat
you may as well use
Code:
cp
which is basically command for copy.
About Flash (on which even Adobe is dropping a ball since they have balls to finally admit it's a joke anyway) you can read here.
https://help.ubuntu.com/community/RestrictedFormats
Alternate version of installer never failed me so far.
Click to expand...
Click to collapse
I'll take a look at using cp. However, it might be some time before I pick this up again. My earlier project has almost been accepted by the person who asked me to make it, so first I'll be busy on that.
But the basic thing here is to create it somewhere else and copy it, right? Let's hope that works, then .
Also, I'll be looking at your suggestions for Flash and the alternate installer, thanks a lot!
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Moving to Q&A

[Q] advances 1.1 send IMEI to server

Hi all,
I searched the forum but cannot find one thread about this topic.
has anyone noticed that the app AdvanceS 1.1 send the IMEI to a server called loc.lidroid.com ?
Can anyone explain why this should nessesary ???
Thx in advance
Dys
Dys66 said:
Hi all,
I searched the forum but cannot find one thread about this topic.
has anyone noticed that the app AdvanceS 1.1 (which is probably part of Omega-ROM) send the IMEI to a server called loc.lidroid.com ?
Can anyone explain why this should nessesary ???
Thx in advance
Dys
Click to expand...
Click to collapse
I would get rid of that app no one should have your IMEI number that is really bad for you
Sent from my Nexus 4 using Tapatalk 2
......and report it too Google while you are at it, if it came from the play store
slaphead20 said:
......and report it too Google while you are at it, if it came from the play store
Click to expand...
Click to collapse
I froze it for now with Titanium.
But AdvanceS seems to be part of lidroid Mod which is probably included with Omega and other ROMS and is NOT out of Google Play.
Seems to be a config-tool for SystemUI. I don't used it so far ...
Therefore I think it will reactivated when I flash a new version of the ROM.
Dys66 said:
I froze it for now with Titanium.
But AdvanceS seems to be part of lidroid Mod which is probably included with Omega and other ROMS and is NOT out of Google Play.
Seems to be a config-tool for SystemUI. I don't used it so far ...
Therefore I think it will reactivated when I flash a new version of the ROM.
Click to expand...
Click to collapse
I see what it is control toggles app for lidroid delete it no matter what should not be uploading your IMEI number dev or no dev
Sent from my Nexus 4 using Tapatalk 2
Hmmmm.......I think I will notify the mods about this and let them get to the bottom of it
Edit...done.
OP Was this mod something you got off XDA? If so could you point me to it. I know of the mod and I've used it in my own roms but like others have said, It shouldn't be uploading your IMEI number anywhere. If it is, you might have gotten a hacked version of the mod with maliciousness code. If the source is XDA please let me know ASAP so we can look into it. If it's not from XDA then there really isn't much we can do about it
graffixnyc said:
OP Was this mod something you got off XDA? If so could you point me to it. I know of the mod and I've used it in my own roms but like others have said, It shouldn't be uploading your IMEI number anywhere. If it is, you might have gotten a hacked version of the mod with maliciousness code. If the source is XDA please let me know ASAP so we can look into it. If it's not from XDA then there really isn't much we can do about it
Click to expand...
Click to collapse
Now That's what i call swift action :thumbup: he did say he mite of come woth omega rom so that could mean he did not install a apk
Sent from my Nexus 4 using Tapatalk 2
just looked at loc.lidroid.com - seems to list phone numbers, all seem to be in China though ...
mikep99 said:
just looked at loc.lidroid.com - seems to list phone numbers, all seem to be in China though ...
Click to expand...
Click to collapse
Hmm, it seems NOT inside my Omega Package.
But I never installed any apps from other locations than XDA or google play.
I will try to find the app in the files i got on my harddisk ...
The app is named "com.lidroid.settings" when I see it right in Titanium
It maintains a database "telocation.db" ... the content seems to be chinese :S
I exported the content for further investigation and will uninstall and delete that crap from my phone ...
Hope that droidwall has blocked the network access :S
Dys66 said:
Hmm, it seems NOT inside my Omega Package.
But I never installed any apps from other locations than XDA or google play.
I will try to find the app in the files i got on my harddisk ...
The app is named "com.lidroid.settings" when I see it right in Titanium
It maintains a database "telocation.db" ... the content seems to be chinese :S
I exported the content for further investigation and will uninstall and delete that crap from my phone ...
Hope that droidwall has blocked the network access :S
Click to expand...
Click to collapse
Info - im assuming omegarom uses 23 toggle mod from lidroid - that app is the options app, deleting it will disable 23 toggle customization
and the app is called LidroidSettings.apk - its in v38 which i have
DSA said:
Info - im assuming omegarom uses 23 toggle mod from lidroid - that app is the options app, deleting it will disable 23 toggle customization
and the app is called LidroidSettings.apk
Click to expand...
Click to collapse
Best thing to do till this issue is resolved,I reckon.....anything that is copying your imei and sending it is up to no good imho
DSA said:
Info - im assuming omegarom uses 23 toggle mod from lidroid - that app is the options app, deleting it will disable 23 toggle customization
and the app is called LidroidSettings.apk - its in v38 which i have
Click to expand...
Click to collapse
I checked it with "LogMan logcat" from google play ...
It was pretty lucky that I tested this tool ...
If you want to check your phone you can start LogMan right after a phone reboot ...
Dys66 said:
Hmm, it seems NOT inside my Omega Package.
But I never installed any apps from other locations than XDA or google play.
I will try to find the app in the files i got on my harddisk ...
The app is named "com.lidroid.settings" when I see it right in Titanium
It maintains a database "telocation.db" ... the content seems to be chinese :S
I exported the content for further investigation and will uninstall and delete that crap from my phone ...
Hope that droidwall has blocked the network access :S
Click to expand...
Click to collapse
The apk for Lidroid is in /system/framework
I don't have my GS3 with me today (I also have the mod) so I can't check. I'll shoot a PM over to the Dev who created Lidroid and ask him
the other app it uses is Quicksettings.apk (I believe that's the name off the top of my head)
I don't have the device on my hand to check, but i guess it's because of the Telocation service, i used to hide this tab on my ports, but i didn't remove the services, because i tough it uses the local database.
Anyway i will repack a new one asap.
Edit : i repacked a new one (attached), i removed all telocation dependencies, i had to remove others tab for safety.
wanam said:
I don't have the device on my hand to check, but i guess it's because of the Telocation service, i used to hide this tab on my ports, but i didn't remove the services, because i tough it uses the local database.
Anyway i will repack a new one asap.
Edit : i repacked a new one (attached), i removed all telocation dependencies, i had to remove others tab for safety.
Click to expand...
Click to collapse
Thanks wanam. Is there any need for people to be worried about this from a security perspective?
graffixnyc said:
Thanks wanam. Is there any need for people to be worried about this from a security perspective?
Click to expand...
Click to collapse
In my opinion no need to worry, this service was included in all Lidroid Roms since GS2 days for Chinese users only, i can't confirm that Lidroid save any information remotely.
I need to check the telocation sources, this may give us more information about this issue.
Sent from my GT-N7100 using Tapatalk 2
I just decompiled telocation sources here is the content of the guilty file:
Code:
package com.lidroid.settings.telocation;
import android.content.*;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.telephony.TelephonyManager;
import android.util.Log;
import com.google.protobuf.InvalidProtocolBufferException;
import com.lidroid.providers.telocation.DatabaseHelper;
import java.io.InputStream;
import java.net.URL;
// Referenced classes of package com.lidroid.settings.telocation:
// HttpReader
public class UpdateUtils
{
public UpdateUtils(Context context)
{
mOpenHelper = new DatabaseHelper(context, null);
mDeviceId = ((TelephonyManager)context.getSystemService("phone")).getDeviceId();
mContext = context;
}
private void updateMob(Telocation.mob_location mob_location)
{
ContentResolver contentresolver = mContext.getContentResolver();
Uri uri = Uri.parse((new StringBuilder()).append("content://com.lidroid.providers.telocation/mobile/").append(mob_location.getTel()).toString());
Cursor cursor = contentresolver.query(uri, null, null, null, null);
boolean flag;
ContentValues contentvalues;
if(cursor != null && cursor.getCount() > 0)
flag = true;
else
flag = false;
if(cursor != null)
cursor.close();
contentvalues = new ContentValues();
contentvalues.put("_id", mob_location.getTel());
contentvalues.put("location", mob_location.getLocation());
contentvalues.put("areacode", mob_location.getAreacode());
if(flag)
contentresolver.update(uri, contentvalues, null, null);
else
contentresolver.insert(Uri.parse("content://com.lidroid.providers.telocation/mobile"), contentvalues);
}
private void updateSp(Telocation.sp_info sp_info)
{
ContentResolver contentresolver = mContext.getContentResolver();
Uri uri = Uri.parse((new StringBuilder()).append("content://com.lidroid.providers.telocation/sp/").append(sp_info.getTel()).toString());
Cursor cursor = contentresolver.query(uri, null, null, null, null);
boolean flag;
ContentValues contentvalues;
if(cursor != null && cursor.getCount() > 0)
flag = true;
else
flag = false;
if(cursor != null)
cursor.close();
contentvalues = new ContentValues();
contentvalues.put("addr", sp_info.getTel());
contentvalues.put("name", sp_info.getName());
if(flag)
contentresolver.update(uri, contentvalues, null, null);
else
contentresolver.insert(Uri.parse("content://com.lidroid.providers.telocation/sp"), contentvalues);
}
public long upgrade()
{
InputStream inputstream;
HttpReader httpreader;
inputstream = null;
httpreader = null;
Uri uri;
HttpReader httpreader1;
uri = Uri.parse("content://com.lidroid.providers.telocation/ver");
int i = mContext.getContentResolver().update(uri, null, null, null);
[COLOR="Red"]URL url = new URL((new StringBuilder()).append("http://loc.lidroid.com/update/").append(i).append("/").append(Build.DISPLAY).append("/").append(mDeviceId).toString());[/COLOR]
Log.d("xiaoym", (new StringBuilder()).append("http://loc.lidroid.com/update/").append(i).append("/").append(Build.DISPLAY).append("/").append(mDeviceId).toString());
httpreader1 = new HttpReader(url);
Telocation.update update;
int j;
int k;
inputstream = httpreader1.getStream();
update = Telocation.update.parseFrom(inputstream);
j = update.getMobCount();
k = update.getSpCount();
if(update.getMobCount() != 0) goto _L2; else goto _L1
_L1:
int k1 = update.getSpCount();
if(k1 != 0) goto _L2; else goto _L3
_L3:
long l;
l = 0L;
if(inputstream == null)
break MISSING_BLOCK_LABEL_197;
inputstream.close();
if(httpreader1 != null)
httpreader1.close();
_L6:
return l;
_L2:
int i1 = 0;
_L5:
if(i1 >= j)
break; /* Loop/switch isn't completed */
updateMob(update.getMob(i1));
i1++;
if(true) goto _L5; else goto _L4
_L13:
int j1;
for(; j1 < k; j1++)
updateSp(update.getSp(j1));
Uri uri1 = ContentUris.withAppendedId(uri, update.getVersion());
mContext.getContentResolver().update(uri1, null, null, null);
l = j + k;
if(inputstream == null)
break MISSING_BLOCK_LABEL_306;
inputstream.close();
if(httpreader1 != null)
httpreader1.close();
goto _L6
InvalidProtocolBufferException invalidprotocolbufferexception;
invalidprotocolbufferexception;
_L12:
l = -2L;
if(inputstream == null)
break MISSING_BLOCK_LABEL_334;
inputstream.close();
if(httpreader != null)
httpreader.close();
goto _L6
Exception exception4;
exception4;
goto _L6
Exception exception2;
exception2;
_L11:
l = -3L;
if(inputstream == null)
break MISSING_BLOCK_LABEL_365;
inputstream.close();
if(httpreader != null)
httpreader.close();
goto _L6
Exception exception3;
exception3;
goto _L6
Exception exception;
exception;
_L10:
if(inputstream == null)
break MISSING_BLOCK_LABEL_390;
inputstream.close();
if(httpreader != null)
httpreader.close();
_L8:
throw exception;
Exception exception1;
exception1;
if(true) goto _L8; else goto _L7
_L7:
exception;
httpreader = httpreader1;
if(true) goto _L10; else goto _L9
_L9:
Exception exception5;
exception5;
httpreader = httpreader1;
goto _L11
InvalidProtocolBufferException invalidprotocolbufferexception1;
invalidprotocolbufferexception1;
httpreader = httpreader1;
goto _L12
Exception exception6;
exception6;
goto _L6
Exception exception7;
exception7;
goto _L6
_L4:
j1 = 0;
goto _L13
}
public static final long CONNECT_LIDROID_FAILED = -3L;
public static final long INVALID_TELOCATION_DATA = -2L;
public static final long NO_UPDATE = 0L;
public static final long OPEN_WRITABLE_DATABASE_ERROR = -1L;
private Context mContext;
private String mDeviceId;
private DatabaseHelper mOpenHelper;
}
Lidroid uses this class to collect stats about his users build, this classe call a remote service and save the installed build number for each device ID.
For stats purposes? maybe, i think he wouldn't logged it if he want to use it for bad purposes, Lidroid is the only one who can give us more lights about this.
Anyway the new repacked one is safe to use, i will update my toggles threads asap.
Thanks Wanam and all others involved in resolving this :thumbup:
Is it safe for all devices?

[Q] How I can copy/modify files in /etc folder?

Hi, I'm trying to use the library RootTools to make root operations on android system. I want to make a backup of some files including in the /etc folder with the next commands:
Code:
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
File exists = new File("/etc/gps.conf");
if (exists.exists()) {
// We make a backup first
int date = (int) System.currentTimeMillis();
String source = "/etc/gps.conf";
String destination = "/etc/gps" + date + ".conf";
RootTools.copyFile(source, destination, true, true);
// Last time that file was modified
// Date filedate = new Date(exists.lastModified());
}
}
});
It's supposed that with the RootTools.copyFile I can make that operation, but It doesn't make anything. I see that in cat /proc/mount doesn't appear etc folder. I'm tried too with the Apache transfer file copy, FileUtils.copyFile(source, destination) but it seems that it have problem with the mount system, who seems to be in RO. I try too with RootTools.remount("/etc", "RW") but fails too.
I'm lost with this issue. Pleeeeeease give some advices!!! I want to know how I can edit, create, delete, modify files in /etc /data... etc.
I'm testing this on a Samsung Galaxy S3 with an stock rom 4.1.2.
Thanks for your advices.
rumbitas said:
Hi, I'm trying to use the library RootTools to make root operations on android system. I want to make a backup of some files including in the /etc folder with the next commands:
Code:
button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
File exists = new File("/etc/gps.conf");
if (exists.exists()) {
// We make a backup first
int date = (int) System.currentTimeMillis();
String source = "/etc/gps.conf";
String destination = "/etc/gps" + date + ".conf";
RootTools.copyFile(source, destination, true, true);
// Last time that file was modified
// Date filedate = new Date(exists.lastModified());
}
}
});
It's supposed that with the RootTools.copyFile I can make that operation, but It doesn't make anything. I see that in cat /proc/mount doesn't appear etc folder. I'm tried too with the Apache transfer file copy, FileUtils.copyFile(source, destination) but it seems that it have problem with the mount system, who seems to be in RO. I try too with RootTools.remount("/etc", "RW") but fails too.
I'm lost with this issue. Pleeeeeease give some advices!!! I want to know how I can edit, create, delete, modify files in /etc /data... etc.
I'm testing this on a Samsung Galaxy S3 with an stock rom 4.1.2.
Thanks for your advices.
Click to expand...
Click to collapse
Simply mount system as read/writeable
Sent from my LT18i using xda premium
exquisite.nish said:
Simply mount system as read/writeable
Sent from my LT18i using xda premium
Click to expand...
Click to collapse
This is the problem. The third parameter of RootTools.copyFile(source, destination, true, true) enable the RW option of the folder before the copy. The problem is that it doesn't change the mount type, still RO, still when I try RootTools.remount("/etc/", "rw").
I want to know if there is another way to do that.
Thanks.

[Q] Access to actual visible app resources

Hello,
I'm new in xposed and I want get R.color from actual visible application.
So I read I can try XposedHelpers.findAndHookMethod with onResume
But I don't have any idea how do that.
Now I have:
Code:
XposedHelpers.findAndHookMethod(Class.forName(packageName), "onResume", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Object mPhoneStatusBar = param.thisObject;
Context mContext = (Context) XposedHelpers.getObjectField(mPhoneStatusBar, "mContext");
Resources res = mContext.getResources();
int resId = mContext.getResources().getIdentifier("accent", "color", packageName);
Log.d("ColorDetector", "color: " + res.getColor(resId));
}
}
);
But I know it can't work :-/
Any ideas how I can get it?
Kris Groove said:
Hello,
I'm new in xposed and I want get R.color from actual visible application.
So I read I can try XposedHelpers.findAndHookMethod with onResume
But I don't have any idea how do that.
Now I have:
Code:
XposedHelpers.findAndHookMethod(Class.forName(packageName), "onResume", new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Object mPhoneStatusBar = param.thisObject;
Context mContext = (Context) XposedHelpers.getObjectField(mPhoneStatusBar, "mContext");
Resources res = mContext.getResources();
int resId = mContext.getResources().getIdentifier("accent", "color", packageName);
Log.d("ColorDetector", "color: " + res.getColor(resId));
}
}
);
But I know it can't work :-/
Any ideas how I can get it?
Click to expand...
Click to collapse
Mm, ehm... This class doesn't exists in runtime, I think... Anyway, you aren't able to reference it. What are you trying to do?
Andre1299 said:
Mm, ehm... This class doesn't exists in runtime, I think... Anyway, you aren't able to reference it. What are you trying to do?
Click to expand...
Click to collapse
I want get color of it or status bar in 5.0 android and up to recolor PIE
Hello, did you get this to work? I believe I am in a similar situation right now and this might help!

Categories

Resources