NEED HELP - Java for Android App Development

hello guys i need help with an apk i want to add a link in my apk for example "if u dont have ****launcher installed press here" and to redirect him to the specified web page
sorry if is a wrong thread
sorry for my bad english
cheers

Laurentiu27 said:
hello guys i need help with an apk i want to add a link in my apk for example "if u dont have ****launcher installed press here" and to redirect him to the specified web page
sorry if is a wrong thread
sorry for my bad english
cheers
Click to expand...
Click to collapse
Intents are used in Android to share or link across to other apps, including URLs. If you want to link to a Play Store page, read this documentation. Otherwise, consider implicit intents here.

This is what I would do. The below code is a function that you would call to determine if a certain apk(package) is installed. What is in bold is where you would place the package name to search for. You could take it a step further and and a String to pass to the function and it would make the function more useful by being able to check for multiple package names.
Code:
/**
* Determine whether the APK is installed.
* /
public boolean isApkInstalled(Context myContext) {
PackageManager myPackageMgr = myContext.getPackageManager();
try {
myPackageMgr.getPackageInfo("[B]com.apps.whatever[/B]", PackageManager.GET_ACTIVITIES);
}
catch (PackageManager.NameNotFoundException e) {
return (false);
}
return (true);
}
This code would be used to install a package. So in theory, you could call your isApkInstalled() function and if it returns false, then call this and present the option for the user to download. The bold is where you would change the package name to whatever package you are looking for.
Code:
/**
* Install the APK through the market: URI scheme.
* /
public void goToMarket(Context myContext) {
Uri marketUri = Uri.parse("market://details?id=[B]com.apps.whatever[/B]");
Intent myIntent = new Intent(Intent.ACTION_VIEW, marketUri);
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myContext.startActivity(myIntent);
return;
}

zalez said:
This is what I would do. The below code is a function that you would call to determine if a certain apk(package) is installed. What is in bold is where you would place the package name to search for. You could take it a step further and and a String to pass to the function and it would make the function more useful by being able to check for multiple package names.
Code:
/**
* Determine whether the APK is installed.
* /
public boolean isApkInstalled(Context myContext) {
PackageManager myPackageMgr = myContext.getPackageManager();
try {
myPackageMgr.getPackageInfo("[B]com.apps.whatever[/B]", PackageManager.GET_ACTIVITIES);
}
catch (PackageManager.NameNotFoundException e) {
return (false);
}
return (true);
}
This code would be used to install a package. So in theory, you could call your isApkInstalled() function and if it returns false, then call this and present the option for the user to download. The bold is where you would change the package name to whatever package you are looking for.
Code:
/**
* Install the APK through the market: URI scheme.
* /
public void goToMarket(Context myContext) {
Uri marketUri = Uri.parse("market://details?id=[B]com.apps.whatever[/B]");
Intent myIntent = new Intent(Intent.ACTION_VIEW, marketUri);
myIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
myContext.startActivity(myIntent);
return;
}
Click to expand...
Click to collapse
thank u for your help

SimplicityApks said:
Intents are used in Android to share or link across to other apps, including URLs. If you want to link to a Play Store page, read this documentation. Otherwise, consider implicit intents here.
Click to expand...
Click to collapse
thank you

Related

Hint of froyo in AOSP

So, I'm editing the stock launcher to allow for appwidgets to be specified by an xml (because I accidentaly rm -rf'd all my sources), when I find this in the newest code for the Launcher2:
http://android.git.kernel.org/?p=pl...fcbb4fe8018e285833701d43c7f5b443;hb=HEAD#l390
Code:
if (version < 8) {
// Version 8 (froyo) has the icons all normalized. This should
// already be the case in practice, but we now rely on it and don't
// resample the images each time.
normalizeIcons(db);
version = 8;
}
Remember that froyo is supposed to be SDK level 8.
It's the first actual mention of it I've seen anywhere, so I thought I'd point it out.

pushing files from your apk to the sdcard?

Im designing a new theme engine for the 360 Launcher so users can start developing their own themes for the 360 Launcher Pro and i360 Launcher. I already design themes for the 360 on google play but I want to get a little bit creative with it and open source it to fellow themers, but I have a question first...
Lets say I stored the appropriate drawables in a /raw folder in the apk. What command in the java code would I use to "push" those files to /sdcard/360/themes/ (So, when a user clicks the install button, it pushes the appropiate files in the correct folders in the devices sdcard or memory) .
Im not a junkie for linux commands so I need a helping hand here, probably something simple.
No need for command line things.
Move your files to the assets directory. Then you will be able to read them. Just write the content to the SD card afterwards. (Android does not use a /raw folder.)
Have a look at this: http://stackoverflow.com/questions/...he-full-contents-of-a-file-to-an-outputstream
Or even better: http://stackoverflow.com/questions/4447477/android-how-to-copy-files-in-assets-to-sdcard
nikwen said:
No need for command line things.
Move your files to the assets directory. Then you will be able to read them. Just write the content to the SD card afterwards. (Android does not use a /raw folder.)
Have a look at this: http://stackoverflow.com/questions/...he-full-contents-of-a-file-to-an-outputstream
Or even better: http://stackoverflow.com/questions/4447477/android-how-to-copy-files-in-assets-to-sdcard
Click to expand...
Click to collapse
Well that works better if thats the case, lemme give this a shot then. rather not beat around the bush and use people memory. I use a /raw folder when I store files in a apk if its a txt file or something thats not relevent to default apk folders.
Hmmm still having troubles with this...
Would this be as equal as what they discuss above?
http://www.codeofaninja.com/2013/01/copy-files-from-assets-folder-to-sd.html
Ive been even messing with this method
Nx Biotic said:
Hmmm still having troubles with this...
Would this be as equal as what they discuss above?
http://www.codeofaninja.com/2013/01/copy-files-from-assets-folder-to-sd.html
Ive been even messing with this method
Click to expand...
Click to collapse
I think so.
Did you add the proper permission for accessing the SD card?
Which error message do you get?
i didn't get errors, just didn't apply
Sent from my 9300 using xda app-developers app
Nx Biotic said:
i didn't get errors, just didn't apply
Sent from my 9300 using xda app-developers app
Click to expand...
Click to collapse
Does your phone have an internal and an internal SD card. Check both.
Did you print the stacktrace in the try and catch blocks? The error might be there.
The code i use:
Code:
public void copyFileFromRaw(int fileID, String destFile)
{
try
{
InputStream is = getResources().openRawResource(fileID);
FileOutputStream fos = new FileOutputStream(destFile);
byte[] buffer = new byte[1024];
int offset;
while ( ( offset = is.read(buffer) ) > 0 ) fos.write(buffer, 0, offset);
is.close();
fos.close();
Runtime.getRuntime().exec("chmod 700 " + destFile); // or chmod to whatever you need
}
catch (Exception e)
{
// print error log
}
}
Args:
fileID -> resource ID of your file, e.g. R.raw.myfile (note this is an ID, not a string)
destFile -> destination file (full path!)
So let's say you put inside the /res/raw/ folder a file called "myfile", now you want to copy that file to the sdcard:
copyFileFromRaw(R.raw.myfile, "/mnt/sdcard/myfile");
nikwen said:
Does your phone have an internal and an internal SD card. Check both.
Did you print the stacktrace in the try and catch blocks? The error might be there.
Click to expand...
Click to collapse
all of my devices do
Sent from my 9300 using xda app-developers app
xdaid said:
The code i use:
Code:
public void copyFileFromRaw(int fileID, String destFile)
{
try
{
InputStream is = getResources().openRawResource(fileID);
FileOutputStream fos = new FileOutputStream(destFile);
byte[] buffer = new byte[1024];
int offset;
while ( ( offset = is.read(buffer) ) > 0 ) fos.write(buffer, 0, offset);
is.close();
fos.close();
Runtime.getRuntime().exec("chmod 700 " + destFile); // or chmod to whatever you need
}
catch (Exception e)
{
// print error log
}
}
Args:
fileID -> resource ID of your file, e.g. R.raw.myfile (note this is an ID, not a string)
destFile -> destination file (full path!)
So let's say you put inside the /res/raw/ folder a file called "myfile", now you want to copy that file to the sdcard:
copyFileFromRaw(R.raw.myfile, "/mnt/sdcard/myfile");
Click to expand...
Click to collapse
il give this a shot
Sent from my 9300 using xda app-developers app
Nx Biotic said:
all of my devices do
Sent from my 9300 using xda app-developers app
Click to expand...
Click to collapse
I meant that it might have been saved on the internal instead of the external SD card.
nikwen said:
I meant that it might have been saved on the internal instead of the external SD card.
Click to expand...
Click to collapse
Neither, i monitored both partitions. Im gna give this another shot tonight with the information You guys gathered so hopefully i can get something working.
Sent from my 9300 using xda app-developers app

[How to] launch any deployed app within your own app

Hello again,
while I´m still working on my PDF to Office app I found out how to use <Capability Name="ID_CAP_OEM_DEPLOYMENT" />.
Using this capability lets you launch any deployed app within another app or lets you get the applist of all deployed apps (sadly less system apps like Office) including appname, uri, appicon and so on.
1. add
Code:
<Capability Name="ID_CAP_OEM_DEPLOYMENT" />
to your WMAppManifestXML
Add to your *xaml.cs file:
2.
Code:
using Windows.ApplicationModel;
using Windows.Phone.Management.Deployment;
3.
Code:
public Package GetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
=> the code will return the package (app) you want to launch if it exists
4.
Code:
private void LaunchAR_Click(object sender, System.Windows.Input.GestureEventArgs e)
{
Package packageById = GetPackageByID("{134E363E-8811-44BE-B1E3-D8A0C60D4692}");
if (packageById != null)
{
packageById.Launch(string.Empty);
}
else
{
// do something if the app doesn´t exist
}
}
=> this sample code will launch Adobe Reader if the app is present on your device
With some simple modifications of the above code you will easyly be able to make visible the whole applist in a ScrollistViewer or Listbox.
=> this could be useful for coding a new AppData backup app for interop-unlocked devices.
Cheers
contable
contable said:
Hello again,
while I´m still working on my PDF to Office app I found out how to use <Capability Name="ID_CAP_OEM_DEPLOYMENT" />.
Using this capability lets you launch any deployed app within another app or lets you get the applist of all deployed apps (sadly less system apps like Office) including appname, uri, appicon and so on.
1. add
Code:
<Capability Name="ID_CAP_OEM_DEPLOYMENT" />
to your WMAppManifestXML
Add to your *xaml.cs file:
2.
Code:
using Windows.ApplicationModel;
using Windows.Phone.Management.Deployment;
3.
Code:
public Package GetPackageByID(string id)
{
using (List<Package>.Enumerator enumerator = new List<Package>(InstallationManager.FindPackages()).GetEnumerator())
{
while (enumerator.MoveNext())
{
Package current = enumerator.Current;
try
{
if (current.Id.ProductId.Contains(id))
return current;
}
catch (Exception ex)
{
}
}
}
return (Package)null;
}
=> the code will return the package (app) you want to launch if it exists
4.
Code:
private void LaunchAR_Click(object sender, System.Windows.Input.GestureEventArgs e)
{
Package packageById = GetPackageByID("{134E363E-8811-44BE-B1E3-D8A0C60D4692}");
if (packageById != null)
{
packageById.Launch(string.Empty);
}
else
{
// do something if the app doesn´t exist
}
}
=> this sample code will launch Adobe Reader if the app is present on your device
With some simple modifications of the above code you will easyly be able to make visible the whole applist in a ScrollistViewer or Listbox.
=> this could be useful for coding a new AppData backup app for interop-unlocked devices.
Cheers
contable
Click to expand...
Click to collapse
Yep! This is used in Samsung AppFolder
-W_O_L_F- said:
Yep! This is used in Samsung AppFolder
Click to expand...
Click to collapse
Exactly.
Do you you know how "InstallationManager.AddPackageAsync" works ?
contable said:
Exactly.
Do you you know how "InstallationManager.AddPackageAsync" works ?
Click to expand...
Click to collapse
I am hoping to learn that myself. I know that Nokia's "Extras & Info" app uses this API for their "SilentInstaller". Nokia's "SilentInstaller" has the ability to install interop-unlocked apps as long as they are fully and properly signed with the appropriate license.xml and wmprheader.xml.
Microsoft has some documentation about this API at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207248(v=vs.105).aspx
**EDIT**
Found it! (I think)
we can deploy apps with InstallationManager.AddPackageAsync(String title, Uri sourceLocation, String instanceId, String offerId, Uri license)
This info matches EVERYTHING that is included with a valid xap signed by Microsoft. All the data is contained in the xap's provxml, too (albeit in the wrong order)
Info about this "undocumented" api is at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662948(v=vs.105).aspx
The million-dollar questions are what privileges are required to access this API, and can we use it without interop unlock?
Really wishing I had my phone back! (won't be here until tomorrow)
Very nice, thanks for publishing! I was going to pull apart App Folder and see how it works myself; thanks for taking the time to do that for me and share it with us all!
For what it's worth, a foreach loop will read more cleanly than explicitly calling GetEnumerator() and then iterating over it, but the basic structure of the code is fine (and I think the MSIL is the same anyhow - foreach being just syntactic sugar - so they probably did it that way when actually writing the app and your decompiler just produced the more verbose version from the MSIL).
Note that this can also, of course, be used to create launcher apps. An alternative to the Start screen, potentially, even (with some other hackery to hook it in where needed). To use it in Backup apps, though, we'll need access to the app's storage folder too (or a way to activate the SeBackup privilege in the app's token...)
Well... already known when I decompiled samsung's app folder app.
---------- Post added at 12:37 PM ---------- Previous post was at 12:29 PM ----------
compu829 said:
I am hoping to learn that myself. I know that Nokia's "Extras & Info" app uses this API for their "SilentInstaller". Nokia's "SilentInstaller" has the ability to install interop-unlocked apps as long as they are fully and properly signed with the appropriate license.xml and wmprheader.xml.
Microsoft has some documentation about this API at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207248(v=vs.105).aspx
**EDIT**
Found it! (I think)
we can deploy apps with InstallationManager.AddPackageAsync(String title, Uri sourceLocation, String instanceId, String offerId, Uri license)
This info matches EVERYTHING that is included with a valid xap signed by Microsoft. All the data is contained in the xap's provxml, too (albeit in the wrong order)
Info about this "undocumented" api is at http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj662948(v=vs.105).aspx
The million-dollar questions are what privileges are required to access this API, and can we use it without interop unlock?
Really wishing I had my phone back! (won't be here until tomorrow)
Click to expand...
Click to collapse
see nokia extra+info app's capability
You can use Shell Chrome API directly to launch any URI, just 2 lines code
reker said:
You can use Shell Chrome API directly to launch any URI, just 2 lines code
Click to expand...
Click to collapse
So please post the two lines of code so that I can launch any URI without using a Toast.
DELETED
GoodDayToDie said:
Very nice, thanks for publishing! I was going to pull apart App Folder and see how it works myself; thanks for taking the time to do that for me and share it with us all!
For what it's worth, a foreach loop will read more cleanly than explicitly calling GetEnumerator() and then iterating over it, but the basic structure of the code is fine (and I think the MSIL is the same anyhow - foreach being just syntactic sugar - so they probably did it that way when actually writing the app and your decompiler just produced the more verbose version from the MSIL).
Note that this can also, of course, be used to create launcher apps. An alternative to the Start screen, potentially, even (with some other hackery to hook it in where needed). To use it in Backup apps, though, we'll need access to the app's storage folder too (or a way to activate the SeBackup privilege in the app's token...)
Click to expand...
Click to collapse
Here an improved code:
Code:
public Package GetPackageByID(string id)
{
List<Package> packages = new List<Package>(InstallationManager.FindPackages());
foreach (var cpackage in packages)
{
if (cpackage.Id.ProductId.Contains(id))
return cpackage;
}
return (Package)null;
}
Indeed to create an AppData Backup app we need access to the app´s storage folder first. Atm we only can copy files from the app´s storage folder with another RPCComponent discovered by -W_O_L_F-. But when the time comes a Backup app can be created in a few hours...
Oneliner (untested)
Code:
public Package LinqGetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
jessenic said:
Oneliner (untested)
Code:
public Package LinqGetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
Click to expand...
Click to collapse
Thanks. The oneliner works fine. :good:
Edit:
post #1 updated with the oneliner....
jessenic said:
Oneliner (untested)
Code:
public Package LinqGetPackageByID(string id)
{
return InstallationManager.FindPackages().FirstOrDefault(p => p.Id.ProductId.ToLower().Equals(id.ToLower()));
}
Click to expand...
Click to collapse
Is it also possible to check if an app is installed and if yes, which version? that would be nice...
gipfelgoas said:
Is it also possible to check if an app is installed and if yes, which version? that would be nice...
Click to expand...
Click to collapse
Yes. With this method you can get all informations about an installed package: version, publisher and so on...

Shared Preferences with Xposed

I try to get shared preferences in the exposed class.
This is a straight forward issue in android java. I do not know whether the permissions are the problem but things are not as straight with Xposed.
Xposed asks to provide the name of the file and the package at init Zigote. I have tried many versions and none of them seems to work. Also, the file which I make may not be available when init Zygote is called, however, I take XposedBridge wants to just register the name of the file and, probably, to prepare to override some permissions when the file is created.
I also try to double the call to the Xposed Shared Method inside the hooked method. I check for the existence of the shared preference file before. Everything is there but the reload method does not seem to reload and the file is not read but defaults are loaded by getInt and getFloat.
There is probably something more to be done, although the examples I have seen do not do anything, yet they override other methods inside init Zygote which I do not need to do.
All I need is to read a simple file from an Xposed Module.
PLEASE, INFORM.
Here is what I have tried :
I have tried many different variation and XposedBridge methods for 4 hours. I have also
tried many name variations with and without .xml.
In the standard Java for Android, there is just one get method to read a shared
preferences file. This does not seem to be the case with exposed.
I do have :
@override
public void initZygote(StartupParam startupParam) throws Throwable {
MODULE_PATH = startupParam.modulePath;
prefs = new XSharedPreferences("PackageName", "SharedPreferenceFileNameWithotDotXml");
}
MODULE_PATH is not used, although I have tried many other methods where was.
Because the file changes on the fly, I called :
prefs.reload();
before I read the data. I tried without this call too. I also tried to get another
prefs before the reload :
prefs = new XSharedPreferences("PackageName", "SharedPreferenceFileNameWithotDotXml");
prefs.reload();
Then I try to read the data from the file :
theStart=prefs.getInt("Start", 2);
theValue=prefs.getFloat("Value", 102.0f);
I always get the defaults 2 and 102.0 although the file is there and the values of the
file are different. I have read the file.
In standard java for android philosophy, just the initialisation in init zygote and
prefs.reload() are sufficient to load the changing values of the shared preferences
file into prefs and then into the variables.
Xposed seems to be different.
I have been told there is a way to read the data from the file. I have tried most
anything and cannot. What is the way to do so. Must be simple and straight as in the
standard java for android. I must not do everything necessary.
Please, inform.
I have also tried to read the file manually from the Xposed class. Access denied. Tried
just in cases. Access denied, again.
Tried to make the shared preferences file with Activity.MODE_WORLD_READABLE. Still
access denied to be read manually.
Even with Activity.MODE_WORLD_READABLE, Xposed cannot read the file as previously
explained.
Tried :
@override
public void initZygote(StartupParam startupParam) throws Throwable {
prefs = new XSharedPreferences(TheNameOfTheXposedClass.class.getPackage().getName
());
prefs.makeWorldReadable();
}
Then, in the hooked method :
prefs.reload();
theStart = prefs.getInt("Start", 2);
theValue = prefs.getFloat("Value", 102.0f);
Still returns only the default, although the file is there. I think, in all attempts,
XSharedPreferences() cannot get the name of the package and or or the name of the file.
The file is in /data/data/NameOfPackage/shared_prefs/NameOfFile.xml
Tried :
@override
public void initZygote(StartupParam startupParam) throws Throwable {
prefs = new XSharedPreferences
("/data/data/NameOfPackage/shared_prefs/NameOfFile.xml");
prefs.makeWorldReadable();
}
with and without .xml
Still nothing.
PROBLEM SOLVED.
Thank you for your reply. Everything was WORLD READABLE : in the non Xposed class and in the Xposed class on a number of occasions.
Also, I have used the hard values for the package and path.
The problem was not related to Java and Android but to Android arrangements and how much Xposed can cope with. The Android permissions for to access the file from the Xposed class had to be elevated which is unusual but this is what solved the problem, I think. Someone also reported the same problem and the same solution : http://forum.xda-developers.com/xposed/development-xsharedpreferences-issue-t2931396
In the non Xposed class, I have used the same solution just with a hard coded path and file. After I make the shared preferences file in the non Xposed class, I gave more permissions by :
File theSharedPrefsFile;
theSharedPrefsFile = new File("/data/data/PackageName/shared_prefs/FileName.xml");
theSharedPrefsFile.setReadable(true, false);
This seems to have solved the problem.
I am not sure of how reliable the solution is, though. I still check in the Xposed class whethere there is such a file or not. I have not tested what happens when the file is not there initially. Must do.
theXposedCommunicationPreferenceFile = new File("/data/data/PackageName/shared_prefs/FileName.xml");
if (theXposedCommunicationPreferenceFile.exists() == false) XposedBridge.log("Check in hooked method cannot find the file");
Hope everything would be OK.
Even though everything should be OK, I am not sure how reliable the dependence of permissions is.
I have also tried the secure reload :
StrictMode.ThreadPolicy oldPolicy;
oldPolicy = StrictMode.allowThreadDiskReads();
try {
prefs.reload();
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
I am not sure how reliable this is either so I put another simple reload on top :
prefs.reload();
StrictMode.ThreadPolicy oldPolicy;
oldPolicy = StrictMode.allowThreadDiskReads();
try {
prefs.reload();
} finally {
StrictMode.setThreadPolicy(oldPolicy);
}
I think, neither of these has made any difference and the real solution was the higher permissions to access the shared preference file given in the non Xposed class, again :
File theSharedPrefsFile;
theSharedPrefsFile = new File("/data/data/PackageName/shared_prefs/FileName.xml");
theSharedPrefsFile.setReadable(true, false);
Pretty nasty problem and difficult to find solution although published in the XDA Forum the searchability of post in the said forum is not very good.
Yet another sleepless night.
StevenStanleyBayes said:
I think, neither of these has made any difference and the real solution was the higher permissions to access the shared preference file given in the non Xposed class, again :
Click to expand...
Click to collapse
I know this is a pretty old thread but I have elevated the permission level to 777 of both the dir and preferences file and yet cannot access the file from the xposedClass is there any chance you are still developing xposed modules and can help

Kotlin app can't find file even though it exists

I'm working on a Kotlin app where I need to access the Cookies file located at /data/data/com.android.chrome/app_chrome/Default/Cookies. However, when I try to access the file, I get a "file not found" error, even though the file definitely exists at that location.
I've double-checked the file path and made sure there are no typos (I can see the file with adb shell and Amaze File Manager), and I've also checked that the app has permission to access the file (app has root permissions).
First I was trying to open and read the file directly and I got the error:
CODE at https://stackoverflow.com/questions/76064385/kotlin-app-cant-find-file-even-though-it-exists
I though maybe Chrome was running so I couldn't open the file directly so I tried copying it to a temp folder and reading that:
CODE at https://stackoverflow.com/questions/76064385/kotlin-app-cant-find-file-even-though-it-exists
But that still fails:
CODE at https://stackoverflow.com/questions/76064385/kotlin-app-cant-find-file-even-though-it-exists
Is there anything else I can try to troubleshoot this issue?
Something in the code triggers cloudflare and blocks me from posting
Code:
Sorry, you have been blocked
You are unable to access xda-developers.com
Why have I been blocked?
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.
What can I do to resolve this?
You can email the site owner to let them know you were blocked. Please include what you were doing when this page came up and the Cloudflare Ray ID found at the bottom of this page.
Cloudflare Ray ID: 7badda7c6b9486c6 • Your IP: Click to reveal • Performance & security by Cloudflare
SQLite definitely won't open the file. So, your decision to copy it was right.
Firstly, try to split the single command string into an array.
The documentation for ProcessBuilder class has an example:
ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1", "myArg2");
Or try to use SuFile from the libsu, for example:
AndroidIDeditor/Util.java at 6a62bac0e3e63502e9a7b538217f65189ff85fa4 · sdex/AndroidIDeditor
Android Device ID changer. Contribute to sdex/AndroidIDeditor development by creating an account on GitHub.
github.com
lioce said:
SQLite definitely won't open the file. So, your decision to copy it was right.
Firstly, try to split the single command string into an array.
The documentation for ProcessBuilder class has an example:
ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1", "myArg2");
Or try to use SuFile from the libsu, for example:
AndroidIDeditor/Util.java at 6a62bac0e3e63502e9a7b538217f65189ff85fa4 · sdex/AndroidIDeditor
Android Device ID changer. Contribute to sdex/AndroidIDeditor development by creating an account on GitHub.
github.com
Click to expand...
Click to collapse
Seems like not even like that can I read the Cookies file from Chrome
Code:
fun copyFile(source: String, destination: String) {
Log.d("CookieSwapLogger", "copyFile '$source' to '$destination'")
val sourceFile = SuFile(source)
if (sourceFile.exists()) {
Log.d("CookieSwapLogger", "sourceFile.exists")
} else {
Log.d("CookieSwapLogger", "sourceFile.notExists")
}
---------------
2023-04-21 18:20:47.440 6347-6347 CookieSwapLogger com.david.cookieswapper D copyFile '/data/data/com.android.chrome/app_chrome/Default/Cookies' to '/data/user/0/com.david.cookieswapper/app_temp/Cookies'
2023-04-21 18:20:47.492 6347-6347 CookieSwapLogger com.david.cookieswapper D sourceFile.notExists

Categories

Resources