27 October 2018

Google Calendar Event Flair Solution

With the new update of the google calendar, event flairs gadget that were a side gadget have been deprecated. ☹

A quick solution I discovered is that my MS Windows 10 has a virtual keyboard with emoji built in.



I pull up this keyboard and just ad the emoji in Event Title box, that fits my need.

For now, this works perfectly.

Hope this helps others!

20 October 2018

How to clean flash (update) Liquid Remix ROM on Xiaomi Mi A1

Clean Flash (1st setup):

1. Download the ROM and GApps
2. Move your ROM.zip + GApps + TWRP-Installer.zip to your internal storage
3. Advanced Wipe
4. Boot into TWRP linked above
5. Wipe System,Data & Cache
6. Flash the ROM zip and the TWRP-Installer.zip
7. Reboot to Recovery via TWRP (Reboot -> Recovery) ,
8. Flash GApps and Magisk
9. Reboot to System
10. Enjoy Liquid!

Dirty Flash (Update) :

1. Download the ROM and GApps
2. Move your ROM.zip + GApps + TWRP-Installer.zip to your internal storage
3. Advanced Wipe
4. Boot into TWRP linked above
5. Wipe Cache
6. Flash the ROM zip and the TWRP-Installer.zip
7. Reboot to Recovery via TWRP (Reboot -> Recovery) ,
8. Flash GApps and Magisk
9. Reboot to System
10. Enjoy Liquid!

17 October 2018

LiquidRemix Pie rom on Xiaomi Mi A1 with Stock GApps and Google Camera

If you want to successfully flash your Xiaomi Mi A1 with LiquidRemix Pie rom, with GApps ARM64 9.0 Stock edition and Google Camera, then follow this procedure:

- After flashing XDA flash procedure and first bootup, disable and root uninstall preinstalled Google Camera.
- Then with Magisk Manager install Google_Cam_Fix_for_LineageOS_v1.0 module and restart phone
- Now you could install  GoogleCamera-Pixel2Mod-Arnova8G2-V8.2.apk successfully.
- And finally, you could install Pixel 3 Wallpapers (com.breel.wallpapers18_9.apk).
- After that, everything is like Pixel Expirience with most customisation from this great rom, like Double Tap to Sleep, Double Tap to Wake, Google Assistent e.t.c. ;)

P.S. from XDA: You can use GApps Aroma edition. It allows you to modify the package before flash, so you don't have to uninstall gcam from gapps package and also uncheck any other gapps pre-installed you didn't want to shrink system size.


16 October 2018

How to flash Pixel Expirience 9.0 on Xiaomi Mi A1

Pixel Experience is an AOSP based ROM, with Google apps included and all Pixel goodies (launcher, wallpapers, icons, fonts, bootanimation).

To flash this rom follow these steps:

1. Be sure to remove any PIN, Password, Fingerprint protection

2. Install ADB Tools and Drivers on your PC.

2. Unlock Bootloader if not already done.

   - Power Off the phone by using the Power key at first.
   - Press and hold the Volume Down + Power button for a couple of seconds to enter Fastboot mode
   - You can release held keys when the Fastboot Mode appears on the phone's screen.
   - In ADB folder Terminal type : fastboot oem unlock

3. Reflash stock 8.1, if you are not already on it, with Mi Flash Tool.

4. Boot in to TWRP with Terminal command : fastboot boot recovery.img

  - Then choose Format data and reboot bootloader with same command:
  - fastboot boot recovery.img

5. After boot TWRP again choose to Wipe System, Data and Dalvik Cache.

6. Put rom, twrp and magisk on your phone internal storage with thise commands:

 - adb push PixelExperience_tissot-9.0-20181012-0716-UNOFFICIAL.zip /sdcard
 - adb push twrp-installer-tissot--3.2.3-0.zip /sdcard
 - adb push Magisk-v17.1.zip /sdcard
 - adb push MagiskManager-v6.0.0.apk /sdcard

7. Than flash the ROM, and after that flash TWRP installer.

8. Now Reboot to Recovery.

9. Flash Magisk (Optional)

10. Reboot system. Than you go with first boot and automatic restart.

11. After first boot and setup, install Magisk Manager if it does not appear.
    (Only if you installed Magisk)

12. Profit!

03 October 2018

How to restore GRUB loader after Windows 10 Update

If you just updated your Windows 10 in a multiboot configuration, and Grub no longer appeared, than just had to run in Windows Command Prompt as administrator, next command:

bcdedit /set {bootmgr} path \EFI\ubuntu\grubx64.efi

and your Grub boot menu should appear in next reboot.

20 September 2018

Automatic Install nVidia drivers in Ubuntu

The first method is the easiest to perform and in most cases it is the recommended approach. First, detect the model of your nvidia graphic card and the recommended driver. To do so execute:
$ ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==
modalias : pci:v000010DEd00001180sv00001458sd0000353Cbc03sc00i00
vendor   : NVIDIA Corporation
model    : GK104 [GeForce GTX 680]
driver   : nvidia-304 - distro non-free
driver   : nvidia-340 - distro non-free
driver   : nvidia-384 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

== cpu-microcode.py ==
driver   : intel-microcode - distro free
If you agree with the recommendation feel free to use ubuntu-drivers command again to install all recommended drivers:
$ sudo ubuntu-drivers autoinstall
Once the installation is concluded, reboot your system and you are done.

19 September 2018

Start Android Studio in Ubuntu with root privileges

If you have to start Android Studio in Ubuntu with root privileges for regular updates, you should make these commands in terminal:

sudo ln -s /opt/android-studio/bin/studio.sh /usr/local/bin/studio
sudo chmod 777 /usr/local/bin/studio

If you have problem with sudo in Ubuntu you can setup root password with command:

sudo passwd root

Now you can start android studio from anywhere by entering command : studio

11 September 2018

Wordpress: Update default page layout for all posts

To update default page layout for all posts, we need to do it in database table wp_postmeta for all post_id's, with next command:

INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT ID, "mom_page_layout", "right-sidebar" FROM wp_posts WHERE post_type = "post" AND post_status = "publish"

After that, all published posts will have desired page layout.

This is also available for event pages, with command :

INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT ID, "mom_page_layout", "right-sidebar" FROM wp_posts WHERE post_type = "event" AND post_status = "publish"

06 September 2018

Relocate Android Studio SDK and Emulator files

If you want to relocate your Android Studio SDK and Emulator files to different folder or disc, than you have to setup these environment variables :

ANDROID_SDK_HOME                        - D:\Android
ANDROID_EMULATOR_HOME          - D:\Android\.android\
ANDROID_AVD_HOME                        - D:\Android\.android\avd\

After these setup variables, your Android Studio will use these folders.


04 September 2018

Android SQL Injection Vulnerability with exported=false

So here's the problem: when I add the widget to the homescreen, a SecurityException is immediately thrown inside the onDataSetChanged() method when I try to query the provider. This appears to be because the homescreen does not hold the permission to read my content provider.

Because of Google Play Developer Console witch refuse App Submission because of  SQL Injection Vulnerability with exported=false in AndroidManifest.xml, we need to leave that option to false.

While the context is actually correct, it is bound to the wrong process.

So we need to enclose our query in clearing Identiry Token in WidgetService.java:

// Revert back to our process' identity so we can work with our
// content provider
final long identityToken = Binder.clearCallingIdentity();

mCursor = cr.query(EntryColumns.ALL_ENTRIES_CONTENT_URI, new String[]{EntryColumns.TITLE, EntryColumns._ID, FeedData.FeedColumns.ICON}, selection.toString(), null, EntryColumns.DATE + Constants.DB_DESC);

// Restore the identity - not sure if it's needed since we're going
// to return right here, but it just *seems* cleaner
Binder.restoreCallingIdentity(identityToken);

This solves the problem, even without setting read/write permissions on the contentprovider, just using it with exported set to "false".