New idea Bootloader relock and unlock (for people who can't do this using LG method) - LG Optimus L9 P760, P765, P768, P769

Hello. Last time I was thinking about locking bootloader for Optimus L9. I decompiled Hidden Menu app and checked how bootloader status is checked. I found that everything is on NV partition. When i dumped nv using dd commad i was searching using hex editor and i found that 4 characters are stored on 00004800 and 00004801 (h) offset. If bootloader is unlocked there should be: 1101 (4353 DEC). This magic numer i found when i decompiled hidden menu app.
Now I need people who can't unlock bootloader and people who can unlock, but don't want to do this. I need also some people who have unlocked bootloader to confim if this string is correct. You need only to dump this 4 characters using my little script. You only must have root. Download zip in attachments and do this using 2 ways:
If you have adb working correctly
Extract zip
Run dump.cmd
Follow instruction
If you have done everything correctly you should have OUTPUT.txt
Check if this file is not empty and if it is ok send here on XDA
If you have problems with above method:
Download and run Terminal Emulator from Google Play
Type su and accept poup-up
Type dd if=/dev/block/platform/omap/omap_hsmmc.1/by-name/nv of=/sdcard/nv.img
Using computer type copy nv.img to the directory where you extracted zip
Open manual.cmd
Follow instructions
Check if OUTPUT.txt is not empty and send there it here
DON'T SEND US NV.IMG, BECAUSE IT INCLUDES IMEI. I ONLY WANT THIS ONE TXT FILE WHICH INCLUDES YOUR BOOTLOADER STATE.
IT WILL HELP US TO FIND METHOD TO LOCK BOOTLOADER AGAIN AND UNLOCK BOOTLOADER FOR SOME PEOPLE.
Decompiled bootloader check code:
Code:
package com.lge.hiddenmenu.bootloadunlock;
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.*;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import java.io.File;
import java.io.RandomAccessFile;
public class BootLoader_Unlock extends ListActivity
{
public BootLoader_Unlock()
{
String as[] = new String[1];
as[0] = "BootLoader Unlock Check";
mTopMenu = as;
}
private void showResult(int i)
{
android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(this);
Log.e("BootLoader Unlock", (new StringBuilder()).append("readNV(36): ").append(i).toString());
if(i == 4353)
builder.setMessage("Unlock");
else
builder.setMessage("Lock");
builder.setPositiveButton(0x104000a, null);
builder.setTitle("BootLoader Unlock Check");
builder.show();
}
public int device_unlock_flag_read()
{
short word0;
boolean flag;
File file;
RandomAccessFile randomaccessfile;
word0 = 0;
flag = true;
file = new File("/dev/block/platform/omap/omap_hsmmc.1/by-name/nv");
randomaccessfile = null;
RandomAccessFile randomaccessfile1 = new RandomAccessFile(file, "r");
randomaccessfile1.seek(18432L);
word0 = randomaccessfile1.readShort();
Log.e("BootLoader Unlock", (new StringBuilder()).append("swrv_fused_status=").append(word0).toString());
Exception exception;
Exception exception1;
try
{
randomaccessfile1.close();
}
catch(Exception exception4) { }
if(!flag)
word0 = -1;
return word0;
exception;
_L4:
Log.e("BootLoader Unlock", (new StringBuilder()).append("readNV(36): exception occurs: ").append(exception).toString());
flag = false;
try
{
randomaccessfile.close();
}
catch(Exception exception3) { }
break MISSING_BLOCK_LABEL_73;
exception1;
_L2:
try
{
randomaccessfile.close();
}
catch(Exception exception2) { }
throw exception1;
exception1;
randomaccessfile = randomaccessfile1;
if(true) goto _L2; else goto _L1
_L1:
exception;
randomaccessfile = randomaccessfile1;
if(true) goto _L4; else goto _L3
_L3:
}
public void onCreate(Bundle bundle)
{
super.onCreate(bundle);
setTitle("BootLoader Unlock Check");
setListAdapter(new ArrayAdapter(this, 0x1090003, mTopMenu));
}
public boolean onKeyDown(int i, KeyEvent keyevent)
{
i;
JVM INSTR tableswitch 3 4: default 24
// 3 31
// 4 31;
goto _L1 _L2 _L2
_L1:
return super.onKeyDown(i, keyevent);
_L2:
getWindow().clearFlags(128);
finish();
if(true) goto _L1; else goto _L3
_L3:
}
protected void onListItemClick(ListView listview, View view, int i, long l)
{
if(i == 0)
showResult(device_unlock_flag_read());
}
protected void onPause()
{
getWindow().clearFlags(128);
super.onPause();
}
protected void onResume()
{
getWindow().addFlags(128);
super.onResume();
}
private static final int NV_IDX_SWRV_FUSED_STATUS = 36;
private static final String NV_PATH = "/dev/block/platform/omap/omap_hsmmc.1/by-name/nv";
private static final int UNLOCK_VALUE = 4353;
private final String TAG = "BootLoader Unlock";
private String mTopMenu[];
}
Other resources in attachments.

ok, here, you have my output file. I had lock bootloader, I hope that this file help you. thanks
Sorry for my english

Duno crap about this phone but I went ahead and tried your script.

Would this work on CyanogenMod 9?
Is it even possible to replace nv.img with a modified version without a security error?

I think in nv there is information if bl is locked or unlocked

Here's the dump for my locked bootloader.

Here's the dump for my locked bootloader because i can't unlock it after rma

I think this is an efuse/prom like Samsung's Knox bit. But I thought it were a specific PROM chip, or integrated into the main chipset(the VIA Apollo mainboard southbridges had such a one-way flash cell.
If it's part of NVRAM, there may be the flash voltage line missing for that specific block, though I never heard of such.

No we figured out the exact line that's preventing us from unlocking in the source code. We just can't get the package signed to fix it.
---------- Post added at 03:06 PM ---------- Previous post was at 03:03 PM ----------
Hmm i wonder what the chances of this working is? I have very little hope through what i've been through

bulletfreak said:
No we figured out the exact line that's preventing us from unlocking in the source code. We just can't get the package signed to fix it.
---------- Post added at 03:06 PM ---------- Previous post was at 03:03 PM ----------
Hmm i wonder what the chances of this working is? I have very little hope through what i've been through
Click to expand...
Click to collapse
Although I don't use my L9 P769 anymore, only keep it for a backup, I edited a copy of my NV image with the data @artas182x posted in the OP and flashed it to the phone. The phone booted just fine, but apparently the NV images get's rebuilt or something along those lines with every boot as the Bootloader Status says it's still locked. If we can figure out how to write directly to the NV partition while the device is booted, then we may have a chance to unlock the bootloader.

i confirm that 1101 is for unlocked phone

There must be something on our flash. We must find what writes to nv partition.

You're about to discover a way to unlock the bootloader despite LGs restrictions. But re-locking it may be impossible.

Would watchdog have anything to do with it getting reflashed? Or does that just check for other "malicious" processes?
---------- Post added at 05:05 PM ---------- Previous post was at 05:01 PM ----------
Does Android automatically write logs of the boot up process or would we need to use a logcat for that?

re-lock impossible? its possible now with a cable with 910k resistor, you just need to Flash stock rom via LG mobile support tool or kdz updater, and your BL will be locked
Napisane używając SwiftKey, zaszyfrowane Enigmą i wysłane kablem Ethernet

Just to be sure is anyone actually going to look into this?

LG P768 Boot Unlock

How will i go about trying this? Like can i get a link to a modified nv.img? Logcats are unable to keep logs of the boot up process right? So is there anything i can use to log it?

We need uboot and x-loader logs

artas182x said:
We need uboot and x-loader logs
Click to expand...
Click to collapse
how does one obtain those?

Related

[R&D] Upload files with DropBox

Hi, this is my code, i cant get upload a simple file:
Signgin in to DropBox:
.....private AccessTokenPair tokensDB;
.....private DropboxAPI<AndroidAuthSession> mDBApi;
.....final static private AccessType ACCESS_TYPE = AccessType.DROPBOX;
.....AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
.....AndroidAuthSession sesDropBox = new AndroidAuthSession(appKeys, ACCESS_TYPE);
.....mDBApi = new DropboxAPI<AndroidAuthSession>(sesDropBox);
.....mDBApi.getSession().startAuthentication(this);
When activity resums this code is executed:
.....mDBApi.getSession().finishAuthentication();
.....tokensDB = mDBApi.getSession().getAccessTokenPair();
when the user clicks over a button in same activity next code is executed:
protected void subeArchivos() {
.....// Uploading content.
.....String fileContents = "Hello World, this is only an example!!";
.....ByteArrayInputStream inputStream = new ByteArrayInputStream(fileContents.getBytes());
.....try {
..........mDBApi.putFile("/testing.txt", inputStream, fileContents.length(), null, null);
..........//Log.i("DbExampleLog", "The uploaded file's rev is: " + newEntry.rev);
.....} catch (DropboxUnlinkedException e) {
..........// User has unlinked, ask them to link again here.
..........Log.e("DbExampleLog", "User has unlinked.");
.....} catch (DropboxException e) {
..........toast = Toast.makeText(getApplicationContext(), "C U A: " + e.getMessage(), Toast.LENGTH_SHORT);
..........toast.show();
..........//Log.e("DbExampleLog", "Something went wrong while uploading.");
.....}
}
The code in red throws error. and after the conde in yellow is executed.
My mnifiest permissions are:
.....<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
.....<uses-permission android:name="android.permission.INTERNET"></uses-permission>
.....<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"></uses-permission>
P.D. All works, exept code in red!!
I hope you can help me!! thx!!
anyone??
I didn't understand anything exc. that you can't upload any file with Dropbox, but I had similar problem. Seems you shouldn't delete the Downloads app, else it bugs DB uploads.
Hope it helps.
thx man, every folder in his place, but maybe something in my code is wrong!!

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

Ping app

hey guys,
Building an app that runs a ping command at the moment and I can't quite get it to work. If I modify the command to something that isn't a terminal command then it'll output my error statement but i can't get it to display the ping output. any help would be awesome. I know my outputs for my error are bad but it's an easy way to determine what path it's outputting.
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import java.io.*;
import java.lang.Process;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView Text = new TextView(this);
Runtime runtime = Runtime.getRuntime();
try
{
Process proc = runtime.getRuntime().exec("system/bin/ping 192.168.1.1");
BufferedReader in = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line = "null";
while ((line = in.readLine()) != null) {
Text.setText(in.readLine());
}
}
catch (Exception e)
{
String line="55";
Text.setText(line);
}
setContentView(Text);
}
}
Thanks for any help you guys can give me,
Adam
Hey,
Try using "system/bin/ping -c 1 192.168.1.1" instead.
And then add this line just after that:
Code:
proc.waitFor();
and while reading the output of the ping you might want to do it like this maybe?
Code:
String line = "";
String result = "";
while (line != null)
{
result = result + "\n" + line;
line = in.readLine();
}
Text.setText(result);
If you want to ping more than 1 packet I think it would be better to make a new thread and do proc.waitFor() in that thread. Then send a message using a handler to set the output of the ping to the TextView
k i have done that and that does make more sense but Im still getting a black screen on the output. i am testing on a Sony tab s and using AIDE (on the device) cause my eclipse is broken. this is how my code looks now,
package com.mycompany.myapp;
import android.app.*;
import android.os.*;
import android.view.*;
import android.widget.*;
import java.io.*;
import java.lang.Process;
public class MainActivity extends Activity
{
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
TextView Text = new TextView(this);
Runtime runtime = Runtime.getRuntime();
try
{
Process proc = runtime.getRuntime().exec("system/bin/ping 192.168.1.1");
BufferedReader in = new BufferedReader(
new InputStreamReader(proc.getInputStream()));
String line = "null";
while ((line = in.readLine()) != null) {
Text.setText(in.readLine());
}
}
catch (Exception e)
{
String line="55";
Text.setText(line);
}
setContentView(Text);
}
}
Is there anything else I could be missing??
Thanks,
Adam
Hey, I think you posted the same code again.
I am not sure if you can read the process stream before it is complete and ping does take a long time to complete. So your main thread is blocking on it and it doesn't get to executing the setContentView.
Thats why I think going for a seperate thread is a better option.
so it would be better to put the ping into a new class and call on it when i need it??
Not a seperate class, a seperate thread to be more specific.
Even if you do put the ping code in a seperate class' method and call that method in onCreate it will still run on the your applications main thread.
What I was trying to say is something along the lines of the following code:
Code:
private TextView textView;
private Process process;
private Handler handler;
private Thread pingThread;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
textView = new TextView(this);
textView.setText("Pinging...");
setContentView(textView);
try
{
process = Runtime.getRuntime().exec("system/bin/ping -c 5 192.168.1.1");
handler = new Handler()
{
@Override
public void handleMessage(Message msg)
{
try
{
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
String line = "";
String result = "";
while(line != null)
{
result = result + "\n" + line;
line = reader.readLine();
}
reader.close();
textView.setText(result);
}
catch(Exception e)
{
e.printStackTrace();
textView.setText("Error");
}
}
};
pingThread = new Thread()
{
@Override
public void run()
{
try
{
process.waitFor();
}
catch(Exception e)
{
e.printStackTrace();
}
handler.sendEmptyMessage(0);
}
};
pingThread.start();
} catch (Exception e)
{
e.printStackTrace();
}
}
I am not sure if this is exactly how you want your app to behave. There might be a better way of doing what you want than what I have suggested but I tested the above code and it works for me.
thats wicked, basically what want my program to do is to run a ping command through a usb to rj45 adapter. at the moment I just need it to do the ping command through wifi and once that was working I was going to set it up to go through usb.
I wonder if there's something I'm doing wrong like I'm build the apk in AIDE on the tablet or something, cause I'm still getting a black screen when booting the app.
If I error the code up a bit, Like put "system/bin/pi ....." instead I do get pinging on the app but no error output and if the code is fine then nothing displays
That is very strange :S.
If you use the incorrect command it works fine but when you use the correct command it doesn't?
Can you post your code? or provide more details if possible?
the code is just the code you posted cause I thought if a I could get it working with that code then modify it to what it needs to do, when the command is incorrect it displays "ping....." but doesn't display an error, I'm going to install eclipse and build the package with that and see how it goes. did you test on a tablet and what did you use to deploy the package?
Adz117 said:
the code is just the code you posted cause I thought if a I could get it working with that code then modify it to what it needs to do, when the command is incorrect it displays "ping....." but doesn't display an error, I'm going to install eclipse and build the package with that and see how it goes. did you test on a tablet and what did you use to deploy the package?
Click to expand...
Click to collapse
I think i know whats happening. It isnt the Ide and using eclipse wont make much of a difference.
Are you usIng something like -c 5 in the ping command? Cause if you aren't i think ping is Going to take a really long time and all you'll see on the screen is "Pinging..."
Yea I have got that in the command, when the code is correct and working I dont get anything all I get is a black screen. Its when I error the command up a bit that I get pinging
Sent from my Sony Tablet S using XDA
hey guys,
just got eclipse running and tested it on an avd emulator and it runs perfect, so the question is what would cause it not to run on my tablet?
I have no idea! I don't have access to an Android Tablet, so I can't test it out! I tested it out on my phone too and it works just fine.
One thing I can suggest though is:
Put log statements throughout the program to signify where the the control has reached. Then run it on your tablet. That should shed some light on where the code is failing on your tablet.
tested it on my phone which is running 2.3 and it failed on there as well, "ping......" would pop up for about a second then disappear, also if I use a command like ls instead of ping on my tablet it will work perfectly fine so I'm guessing for some reason past android 2.1 it doesn't like the ping command. any ideas?
I tested it out on phone with 2.2. Did you try putting log statements and checking where it is failing.
You could also add breakpoints in your code and run it?

[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?

[MOD][KK][XPOSED] KitKat SD Card Full Access

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:

Categories

Resources