i tried system/bin/screenshot, it doesn't work, it make screenshots, but colors are totally messed up
what i tried is:
Code:
adb shell
screenshot /media/001.png
what you obtain is a blueish screenshot, with messed up colors
i would like to use it with cron4phone to make timed screenshots to use with the screensaver, so i can have the page i'm reading as screensaver
any idea how to fix it?
Tried the screenshot app?
apeine said:
Tried the screenshot app?
Click to expand...
Click to collapse
nope, how to launch them from cron4phone?
i use the screenshot
and it work great
chriscsh said:
i use the screenshot
and it work great
Click to expand...
Click to collapse
can you start it from the shell?
no
but you can set the delay time for take a screenshot
I tried
Code:
screenshot /sdcard/001.png
in terminal emulator and it worked for me.
larryflynt said:
I tried
Code:
screenshot /sdcard/001.png
in terminal emulator and it worked for me.
Click to expand...
Click to collapse
which version? (1.0.0, 1.0.1, 1.1)
aren't you getting blueish colors?
May be the emulator windows has easy to render colors, try to take screenshot of the launcher with icons please
Did you know a free screenshot app where you can specific the path to save the file.
It woud be nice to save the screenshot to /media/screensavers/
Try this instead
Code:
/system/bin/screencap -p /outputlocation/out.png
The Nook frame buffer is RGB565.
The emulator framebuffer isn't.
You can always just dump the framebuffer raw and convert it to a PNG externally.
Code:
cat /dev/graphics/fb0 > /sdcard/raw
i tried running it in my app and the image return is blank.
Runtime.getRuntime().exec("/system/bin/screencap -p "+TouchOverlay.getFolder()+ cName + ".jpg");
I ve also tried both bmp and png format with no avail.
Is there anything permission i need set to get the image?
To access the frame buffer you must be a member of the graphics group.
An application runs as a user like "APP_14".
You could add your user to the group manually.
You could hack an existing permission to automatically include your user in the group.
You could add a new permission to automatically include your user in the group.
You could spawn a process to run su.
Renate NST said:
To access the frame buffer you must be a member of the graphics group.
An application runs as a user like "APP_14".
You could add your user to the group manually.
You could hack an existing permission to automatically include your user in the group.
You could add a new permission to automatically include your user in the group.
You could spawn a process to run su.
Click to expand...
Click to collapse
Thanks for the reply!
I would prefer not to use super user but unable to find resources guiding me on adding the permission. Whats the permission called? Couldnt find one that fits your description.
Oops, it's actually easier than I was thinking.
I was thinking of something else.
The permission is just android.permission.SCREENSHOT
What I said before is true for hacking a group like audio.
You can take decent screenshots using Android SDK.
on NST :
- "Nook Color Tools" -> "All Settings" -> "Development" -> USB debugging [X] -> Auto Mount [ ]
- connect nook to your PC with USB cable
- run "ddms" from your Android SDK folder
-select "Device > Screen Capture" (or Ctrl-S) to take a screenshot
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Just saying.
It is kind of a off-topic but I think that a screenshot thread is a good place to post that info.
Mmm.. delicious,
I wish the actual e-ink screen looked this good in reality. Maybe someday.
How to take a proper screenshot from framebuffer with ADB and FFMPEG
Here's what I use:
Code:
% adb pull /dev/graphics/fb0
% ffmpeg -f rawvideo -pix_fmt rgb565 -s 600x800 -i fb0 -frames 1 -vcodec png screenshot.png
The full script that also timestamps the generated files:
Code:
@echo off
set ffmpeg=ffmpeg.exe
set framebuffer_dev=/dev/graphics/fb0
set screenshot_file_name=nook_%date%_%time:~0,2%%time:~3,2%%time:~6,2%
echo BEGIN %~n0
echo Pulling raw framebuffer data from device...
adb pull %framebuffer_dev% %screenshot_file_name%.raw
echo Converting framebuffer to PNG format: %screenshot_file_name%.png
%ffmpeg% -loglevel quiet -f rawvideo -pix_fmt rgb565 -s 600x800 -i %screenshot_file_name%.raw -frames 1 -vcodec png -y %screenshot_file_name%.png
echo Removing raw framebuffer data...
del /f /q %screenshot_file_name%.raw
echo END %~n0
Example output (the automatically-generated filename is nook_2015-03-11_105313.png):
The script is attached, along with another one that will remove all the previously-generated screenshots. To work it needs ADB and FFMPEG (download link).
I use the free app Screenshot Ultimate for all my screenshotting needs. I do take quite a few - see my profile's "NTG Homescreens" albums for all of the homescreens I've used in the past.
Here's an example of what Screenshot Ultimate can do:
All you need is the empty frame and the aforementioned app to create beauties like this!
If you want something a bit less ultimate you can download nookbits.exe from the signature.
Code:
adb pull /dev/graphics/fb0 raw
nookbits /f /b2 raw snap.png
(/b is optional border)
Related
Introduction
As I like to stay connected via Putty to my Android phone, from time to time I missed the functionality of updatedb / locate that I so got used to within Linux environment.
I've decided to cross compile the findutils package (I couldn't get the latest version 4.4.2, but an older before, 4.2.33).
Screenshot
You can see the updatedb command followed by some locate commands.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation
Busybox is required.
1. Copy the archive onto your /sdcard/ folder.
2. mount your /system folder as read-write
3. cd /system/
4. tar xf /sdcard/findutils-4.2.33.tar.gz
It is mandatory that you are inside /system/ folder when you extract the archive.
Then you have to create the database (using updatedb script). It will take a bit of time - but not too much.
Then you can use the locate command giving any part of a file name that you can remember, you can also use wildcards!
Observations
1. No integration with cron / etc. If you know your updatedb database is out of date, rebuild it using "updatedb"
2. Busybox comes with a /system/xbin/find command. The trouble with it is that it doesn't support the fstype argument, and thus, updatedb cannot prune some standard file system type paths. However, the bundled package here comes with its own find utility which unpacks into /system/bin/find.
3. Busybox is required for sort / sed, but updatedb script is patched to use the /system/bin/find (its own find executable) instead of the default busybox one.
4. My phone did not have an /etc/mtab file (list of mounts which mount is supposed to update whenever something happens). Thus, there is a line in the updatedb script which recreates that file on each updatedb invocation (mount > /etc/mtab). If you phone / tablet has it, please modify updatedb script and remove the mount command.
Download
Use it at your own risk!
findutils-4.2.33.tar.gz
This is great! Thanks for your work!
I hope that there will be a file manager for android which uses updatedb/locate to index/search files in the future, that would be sooooo awesome!
Don't know about other software that searches - but it would be nice too.
Maybe I can create something, but I'm sure there are others more integrated - such as looking in SMSes or in mails too, etc.
nice! find takes for ever lol now i have locate!
Any chance of getting the code. Did you create your own Android.mk? Did you use the FindUtils make?
When I run updatedb, I get these errors:
/system/bin/find: /preload: Value too large for defined data type
/system/bin/find: /storage/sdcard0: Value too large for defined data type
/system/bin/find: /system: Value too large for defined data type
/system/bin/find: /data: Value too large for defined data type
yelkarama said:
When I run updatedb, I get these errors:
... <snip>
/system/bin/find: /data: Value too large for defined data type
Click to expand...
Click to collapse
I also get this error
This doesn't work. Might have worked a couple years ago before 4.x Android...
Use something like es file Explorer
Sent from my SAMSUNG-SGH-I747 using XDA Premium 4 mobile app
I will rebuild it in the weekend I think back in the days the file systems were only 32bit, and now a lot of phones have 64bit file systems ...
viulian said:
I will rebuild it in the weekend I think back in the days the file systems were only 32bit, and now a lot of phones have 64bit file systems ...
Click to expand...
Click to collapse
Thanks for your efforts, I guessed it needed a rebuild from a google, but given how long ago you posted this I didn't think it would happen. Looking forward to the update!
Sent from my GT-N7100 using Tapatalk
Please upload the new build
viulian said:
I will rebuild it in the weekend I think back in the days the file systems were only 32bit, and now a lot of phones have 64bit file systems ...
Click to expand...
Click to collapse
Hi
Please upload the new built binaries.
Thanks
Don't work with Oreo. Please make a update.
Hello everyone.
I think, the biggest problem of Firefox OS is no implemented Unix Commands. That make many restrictions, for example, you can't change your CPU Governor, move applications to SD Card etc.
So, I have been thinking about it. I Created a project of "Root" (Can I use this term?) for B2G. Here is:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Node.JS starts with B2G and receiving commands from Webapp via SocketIO and created library. Why I used NodeJS? At first, instalation is just copy&paste, permissions for Node and edit b2g.sh file, the second, that allows a large expansion.
So, what do you thinking about this? Maybe do you have better solution?
The target audience of Firefox OS are entry-level smartphone users, and the platform APIs are those of the Web. So it will never have full Unix power.
Your ideas for hacking a local desktop power-user version are interesting though. I like the idea of hacking Node.js + Firefox OS to build a web-platform development distro!
Siprah123 said:
So, what do you thinking about this? Maybe do you have better solution?
Click to expand...
Click to collapse
Your idea is great
Do it please
Now i have terminal emulator and CPUcontrol on FirefoxOS (But runing on PHP)
i think it will great if runing on node.js
Flashable zip
http://forum.xda-developers.com/devdb/project/dl/?id=553
At this time, I done it:
Hooked HTML Code into another page (for example into Gaia - modifiable interface).
http://screencloud.net/img/screenshots/b77d1c115b2ecfbea2291deb373a455a.png
And commands!
http://screencloud.net/img/screenshots/984532385587b94361fd097b7ee9dee1.png
http://screencloud.net/v/lfy7
http://screencloud.net/v/zP0
Great work!
Do you compile it for ARM?
Send me a link please
sorry for my bad english
Node.JS is already compiled for ARM and works perfectly
Anyway, I created a prototype of hooks for Gaia Interface - http://imgur.com/a/4NUNg
I'll public it when will be ready (I hope soon).
Siprah123 said:
Node.JS is already compiled for ARM and works perfectly
Anyway, I created a prototype of hooks for Gaia Interface - http://imgur.com/a/4NUNg
I'll public it when will be ready (I hope soon).
Click to expand...
Click to collapse
from
http://nodejs.org/download/
i not see download For liux arm ??
Give me a link please
I just compiled from sources with Android NDK.
Siprah123 said:
I just compiled from sources with Android NDK.
Click to expand...
Click to collapse
Wait for you
Siprah123 said:
I just compiled from sources with Android NDK.
Click to expand...
Click to collapse
OK now i learn to cross compile and compile successful
Can you teach me or example a code ? How to Hook gaia?
I added a hook just via editing a Gaia Interface. After Socket.IO Recieving HTML Code from server and justs adding something.
By the way. How permissions works http://www.youtube.com/watch?v=IDYfVFdxMqA
Siprah123 said:
I added a hook just via editing a Gaia Interface. After Socket.IO Recieving HTML Code from server and justs adding something.
By the way. How permissions works http://www.youtube.com/watch?v=IDYfVFdxMqA
Click to expand...
Click to collapse
How you edit b2g.sh ?
Is gaia run from node.js not b2g?
Wow Great work!
Can't wait for release
pureexe said:
How you edit b2g.sh ?
Is gaia run from node.js not b2g?
Wow Great work!
Can't wait for release
Click to expand...
Click to collapse
I edited b2g.sh in my computer, pushed and changed chmod for it. In release that process will be automatically
Code:
#!/system/bin/sh
umask 0027
export TMPDIR=/data/local/tmp
mkdir -p $TMPDIR
chmod 1777 $TMPDIR
ulimit -n 4096
# Run Node.JS Server
exec /system/b2g/node/node /system/b2g/node/app/app.js &
if [ ! -d /system/b2g ]; then
log -p W "No /system/b2g directory. Attempting recovery."
if [ -d /system/b2g.bak ]; then
if ! mount -w -o remount /system; then
log -p E "Failed to remount /system read-write"
fi
if ! mv /system/b2g.bak /system/b2g; then
log -p E "Failed to rename /system/b2g.bak to /system/b2g"
fi
mount -r -o remount /system
if [ -d /system/b2g ]; then
log "Recovery successful."
else
log -p E "Recovery failed."
fi
else
log -p E "Recovery failed: no /system/b2g.bak directory."
fi
fi
LD_PRELOAD="/system/b2g/libmozglue.so"
if [ -f "/system/b2g/libdmd.so" ]; then
echo "Running with DMD."
LD_PRELOAD="/system/b2g/libdmd.so $LD_PRELOAD"
export DMD="1"
fi
export LD_PRELOAD
export LD_LIBRARY_PATH=/vendor/lib:/system/lib:/system/b2g
export GRE_HOME=/system/b2g
exec /system/b2g/b2g
Can you upload your nodejs binary file?
I try to compile with my self but failed on run npm
any update?
Ehi Siprah!cmon we are all waiitng for your updates!
+10 for this project! I love the possibilities this hack brings us. Can you open a github? I'm too interesed in the code to wait for it
Great idea!Just do it!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Installation
Step - 1 : Setting Up your PC!
Download The following resources first:
Java SE Run-time Environment 7 [ Java Dependencies For Signing APK tool ]
Now let's begin setting up your PC,
Install the above mentioned programs.
Go to Advanced System Properties.
It looks like this:
Go to Environment Variables, then create a new System Variable, having name JAVA_HOME and value as the path where you have installed the JRE.
It looks like this:
Now after creating the JAVA_HOME variable, search for Path system variable in the System Variables list. Now this is a bit tricky. Once found click on it and then on Edit. Move the cursor to the end of the string till you see ";" (without quotes), add the path to your JRE bin folder just after it.
It looks like this:
OK, so if everything went fine and just as what instructed then you are all good to proceed to Step - 2!
Step - 2 : Installing Cassini on your PC!
Download the latest build from the download section.
Extract the zip Cassini.[CURRENT-VERSION].zip, and execute Cassini.[CURRENT-VERSION].exe.
Now follow the Installation wizard and you are done!
It looks like this:
How to Use?
Firstly, open up your C: Drive and then go to Program Files [Program Files (x86) in case of 64-bit system] folder, then just look for a folder named Divya Mamgai, go in it and you will find a folder named Cassini and that's it, it is your Main directory.
Now copy your apk files to the working directory of it, and then start the program.
Now just press enter to start compressing!
Wait for the process to complete, and all your apk files will be available to be used while saving a lot of data on your device in the build folder.
Download
Cassini.1.1 - [5.76 MB (6041289 bytes)]
Currently Compatible Apps
All System Apps, except - LatinIME.apk [ Results in force close of keyboard?! ]
Some PlayStore Apps.
Example of working - ZPlayer, Textra, Solid Explorer and even more!
Example of non-working - WhatsApp and especially all the games i had (!), please try it out and report me of what apps are compressible and what are not?
Screens
Cassini.1.1 -
Hit thanks if you like my work! [ ]
Change Log
Version - 1.1
Initial release with minimal features.
[Tool][Windows] Cassini.1.2 - App Compressor is Back!
thank you, perfect
thank you, perfect, that's what I needed
hugo.gabriel999 said:
thank you, perfect, that's what I needed
Click to expand...
Click to collapse
You are welcome buddy!
does this work on unbutu 13.10? i guess it is for windows.
correct me if i am wrong.
Does app compression also boost file system performance in anyway? Regardless, this is great!
Su vaat che!
Are there any downsides such as a slower phone?
Could we have more info on what it does ?
Does it open apk res and compress them ?
really productive, that is. would definitely try it soon
Does this make any impact on receiving updates from the Play store? After updating would the apps be uncompressed?
by comparing at files which was compressed i can see Res and resources.arsc got compressed. and th compression ratio is great too. i was using similar method called Go Optimizer by gu5t3r without any isse and helped me saved more space in my phone.
try it out right now ... really awesome dude! thanks
this is the best tool! I'm a dev, so can I use this n the system apps of my roms before I make them into a flashable zip? Also, does this work on the framework-res.apk?
Have tried some system apps. But non of,them works after replace them.
SystemUI
Mms
Phone
Settings
Contacts
Camera
Sent from my Xperia Ray using XDA Premium 4 mobile app
I respect your work but its not The Only of its kind!
as Dilesh Perera said,goptimizer like..
what is the png compression/optimization technique used?
Is this working on kitkat?
First of all sorry to not reply so late cause, I had exams and also the fact that I forgot to subscribe the thread.
I'm really sorry.
desalesouche said:
does this work on unbutu 13.10? i guess it is for windows.
correct me if i am wrong.
Click to expand...
Click to collapse
Yes you are right it is based on some of basic functions of Windows, also I don't think the setup might not work in Unbuntu.
DroidOnRoids said:
Does app compression also boost file system performance in anyway? Regardless, this is great!
Click to expand...
Click to collapse
Well I don't know accurately but check out this rom - Hyperion Xperia U , I have used Cassini in it and it really helped my device to handle multitasking in a much better way. But I won't get my hopes up in getting better performance.
I made this tool to make adb commands quicker and easier to carry out, as I use adb a fair bit. It's similar to this one but I wanted to include some different functions and put more focus on the hassle free installation of adb on various Linux distributions.
It's a simple script that has the most useful adb commands in a menu format. I also added an adb installation menu which automatically detects what system you have and installs the correct package and it's dependencies. Not every system is supported yet but I'll add more in time.
Code:
[I]I am not responsible for any damages caused by your use of this tool.
Please do some research if you are unsure of anything.[/I]
Features:
Installs adb and configures udev rules.
supports ubuntu, debian, mint, suse, redhat, fedora, centos, elementaryOS, Mageia
Adb over network
Manages files into organised directories
Reboot menu
Pull, push, sideload, shell
Logcats and system dumps
Install and uninstall apps
Unlock bootloaders
Remotely take screenshots and create screen recordings
Full adb backup and restore
More to come
Download Link
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Instructions:
Extract file anywhere in your home directory
cd to the same directory as ezy-adb.sh
Open a terminal and change permissions with this command:
Code:
$ chmod 755 ezy-adb.sh
Run the script with:
Code:
$ ./ezy-adb.sh
Thanks to @raziel23x. I learned a lot from studying his apktool script.
Enjoy
Changelog
28/09/15
Initial release
29/09/15
Added diagnostic tools sub menu with dumpsys fuctions
merged log and log dump into diagnostic tools
30/09/15
Added option adb over network
Added option uninstall package
04/10/15
Merged reboot functions into a sub menu
10/10/15
v1.3
Script now scans for a connected device before executing commands
Date in (y,m,d,H,M,S) added to screenshot name
y, H,M,S added to date on screen recording name
Bug fixes
Minor ui tweaks
25/11/15
v1.4
Install adb now supports elementaryOS and mageia
Bug fixes
23/12/15
v1.4.1
Fixed derp on adb install
Art Vanderlay said:
I made this tool to make adb commands quicker and easier to carry out, as I use adb a fair bit. It's similar to this one but I wanted to include some different functions and put more focus on the hassle free installation of adb on various Linux distros.
It's a simple script that has the most useful commands in a menu format. I also added an adb installation command which automatically detects what system you have and installs the correct package and it's dependencies. Not every system is supported yet so i'll add more based on feedback.
Features:
Installs adb and configures udev rules.
supports ubuntu, debian, mint, suse, redhat, fedora, centos
Manages files into organised directories
Reboot menu
Pull, push, sideload, shell
Logcats and dump files
Install apk's
Unlock bootloaders
Remotely take screenshots and create screen recordings
Full adb backup and restore
More to come
Instructions:
Extract file anywhere in your home directory
cd to the same directory as ezy-adb.sh
Open a terminal and change permissions with this command:
Code:
$ chmod 755 ezy-adb.sh
Run the script with:
Code:
$ ./ezy-adb.sh
Download Link
ezy-adb.sh.tar.gz
Thanks to @raziel23x. I learned a lot from studying his script.
Enjoy
Click to expand...
Click to collapse
I've always wanted an easy way to install adb and config udev rules on Ubuntu but i just couldn't so i had to switch to BBQLinux. But now i don't have to :laugh: Thank you bro.
kirito9 said:
I've always wanted an easy way to install adb and config udev rules on Ubuntu but i just couldn't so i had to switch to BBQLinux. But now i don't have to :laugh: Thank you bro.
Click to expand...
Click to collapse
No worries Glad to help.
Nice work m8
Thanks buddy :good:
good job man
in this way it will not be necessary to rename screenshots
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/EZY_ADB/ScreenShots/$(date '+%Y%m%d%H%M%S').png
thanks
asmanao said:
good job man
in this way it will not be necessary to rename screenshots
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > ~/EZY_ADB/ScreenShots/$(date '+%Y%m%d%H%M%S').png
thanks
Click to expand...
Click to collapse
Cheers. That'll make things easier
nice job man, thannks! Your tool makes my nerding easier :laugh:
Thanks, bro, It's Really Helpful
Guys. Everyone I need your undivided attention please. This might be it. This may be the key we have been seeking. However a once wise man said "these aren't the keys you're looking for" A true geek knows the reference. Now serious business.
Ok I did some research. So this Boolean folder is important. In fact this may be the jem we need.
In /system/bin you have two executables getsebool and setsebool. I'm going to explain this as easy as possible.
An*SELinux boolean*is a single string (hopefully sufficiently interpretable) that changes how SELinux reacts. With*getsebool*you can get a list of booleans and their current value. Changing SELinux booleans can be done through*setsebool*(where you add the desired state of the boolean, such as*on*or*off) or*togglesebool*(which flips the current value of a boolean).
Click to expand...
Click to collapse
Let's play a little game. Unfortunately for this to do anything, you need to be root already i think.
Code:
getsebool -a
This will list any booleans set in the SElinux policy and their values (on or off). On the HD 10, there is one boolean present. At the moment, this device is the only one I have run into that has anything set in the booleans. I own about a dozen different devices (phones and tablets) all of them work and are either rooted or boot loader unlocked (only my Moto E4 isnt). Not a single one of them have anything in the booleans in this folder, except for this HD 10. It is wiped clean on every other device. HD 10 boolean:
Code:
$ su
# getsebool -a
device_unlocked --> off
Here's the fun part:
Code:
# setsebool device_unlocked on
# getsebool device_unlocked
device_unlocked --> on
However there is a problem with changing this value, even being root:
When you do this, the changed value will take effect immediately but only for the duration that the current loaded policy is active. That means, if the system reboots, you loose the changes. Or when you explicitly would reload the SELinux policy, you loose the changes. On the other hand, switching booleans this way is fast and helps you to debug problems.
Click to expand...
Click to collapse
There is a way to change this, running a simple command. However I'm certain the bin file or files have been modified and the commands removed from the policy.
Code:
setsebool -P device_unlocked on
In a normal world, the above command would make the value we set persist upon a reboot. So why alter the policy? That doesn't make sense to me. I know as an OEM you can write said policy, but why go through the massive effort if only to leave this boolean in place? Now given this potential massive discovery, what does this now mean? Did I just do what I think I did? Was this really that easy?
I was not able to find the single log entry of the event on my HD 10. However the Fire 7, even with the custom ROM by @ggow, has the same boolean and value. I did the same steps on that tablet and I was able to get the single log entry. Can we get excited and jump...or cry for joy yet? I am totally lost in this neck of the woods.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
References:
https://wiki.gentoo.org/wiki/SELinux/Tutorials/Using_SELinux_booleans
https://www.thegeekdiary.com/understanding-selinux-booleans/
Well this may or may not be anything. A few months ago I discovered a booleans in /sys/fs/selinux/booleans called 'device_unlocked'. You can set the bool, but the value persists to 'off' (of course) when you reboot. In a terminal:
Code:
su
setsebool device_unlocked on
getsebool device_unlocked
on
Reboot and it will be set to 'off'. Well thanks to the su.d shell commands/script I found here on xda, I can now make that persists on reboot. In a terminal:
Code:
su
mount -o remount,rw /system
mkdir /system/su.d
chmod 700 /system/su.d
echo "#!/system/bin/sh" > /system/su.d/unlocked.sh
echo "setsebool device_unlocked on" > /system/su.d/unlocked.sh
echo "on" > /sys/fs/selinux/booleans/device_unlocked
chmod 700 /system/su.d/unlocked.sh
No need to reboot. Now the question is...what is it?
If you have an unlocked tablet now, in a shell do this:
Code:
su
getsebool -a
device_unlocked --> on
it's definitely tied into the unlocking procedure. Because my fire 7 says 'on' and I never set the bool.
Sent from my Amazon KFSUWI using XDA Labs