G33K-TRICKS

Sunday, January 29, 2023

[Explained] Android App directories and methods to access these directories


Android App directories and methods to be used to access these app directories 


Have you ever wonder why there are so many directories in your Android Phone and what purpose they do serve. As, Android, basically uses Linux as a base platform, it's likely to have Linux like file system structure. Let's take a quick dive into what are those different Android Application Directories in your Android mobile phone and then I've also mentioned the methods that can be used in your android application to access the data from these directories.


Android App Directory



We have 'apps' directory which is self explanatory. The data for the application that are pre-installed or the ones that you would install would sit in this folders. 

APPLICATIONS:
/data/app/* - This is for the users application Installation space 
/data/app/*/base.apk - Space for Android default or preinstalled system apps
/data/app/*/lib//*.so - Space for Shared Libraries(so = shared object similar to dll)
/data/app/*/oat//base.[art|odex|vdex] - Space of compiled executable code that we installed
/data/dalvik-cache//*.[art|dex|oat|vdex] - Space of compiled executable code only for preinstalled apps
/data/misc/profiles/cur///primary.prof - Androd RunTime Profile (refer: https://source.android.com/devices/bootloader/boot-image-profiles)
/data/misc/profiles/ref//primary.prof - Androd RunTime Profile (refer: https://source.android.com/devices/bootloader/boot-image-profiles) 


Next is user directory under Internal Storage

Internal Storage:
/data/user[_de]/<user_id>/<pkg> - To fetch data from this path use getDataDir()
/data/user[_de]/<user_id>/<pkg>/files - To fetch data from this path use getFilesDir()
/data/user[_de]/<user_id>/<pkg>/[code_]cache - To fetch data from this path use getCacheDir() or getCodeCacheDir()
/data/user[_de]/<user_id>/<pkg>/databases - To fetch data from this path use getDatabasePath()
/data/user[_de]/<user_id>/<pkg>/no_backup - To fetch data from this path use getNoBackupFilesDir()
/data/user[_de]/<user_id>/<pkg>/shared_prefs - To fetch data from this path use getSharedPreferences()

Next is external storage and directories present in external path like SDCard

External Storage:

/storage/emulated/obb/<pkg>/*.obb - Shared by multi-users, exposed in following view)

/storage/emulated/<user_id>/Android/obb/<pkg>/*.<pkg>.obb - To fetch data from this path use getObbDirs()

/storage/emulated/<user_id>/Android/media/<pkg> - To fetch data from this path use getExternalMediaDirs()

/storage/emulated/<user_id>/Android/data/<pkg>/ - To fetch data from this path use getExternalMediaDirs()

/storage/emulated/<user_id>/Android/data/<pkg>/files - To fetch data from this path use getExternalFilesDirs()

/storage/emulated/<user_id>/Android/data/<pkg>/[code_]cache - To fetch data from this path use getExternalCacheDirs()



 TLDR, here it is in Tabular format for quick reference.

Android Apps directory and Description

Saturday, January 28, 2023

How to use ChatGPT?


How to use ChatGPT?

AI and ML have been the buzz words for a while now and so many interesting usage has been found using these. Before we start, let's learn a bit about , what is AI, OpenAI and ML.


Artificial intelligence (AI)
refers to the simulation of human intelligence in machines that are programmed to think and learn like humans. AI can be divided into two categories: narrow or weak AI, which is designed to perform a specific task, and general or strong AI, which has the ability to perform any intellectual task that a human can.  Examples of narrow AI include Siri, Alexa, and self-driving cars, which are designed to perform specific tasks such as recognizing speech, answering questions, and navigating roads. Strong AI, on the other hand, is still in the early stages of development and is the type of AI that can think and learn like a human. It has the potential to revolutionize many industries and change the way we live our lives.  Some of the key technologies that are used to develop AI include machine learning, natural language processing, computer vision, and robotics. 

OpenAI is an artificial intelligence research laboratory consisting of the for-profit OpenAI LP and its parent company, the non-profit OpenAI Inc. The company is focused on developing and promoting friendly AI in a way that benefits all of humanity. They have developed a number of widely-used AI technologies, such as the GPT natural language processing model. OpenAI's mission is to ensure that artificial general intelligence (AGI) benefits all of humanity.

Machine learning (ML) is a subfield of artificial intelligence that gives systems the ability to learn and improve from experience without being explicitly programmed. It involves the use of algorithms and statistical models that enable a system to automatically improve its performance with experience.  There are different types of machine learning, including:  Supervised learning: where the system is trained on a labeled dataset, with input-output pairs, and then makes predictions on new, unseen data. Unsupervised learning: where the system is not given labeled data, but instead must find patterns or features in the input data on its own. Reinforcement learning: where the system learns to make decisions by interacting with an environment and receiving feedback in the form of rewards or penalties. Machine learning is used in a variety of applications such as natural language processing, computer vision, speech recognition, recommendation systems, and many more.


How to ChatGPT

ChatGPT: It is a large language model that can perform a variety of natural language processing tasks, such as:

• Text generation: generating human-like text based on a given prompt or context

• Text completion: completing a partially written text

• Text summarisation: summarising a given text to a shorter version

• Text classification: classifying a given text into predefined categories

• Text translation: translating a text from one language to another

• Text answering: answering questions based on a given context

• Text generation of code, poetry, song lyrics and many more.

Additionally, ChatGPT can be fine-tuned on specific tasks or domains, such as customer service, technical support, and creative writing, to improve its performance on those tasks.

It's important to note that while ChatGPT can generate human-like text, it is not a human and may make mistakes or misunderstand certain prompts. It is important to verify any information generated by the model before using it.

ChatGPT is a variant of the GPT (Generative Pre-training Transformer) model, developed by OpenAI.

GPT was first introduced in 2018 by a team of researchers at OpenAI, who trained the model on a large dataset of text from the internet. Since then, OpenAI has released several versions of the GPT model, including GPT-2 and GPT-3, with ChatGPT being one of the most recent versions.

The team behind GPT and its variants includes several prominent researchers in the field of natural language processing, such as Ilya Sutskever, Alec Radford, and Jeff Dean, among others. The development of the GPT model has been led by OpenAI, a research organization founded by Elon Musk, Sam Altman, Greg Brockman, Ilya Sutskever and Wojciech Zaremba.

OpenAI, the organisation that developed ChatGPT, has made the model available for use through a commercial API, which allows users to access the model's capabilities through a web-based interface. The API requires a subscription and usage fee, which varies depending on the usage volume, the type of usage, and other factors.
However, OpenAI also provides some free access to the API, through a free-tier program, or through some partnership or research program, which allows developers and researchers to test and experiment with the model at a lower cost or even for free.
It's worth noting that the research version of the GPT-3 is open-source, meaning it is publicly available for anyone to download, use, and modify. However, the model is very large and requires considerable computational resources and expertise to train and fine-tune for specific tasks. So, it's not recommended for general usage.

Will ChatGPT be free?
ChatGPT, like other large language models such as GPT-2 and GPT-3, requires a significant amount of computational power to train and run.
The original version of GPT-2, which had 1.5 billion parameters, required 4 days of training on 8 NVIDIA V100 GPUs, with a batch size of 2048. This implies that a computational power of about 2 Petaflops is required for training.
GPT-3, which has 175 billion parameters, required several months of training on several thousand of high-performance GPUs, which is not accessible for most of the users.
While the exact computational requirements for ChatGPT may vary depending on the specific architecture and configuration of the model, it's safe to say that it requires a significant amount of computational power and resources to train and run.
It's worth noting that the computational power required to run a pre-trained model like ChatGPT is much lower than what is required to train it. The pre-trained model can be loaded into memory and run on a single high-performance GPU or even a standard CPU, which makes it more accessible to a wider range of users.

 How to login to ChatGPT?

 Open https://chat.openai.com/ on your web-browser.

 Click on Sign up.
Use any account, if you have already a logged in Google account , it makes it more easier. Just click on Continue with Google.
Enter your Name


Provide your phone number. You will receive a verification SMS on you mobile.
Enter the code and you are good to go.


The UI is very simple and easy to use.
Just type in Queries that you want to ask the AI and wait for the AI to get you the answers.




One thing to note in particular. The knowledge date cut off for ChatGPT is marked as 2021. So if you are looking for any new information, refrain yourself from asking it to ChatGPT instead, Google it!!!















Understand more about ChatGPT


What ChatGPT actually is?


ChatGPT
, also known as the Generative Pre-trained Transformer (GPT), is a powerful language model developed by OpenAI. It's a machine learning algorithm that can generate human-like text by understanding the context and patterns of the input it receives. Basically it is a ChatBot developed by OpenAI, an American artificial intelligence (AI) research laboratory which is for now Open for people to use and enjoy.

One of the most notable features of ChatGPT is its ability to understand and respond to natural language inputs. This makes it ideal for a wide range of applications, from chatbots and virtual assistants to automated content generation and text-to-speech systems.

Understand more about ChatGPT
The model is trained on a large dataset of human-generated text, which allows it to understand the nuances of human language and generate text that is coherent and contextually appropriate. Additionally, ChatGPT has been fine-tuned on specific tasks, such as answering questions or writing creative stories, which means that it can be tailored to specific use cases.

Advantages of ChatGPT?

One of the key advantages of ChatGPT is its ability to generate text that is difficult to distinguish from text written by a human. This makes it ideal for use cases where the output needs to be indistinguishable from human-generated text, such as chatbots and virtual assistants. Another advantage of ChatGPT is its ability to generate text quickly and efficiently. This makes it ideal for use cases where the output needs to be generated in real-time, such as chatbots and virtual assistants. In addition to its natural language generation capabilities, ChatGPT can also be fine-tuned for other language-based tasks, such as language translation and summarization. This versatility makes it a valuable tool for a wide range of industries, from customer service and marketing to research and development.

Limitations of ChatGPT?

However, ChatGPT is not without its limitations. One of the main limitations is that it is a machine learning model, which means that its output is only as good as the data it is trained on. This means that its outputs may be biased, or that it may not understand certain nuances of human language. Additionally, since the model is pre-trained, it may not be able to understand new language patterns or idioms.

Another limitation is that ChatGPT's output can be repetitive, as it is based on patterns it has seen before in the training data. This can make its output less creative or less interesting.

Despite these limitations, ChatGPT is a powerful tool that has the potential to revolutionize the way we interact with machines. Its ability to understand and respond to natural language inputs, generate text quickly and efficiently, and be fine-tuned for specific tasks makes it a valuable asset for a wide range of industries.

As the technology and the dataset continue to evolve, ChatGPT will become even more powerful and versatile. This can lead to a wide range of new applications, such as personalizing chatbot experience, creating more accurate language translation systems, and even improving the way we interact with our homes and cars.

Overall, ChatGPT is a cutting-edge AI technology that has the potential to change the way we interact with machines. Its ability to understand and respond to natural language inputs, generate text quickly and efficiently, and be fine-tuned for specific tasks makes it a valuable asset for a wide range of industries. As the technology and the dataset continue to evolve, ChatGPT will become even more powerful and versatile, leading to a wide range of new applications.

Sunday, November 13, 2022

[Solved] Xiaomi Redmi Phone Rebooting from Fastboot Mode Or Rebooting from Recovery Mode



If you found this page while looking for a solution to a problem of your Xiaomi Phone getting switched off automatically while in Fastboot mode or While in Recovery Mode. You are absolutely at the right place.
Here is a basic and important info how to resolve this issue.

What is fastboot mode?


If you have not heard it before, in easy words fastboot mode is used for installing the ROM images (OS package files in other words). Usually, installing OS images is also called as Flashing.
For Flashing a mobile, "fastboot.bin" tool from Android is required. Flashing is capable of wiping the complete phones data as the new OS image will be written over the previous image data.

The Fastboot screen on usual Xiaomi phones look like:

Xiaomi Redmi Fastboot Mode


You can switch to Fastboot mode by Pressing Power Key and Volume Down Key


What is Recovery mode?

You can switch to Recovery Mode by pressing Power Key and Volume Up key and leave the Power Key when you seen the MIUI logo on the screen.

Recovery Mode is used for Zip files from OEMs or Update the OS version or firmware version. You can also use for deleting Userdata or do a factory Reset of your phone.

Recovery does not use command line tool instead it itself can flash the files which can be kept in the phone memory (if phones memory has partition available) or file can be kept in external SD card.

Recovery Mode on Xiaomi phones :




So, coming back to our original problem. If device is keep on rebooting automatically if you are in recovery mode or fastboot mode. Major of the issues that occur is due to Power key. As explained earlier, we use Power key for performing switching the device to Recovery or Fastboot mdoe.
On a regular basis, we tend to use Power key more often then any other keys on your phone. The key press button keys have limited life shelf like any other electronic devices. After certain period of time they stop working as they are intended to do so. 
Do not want to bring in here the concept of planned obsolescence. But its good read if you want to understand more how consumers are being  forced to upgrade or buy new item. A good read here:

Again, coming back to our topic, if your device is continuously rebooting, say after around 10 to 14 seconds when in fastboot mode that means the power key on device is in pressed state thus sending a Reboot signal to the device. Same happens when your device is in Recovery Mode. Your phone reboots and you continue to worry if the problem is with OS.
While you struggle to find out what and where exactly the problem is, your battery might get drained out and then you are out of options now. With drained battery, you can neither check further nor you can reflash new OS.
I've been into this situation. My phone's battery was dead and if I connect the phone to PC or Power Charger, it would start charge and before the charging  could even initiates, the phone reboots again. That is more of a frustation over an ongoing frustation. Either you need to have another phone which can charge your phones battery or some external universal charger that can charge the battery.
After digging a lot, I found a way to charge the battery atleast. So that I could confirm that, problem is because of Power Button and not because of corrupted OS.

While trying to do all of this , I tried flashing a complete OS image using the Xiaomi flash and that deleted everything from my phone including OS, so phone was just rebooting in fastboot mode.
Word of caution, I will not be responsible for any data loss in case you follow the steps. Please proceed if you understand the consequences.

To start with, I am assuming you have fastboot.exe on your system. If not, please refer this: https://wiki.lineageos.org/adb_fastboot_guide





You need to goto device fastboot mode (as given in this screenshot )
And quickly need to flash the TWRP Recovery Image.
In my case - I renamed the file to recoveryb.img

The command to flash is:

fastboot flash recovery <path to recoveryb.img/recoveryb.img


The file size is around 14MB so it would be flashed quickly before your phone switches off or reboot.
Even if your battery is dead you can flash via fastboot.



You can search for Fastboot flash recovery image on XDA forum. Please do drop a comment if you are not able to fine the fastboot.zip file, I can find and share with you.

Alternately, you can double click and run the flash_recovery.bat file to flash the TWRP recovery image when phone is in Fastboot mode.
Once flashing is done,  you will start seeing the MIUI logo.
Now, Connect your phone to a charger and you can remove the battery and connect it back while holding Power key and volume up key.
This will take you to TWRP recovery screen (as device was flashed with TWRP recovery image)
Quickly at bottom of the screen press up or down to move to some other page in recovery screen.
It seems, for me Power button had no impact on Recovery screen and I was able to charge the phone to 100% in recovery mode.
You would notice that phone is charging at the top right , where battery percentage is append with "+" symbol

Let the phone charge completely to be on the safer side.
Meanwhile, you can download the complete OS for your phone from MIUI.com
and keep it in SDCARD


Once phone is completely charged or charge is greater than 80%. Keep the sdcard inside the phone.
Press the Power key and volume up key to go to TWRP recovery screen.
Click on Install button.
Select the SDCARD path where OS zip image is kept (remember flashing the complete image will make you loose your all data)

And select Yes to start the phone flashing.
Now your phone has a proper OS image which is supposed to boot properly.

But if phone continues to boot again and again from MIUI logo screen.
That confirms something is wrong with the power button of the device.

Go to nearest mobile repair shop and get the power button replaced.
He might argue that the issue is with OS or flashing but as you have done your homework, ask him to replace the button blindly. It just would cost you few bucks. There you go, you will have your phone working afterwards for sure.

Thursday, October 27, 2022

How to get signature Checksum of any Apk on MAC


Command to get the Signature Checksum of any APK on Mac machine





What are signature checksum:


How to find apk checksum on mac machine
Let's start with, what is a checksum? CheckSum is a sequence of letters n numbers that is obtained from a data for detecting errors that can get introduced in the data while it is being saved or transmitted. If you have a checksum of actual file, using that checksum you can find that the file that you have downloaded or saved is actually the same or was their any tempering done in-between transmission or before it was shared to you.

Now, coming to APKs, SHA-256 / SHA-512 / MD5 are hashing algorithm used while signing a file. The file can be .apk , .txt
A file is signed so that its authenticity can be known. If the apk is tampered, the checksum would change and by comparing the original and the file checksum you can confirm if the apk was modified or not before you start using it.
For Android APK, a tool called apksigner.jar is used to sign and verify the checksum. That binary would be available in the Android SDK usually under build-tools. 

Running alone the apksigner tool gives below output:

USAGE: apksigner <command> [options]

       apksigner --version

       apksigner --help


EXAMPLE:

       apksigner sign --ks release.jks app.apk

       apksigner verify --verbose app.apk


apksigner is a tool for signing Android APK files and for checking whether

signatures of APK files will verify on Android devices.



COMMANDS

rotate                Add a new signing certificate to SigningCertificateLineage


sign                  Sign the provided APK


verify                Check whether the provided APK is expected to verify on

                      Android


lineage               Modify the capabilities of one or more signers in an existing

                      SigningCertificateLineage


version               Show this tool's version number and exit


help                  Show this usage page and exit



I will not go into details of what each command does but if you are interested to read further and want to learn more on Apksigner, you can take a look at developers.android.com.



Check for the SDK build tools path. It would look something like below:

/Users/<YourUserName>/Library/Android/sdk/build-tools/29.0.2/

Signature checksum command for Windows Machine:



apksigner verify -print-certs [apk] | grep -Po "(?<=SHA-256 digest:) .*" | xxd -r -p | openssl base64 | tr -d '=' | tr -- '+/=' '-_'


Signature checksum command for Mac Machine:



But on Mac machines, the "Grep" command with -Po  does not work as it is not supported and throws "invalid option -- P" error.

$grep -Po

grep: invalid option -- P

usage: grep [-abcdDEFGHhIiJLlMmnOopqRSsUVvwXxZz] [-A num] [-B num] [-C[num]]

[-e pattern] [-f file] [--binary-files=value] [--color=when]

[--context[=num]] [--directories=action] [--label] [--line-buffered]

[--null] [pattern] [file ...]



To resolve that, we need to replace the way we do 'grep', by using the perl command. 
The following Perl command is replacement for grep -  

perl -nle 'print $& if m{(?<=SHA-256 digest:) .*}'


So below is the final command to find the checksum of Android apk : 

/Users/<YourUserName>/Library/Android/sdk/build-tools/<BuildToolVersion>/apksigner verify -print-certs <PATH_TO_APKFile> | perl -nle 'print $& if m{(?<=SHA-256 digest:) .*}' | xxd -r -p | openssl base64 | tr -d '=' | tr -- '+/=' '-_'


In conclusion, using checksums is crucial in ensuring the authenticity of APK files. By following the steps outlined in this guide, you can find the checksum of an APK file on a Mac machine.

Thursday, October 20, 2022

[Solved] How to solve "Align the operands of a condition in an unless statement spanning multiple lines" error


[SOLVED] How to deal with "C: Align the operands of a condition in an unless statement spanning multiple lines" error from Rubocop


Below is the problem statement.
C: Align the operands of a condition in an unless statement spanning multiple lines
Rubocop throws this as an error when the operands are not align correctly. 
Below the simpler way to look at it and how to resolve it.
Solution:
@bad Code
fail('Title not Present') unless
NewPage.page.title1.exists? ||
NewPage.page.title2.exists?
@good Code
fail('Title not Present') unless
NewPage.page.title1.exists? ||
NewPage.page.title2.exists?
Get Amazon Gift Cards for your friends and relatives: here

Friday, September 9, 2022

How to Uninstall VMware Intelligent Hub from Android


What is WorkspaceOne Intelligent Hub

And Removing VMware WorkspaceOne Intelligent Hub from Android phones

Let's start with the basic question, what WorkspaceOne Intelligent Hub is and what does it do?

How to uninstall workspaceOne Intelligent Hub
Well, it's not easy to get this one answered in short. It would require its own post. But anyways, I will try to summarise it in a short way. Please do comment if you are looking for a complete post on it. I've seen multiple reviews on Google Playstore where many users have asked, "I've installed Intelligent Hub but how to remove this app" or "can someone help to uninstall this app, I am not able to remove the Intelligent Hub".

So, lets start first with, what VMware WorkspaceOne Hub is -  WorkspaceOne Intelligent Hub is a Mobile Device Management application for Android phones and it falls under an umbrella term called Enterprise Mobility Management (EMM) app. Similar apps are also available on different Platforms like iOS, Windows and different companies have their own client application created. For example, Microsoft has InTune, IBM has MaaS360, Ivanti got MobileIron and there are many more. This client app allows organizations to securely enable employees to use their mobile phones and the applications on them. EMM apps help IT department of a company to control the device (not as in actual control but manage the device settings, applications, etc). They can deploy and remove the applications on the phone remotely. They also can deploy restrictions on the device like Not allowing a user to open Camera or to open Playstore app etc. Thus, managing the device to increase the productivity of the workforce. Most of the device users are either being requested by the company to install the Hub app from Google playstore OR the company's IT department itself would install the app and have it enrolled for the user. 

Why can't you uninstall Hub?

The moment you try to enrol the phone with Intelligent Hub, the app would request certain permission which I will be discussing later in the article, which is the cause of the issue. Be it company-owned mobile devices (i.e. Corporate Owned) or your personal device (i.e. Bring Your Own Device - BYOD), the day you do not want to use this app, you will have to unenrol yourself from the Intelligent Hub application first. Point to note here is unenroling from the Hub app will not uninstall the app.

Although, it's just a 100MB-150MB app, but no one would want an app that just sits on device ideally and consume space. You try to go to Settings > Apps > Find Hub. Here, what you find is, Uninstall Option is Disabled. This is what annoys everyone, why would an App which is installed by you, does not get uninstall.

And you would ask, why I am not able to uninstall it from my Android mobile. The simple reason is - it's Google (of course because Android is from Google) and your company's IT Admin does not want you to uninstall it from the phone.  But if you have a mobile enrolled in a specific mode you should be able to. Let's look into it further.



Why Google, because the MDM app is using the capabilities which Google has provided in the Android OS. The whole ecosystem is designed by Google in a certain way so that IT dept. or the WorkspaceOne UEM console Admins can managed it.
When you install any MDM application be it Android Intelligent Hub or some other MDM app onto your mobile, during the initial setup, the application would request certain permissions. Among these permissions, there is one that would ask you to set the application as Device Administrator. 
I am sure, you should be able to recall the below screen when the app was getting configured and you had to choose the Activate option.

Now another question arises, what is Device Admin? Let's do a small quick dive into it before proceeding. 

As the name suggests, Device Admin applications are the ones that have control of the device.

For example, "Google Find my Device" will be pre-installed on every Google Playstore supported device and this app will be de-facto a Device Admin. As the app has elevated permission already given by Android OS, this app is capable of ringing the device and locating the device without user's intervention. That is the only reason, we are able to find the device even if the mobile screen is locked and no one is using it.

You can see the same on your mobile phone under the Settings > Security & Location > Advanced > Device Admin App .  The Find My Device app is set as Device Admin with a Tick mark. The Tick suggests that the listed app is Device Admin and Un-tick refers that the app is installed but not set as Device Admin.

Steps to Uninstall Intelligent Hub from Android phones

So, if you want to Uninstall the Intelligent Hub from your mobile and if your phone is enrolled with and Android Legacy mode of enrolment called Device Admin mode, you just need to perform the below steps. For more details, you can check this guide from Google on Legacy Deprecation.

Go to Settings > Security & Location > Advanced > Device admin apps

Untick or Disable the WorkspaceOne Intelligent Hub

On the next screen, select "Deactivate this device admin app"

Go to Settings > Applications & notifications > Search for Hub and click on Uninstall





Device admin app screen


When you cannot Uninstall Android Hub

There is one more real-time scenario when you see Hub is installed on the device but the option to "Deactivate this device Admin app" is Disabled (Grayed out). This is the case, where the mobile was enrolled in Work Managed or Device Owner mode or Corporate Owner Personally Enabled (COPE). You can confirm this by launching the Hub app and clicking on "This device" option. If you are seeing "Work Managed" or Corporate Owner Personally Enabled as in the below screenshot, you can be sure that the Hub app is Device Owner app and your Company or IT department is in complete control of the mobile phone. 


     WorkspaceOne Intelligent Hub Account screen
WorkspaceOne Intelligent hub This Device screen




For the Work Managed and Corporate Owner Personally Enabled (COPE) enrolled mobile, the OS does not want you to un-enroll the device on your own and it does not want you to Uninstall the Device admin app too as the mobile device, in this case, would usually be owned by the company.
Hence, when you go to Device admin settings on your mobile device, you would find the setting as Disabled for you to click.



Work Managed enrolled Device Admin screen



As the option is grayed-out , you will not be able un-install the Hub app. If your Company IT Admin has permitted you to see and launch Hub, you can try launching the Hub app. From the Account screen, tap on This Device option and then tap on the Enrollment option. You would find Unenroll Hub if IT admin has kept the option enabled. If it's enabled by mistake, try not to click on it. Click it in Work Managed Mode or Corporate Owner Personally Enabled device would factory reset the device. This is expected Designed behaviour.


 Hub Account Screen WorkspaceOne Intelligent hub This Device screenUnenroll Hub



If you like to understand more about Work Managed mode, you can take a quick read on my earlier post - difference between Work Managed and Work Profile modes. You can also take a look into How to install and uninstall the Test DPC App on mobiles.

It should be noted that the above information is applicable for other MDM android apps like IBM Mass360, Miradore, MobileIron, and other widely used MDM applications. There might be a small change in the way the app is installed or configured on the mobile phones but the process of uninstalling these types of apps, once they become device Admin, is the same.
Hope, you'd find this article useful and learned something new. 

Also, if you have any more questions with respect to what happens to your personal data when VMware WorkspaceOne Hub installed, you can go through this FAQ page directly from VMware - 

Please do comment below if you have any questions or suggestions.


If Privacy is important to you, you might be interested to learn if you are being watched via Intelligent Hub: https://g33ktricks.blogspot.com/2023/10/privacy-concerns-with-intelligent-hub.html



Incoming searches:

How to uninstall VMware Intelligent hub

Uninstall steps for VMware Intelligent hub

Sunday, July 17, 2022

Small Size Test Apks


List of Smallest Apks for Test
Often we require some test apps to install on device just to see if installation is working fine.

You can run adb command  - adb install <apk> to install apps from command line if you have Android SDK installed. You can download them directly from the links here or you can search and get them from Google play store and install them from the mobile's File Manager.



Here is the list of Small Size Test Apks

1. Chhotu- The Smallest APK

Playstore link:

https://play.google.com/store/apps/details?id=a.i

Size of app: 2.4k


2. Smallest App - 4G Switch and Network Info


2nd on the list is Info app with size slightly more than above . It's just 2.8KB and displays information like SIM cards, IMEI number, phone number, current network etc.

Playstore link:






3. I'm small app

Playstore link:

https://play.google.com/store/apps/details?id=com.vkopitsa.droid.smallapp

Size: 3.38 KB


4. Smallest app

Playstore link:

https://play.google.com/store/apps/details?id=z.m

Size: 3k









Thursday, May 19, 2022

[Solved] How to resolve Ruby "Error running 'rvm_make -j10'" error on Macbook


[Solved] How to Fix "__rvm_make -j10" error while installing Ruby on Mac machines

Install ruby on macbook m1 pro

We often have to switch from one machine to other or sometimes we go for an upgrade. In my case, I moved from Mac Pro 2016 Intel based chip to Macbook Pro 16 inch,  Apple M1 Pro based chipset and got stuck with this error.

You must have a prior experience, Installing Ruby has always been hassle on Mac/Ubuntu machines but moving away from Intel Chip to M1 Pro added few more challenges. 

RVM is Ruby Version Manager which is command line tool which helps in install, manage and work with different Ruby environments. RVM can also help in switching between different version of Ruby on your computer.

While installing Ruby via RVM, I was constantly getting below error.


> rvm install 2.6.5 

Error running '__rvm_make -j10',

please read /Users/<username>/.rvm/log/1652946926_ruby-2.6.5/make.log

There has been an error while running make. Halting the installation.


Because of the above error, I was not able to Install the Ruby and the installation was halted. My initial assumption was, it is due to OpenSSL lib on machine but it was not. Looking at the make log file, I found that there were many errors and was not able to figure out how to resolve this error. 

Finally after few trial and error, I could resolve the error with this guide.

Here are easy steps to Install Ruby on Macbook Pro with Apple M1 Pro chipset


PreRequisites:

- Brew should already be installed on your machine.
- And change the architecture of your terminal to "arch -arm64 zsh" OR "arch -arm64 sh"

1. Download  the ruby file given in below link
https://raw.githubusercontent.com/rbenv/homebrew-tap/e472b7861b49cc082d1db0f66f265368da107589/Formula/openssl%401.0.rb

2. Save the file to your machine

3. Run brew install <pathWhereFileIsDownloaded>/openssl@1.0.rb

4. Add below path to your shell's rc file
echo 'export PATH="/opt/homebrew/opt/openssl@1.0/bin:$PATH"' >> ~/.zshrc

echo 'export LDFLAGS="-L/opt/homebrew/opt/openssl@1.0/lib"' >> ~/.zshrc
echo 'export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.0/include"' >> ~/.zshrc
echo 'export PKG_CONFIG_PATH="/opt/homebrew/opt/openssl@1.0/lib/pkgconfig"' >> ~/.zshrc

5.  Close the terminal and reopen new OR run source ~/.zshrc to reload the config

6.  Confirm the OpenSSL lib being used by running command:
     openssl version
     
    which returns:

    OpenSSL 1.0.2u  20 Dec 2019

7. Run below command to Disable RVM autolibs 
  rvm autolibs disable 

8. Run below export commands: 
    export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC
  export optflags="-Wno-error=implicit-function-declaration"

9. rvm install 2.6.5 --with-openssl-dir=/opt/homebrew/opt/openssl@1.0
 (you can choose any ruby version here)

The final Step #9 should install Ruby and you should see below line confirming Ruby is installed

Install of ruby-2.6.5 - #complete

You can also run :  rvm list  to confirm the ruby version installed status.


If above given steps does not resolve your issue, you can also try running below command which might resolve:

a) apt purge libssl-dev && apt install libssl1.0-dev

b)  rvm install 2.6.6 --with-out-ext=fiddle


Incase, you are seeing the issue on macOS Big Sur, be sure to run this before install a Ruby via RVM:


export warnflags=-Wno-error=implicit-function-declaration


For Reference you can visit this Github issue for RVM and scroll to the bottom of the page to confirm this answer.


Please add your comments, if it helped to resolve the ruby installation.



Incoming Searches:
Error running 'rvm_make -j16'
Error running 'rvm_make -j12'
Error running 'rvm_make -j10'
Error running 'rvm_make -j8'
Error running 'rvm_make -j4'
Error running 'rvm_make -j2'
error running '__rvm_make -j8',
Error running 'rvm_make -j16',
Error running 'rvm_make -j12',
Error running 'rvm_make -j10',
Error running 'rvm_make -j8',
Error running 'rvm_make -j4',
Error running 'rvm_make -j2',

Tuesday, November 30, 2021

How to solve "C: Indent when one step more than case" error.


 

[SOLVED] How to deal with "C: Indent when one step more than case." error from Rubocop


Below is the problem statement.
Problem:
C: Indent when one step more than case.
Rubocop throws this as an error when we have a indentation issue. 
Ruby scripts have indentated code and a missing indentation makes compiler grumpy. To resolve it we just need to have a space before starting the when clause.
Below the simpler way to look at it and how to resolve it.
Solution:

@bad Code
case platform.downcase
when 'android'

@good Code
case platform.downcase
when 'android'
Get Amazon Gift Cards for your friends and relatives: here