[MOD/GUIDE] X-Recents - Android Software Development

Hey Guys!
After a few requests I decided to share my X-Recents mod with you, so that other developers get the ability to add it to their Rom. This is just for Developers building Roms from Source! Also, medium skills on java coding are recommended!
What is X-Recents mod?
It's a mod improving the stock android recents, to make them more user-friendly and feature-rich. It was already implemented in my X-Bean Rom for i9000
Please note:
- you can use this for all ICS/JB Roms and for all devices
- just add me to the credits, if you want to use it, and notify me: [email protected]
- The swype FC Bug (occurs when swyping over the Button) still exists, to fix it just add try/catch blocks at all points that cause the FC it (use adb/logcat for analysis)
- If you like my work and want to support me, the Thanks & the Donate button are always appreciated!
Okay, so let's get started: You can find all files in: system/frameworks/base/packages/SystemUI/src/com/android/systemui/recent (in your working directory, or whereever you're SystemUI sourcecode is)
At first, we modify the RecentTasksLoader.java:
l.260: final int first = 1;
to : final int first = 0;
This loads the current activity into the recents list.. Only problem: The launcher shall not be shown in the recents list, so we have to make a exeption for it:
l.270: if (item != null) {
to : if (item != null && item.packageName!="com.cyanogenmod.trebuchet") { // You can add as many exeptions for apps as you want
Next point: Adding the Taskmanager button:
At first, open RecentsVerticalScrollView.java:
Insert this at line 95:
Code:
private void opentaskmanager() {
PackageManager pm = getContext().getPackageManager();
Intent appStartIntent = pm.getLaunchIntentForPackage("your.taskmanager.packagename.here");
if (null != appStartIntent)
{
getContext().startActivity(appStartIntent);
}
}
Remember to change the "your.taskmanager.packagename.here" to the package name of your taskmanager!
Now, wrap a try/catch block around the loop content in line 107:
Code:
for (int i = 0; i < mLinearLayout.getChildCount(); i++) {
try {
View v = mLinearLayout.getChildAt(i);
addToRecycledViews(v);
mAdapter.recycleView(v);
} catch (Exception ex) {
}
}
Also add a try here (I can't give you a line, because you inserted something before) :
Code:
for (int i = 0; i < mAdapter.getCount(); i++) {
try {
View old = null;
And a catch here:
Code:
calloutLine.setOnTouchListener(noOpListener);
mLinearLayout.addView(view);
} catch (Exception ex) {
}
}
To add the button, insert this:
Code:
Button bt_taskmanager = new Button(getContext());
bt_taskmanager.setText("Task Manager");
bt_taskmanager.setWidth(mLinearLayout.getWidth());
bt_taskmanager.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
opentaskmanager();
}
});
mLinearLayout.addView(bt_taskmanager);
Between these two lines:
setLayoutTransition(transitioner);
// Scroll to end after layout.
Okay, now we've got the button!
At last I want to give you something you can experiment with:
Code:
private void clearalltasks() {
final ActivityManager am = (ActivityManager)
mContext.getSystemService(Context.ACTIVITY_SERVICE);
final List<ActivityManager.RecentTaskInfo> recentTasks =
am.getRecentTasks(50, ActivityManager.RECENT_IGNORE_UNAVAILABLE);
for (int i = 0; i >= recentTasks.size(); i++) {
RecentTaskInfo item = recentTasks.get(i);
if (am != null && item!=null) {
try {
am.removeTask(item.persistentId, ActivityManager.REMOVE_TASK_KILL_PROCESS);
} catch (Exception ex) {
}
try {
am.killBackgroundProcesses(item.origActivity.getPackageName());
} catch (Exception ex) {
}
}
}
mLinearLayout.removeAllViews();
try {
update();
} catch (Exception ex) {
ex.printStackTrace();
}
}
This is my first attempt to add a clear all button.. Do with it what you want, I tried it and it works half-ways.. But not perfectly. I will add some more things later, for example how to add several more Buttons!

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"
}

Very good ...

Awesome post!

Related

[Q] Commands for Hardware controll

Hello,
i just starting with C# dev. and now i search the "commands" or the "way" to controll the Mobile phone.
i use a HTC Leo WinMo 6.5.3 and VB2010 or VB2008. the first little "hello world" app runs great, bit i want to controll the Hardware, like enable or disable the Camera LED or something link that.
other phones like the Sonim xp3 have a "Developer Readme" and list the complet commands for hardware access.
i search for the HTC Leo the same, but i found only the "Microsoft WinMo Dev." side with the standart commands.
give it a "Dev HowTo" from HTC for Leo or something like that?
thank you
I'd go with a bit of IDA (or PE Explorer, if it can show DLL entrypoints) and try disassembling the camera.dll or HTCCameraUtility.dll files from OEMDrivers/camera packages. I bet there will be one entrypoint named something like EnableLight and DisableLight.
As OndraSter said, disassembling files is the only way to learn how to control hardware.
CreateFileW + DeviceIoControl are typically used to control leds (excluding camera's led (at least on X1, TP2, etc)).
All leds can be controlled directly using "I2C1:" device or manufacter's wrapper (on SE X1 there is "LED1:" device).
Kay, i installed the PE Explorer, i open the HTCCameraUtility.dll and the Camera.exe from the windows dir, but in both cases the PE Explorer disable the disassembling function. i try a other exe file and this works fine with pe explorer...
and now? what means "IDA" ?
IDA stands for Interactive Disassembler, which is ... disassembler of dll/exe/... for many platforms (win32, wince arm etc supported in demo version).
When I get home (tomorrow, on saturday, or the day after on sunday), I will help you with that, but I dont own any LED-flash integrated device, so I'll have to do a lot more work .
@ultrashot
I didn't realize it might be on I2C, thanks for pointing that out
- Andrew
Attention, as usual: All code below is rather device-specific. If you don't know what you do, don't use it!
Probably i2c_ functions are the same on all htc devices (at least I hope so).
On Kovsky I use these functions to control i2c devices directly:
*.h:
Code:
#define I2CMgr_WriteMultiBytes_Ioctl 0x80100024
#define I2CMgr_WriteByte_Ioctl 0x8010000C
#define I2CMgr_ReadMultiBytes_Ioctl 0x80100028
#pragma pack(1)
typedef struct
{
unsigned char device_id;
unsigned char smth1;
unsigned short address;
unsigned int inBufLength;
unsigned char *inBuf;
}I2C;
typedef struct
{
unsigned char device_id;
unsigned char address;
unsigned short data;
}I2C2;
#pragma pack()
.cpp:
Code:
int i2c_write(int device_id, int address, unsigned char *buf, int buf_size)
{
HANDLE device=CreateFileW(L"I2C1:",0xC0000000,0,0,3,0,0);
I2C i2c;
i2c.device_id=device_id;
i2c.address=address;
i2c.smth1=1;
i2c.inBufLength=buf_size;
i2c.inBuf=buf;
for (int x=0;x<3;x++)
{
if (DeviceIoControl(device,I2CMgr_WriteMultiBytes_Ioctl,&i2c,sizeof(I2C),NULL,NULL,NULL,NULL))
{
CloseHandle(device);
return S_OK;
}
DeviceIoControl(device,0x80100014,&i2c,sizeof(I2C),NULL,NULL,NULL,NULL);
Sleep(0xA);
}
CloseHandle(device);
return -1;
};
int i2c_writewbyte(int device_id, int address, unsigned short data)
{
HANDLE device=CreateFileW(L"I2C1:",0xC0000000,0,0,3,0,0);
I2C2 i2c;
i2c.device_id=device_id;
i2c.address=address;
i2c.data=data;
for (int x=0;x<3;x++)
{
if (DeviceIoControl(device,I2CMgr_WriteByte_Ioctl,&i2c,sizeof(I2C2),NULL,NULL,NULL,NULL))
{
CloseHandle(device);
return S_OK;
}
DeviceIoControl(device,0x80100014,&i2c,sizeof(I2C2),NULL,NULL,NULL,NULL);
Sleep(0xA);
}
CloseHandle(device);
return -1;
};
int i2c_read(int device_id, int address, unsigned char *outBuf, int outBufLength)
{
HANDLE device=CreateFileW(L"I2C1:",0xC0000000,0,0,3,0,0);
I2C i2c;
i2c.device_id=device_id;
i2c.address=address;
i2c.smth1=1;
i2c.inBufLength=outBufLength;
i2c.inBuf=outBuf;
for (int x=0;x<3;x++)
{
if (DeviceIoControl(device,I2CMgr_ReadMultiBytes_Ioctl,&i2c,sizeof(I2C),outBuf,outBufLength,NULL,NULL))
{
CloseHandle(device);
return S_OK;
}
DeviceIoControl(device,0x80100014,&i2c,sizeof(I2C),NULL,NULL,NULL,NULL);
Sleep(0xA);
}
CloseHandle(device);
return -1;
};
For example, I get info from Kovsky's lightsensor this way. You shouldn't use this code on other devices.
Code:
int lightsensor_read()
{
unsigned char buf[2]={0,0};
int res=i2c_read(MICROP_KLT, MICROP_KLT_ID_LIGHT_SENSOR_KOVS, buf, sizeof(buf));
if (res!=S_OK)
return -1;
int r3=buf[0];
int r2=buf[1];
r3=r3&3;
r2=r2|(r3<<8);
return r2;
};
Full code here: http://forum.xda-developers.com/showpost.php?p=7121525&postcount=231
Debugging on PPC and...
Stress test your application with UAEDT = Unrecoverable Application Error Debugging Tool.
UAE Debugging Tool (UAEDT) is a debug monitor, stress tester etc. for developers of Windows Mobile software. A great free alternative to IDA Pro: assembler/disassembler though of course not as advanced
Ultimate device/radio commander AT Commander :: use only if you know what you are doing it can brick your phone easily!!
{
"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"
}
[PC] ATCommander;
http://atcommander.com
The above link does not provide us with much information / links
Thus I searched some more and came up with;
http://atcommander.com/download/
Same page though not reachable via the first link. Anyway here you can download the latest .zip or .exe
Also do not forget to check this link;
http://atcommander.com/public/
Here some AT Commands reference links provided in a pdf file;
http://atcommander.com/download/AT_Command_Specification/
[PPC] ATCommander;
http://forum.xda-developers.com/showthread.php?t=375395
ChARMeD is a Windows Mobile / Pocket PC / Win CE (for ARM CPUs) Disassembler and Assembler
The name ChARMeD stands for:
Carolo's Hexadecimal ARM Editor and Disassembler
ARM Classic Processors
ARM Infocenter
Use all these applications with caution!!
o/~

What is this, guys?

I installed CWM 6.0.3.6. But it show this message when I enter recovery. I tried to disregard. But it is annoying.
So what does mean that, guys?
{
"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"
}
It happens to me too... duuno why is that...
Have you tried to wipe dalvik cache? Sometimes FAIL's to me ._.
DevastatingTech said:
I installed CWM 6.0.3.6. But it show this message when I enter recovery. I tried to disregard. But it is annoying.
So what does mean that, guys?
Click to expand...
Click to collapse
found this on github
This is not a bug, it's a simple warning after some CM SELinux changes. Nothing should break by this message
Click to expand...
Click to collapse
and this on xda
_alp1ne said:
This happened to me also, but it has nothing to do with flashing or anything. It is best to ignore as it only means some file it is reading has no context.
Click to expand...
Click to collapse
and it started after flashing CWM 6.0.3.6 from CM10.1 thread ...(for me)
so basically we're safe....
is nothing to worry about, but , if you want to be 100% sure, add a durex
copy from CyanogenMod Forum:
it looks like the error is related to SELinux. But it seems safe to ignore.
------------------------------------------------------------------------------
/*
* Copyright (C) 2009 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include "edify/expr.h"
#include "updater.h"
#include "install.h"
#include "minzip/Zip.h"
// Generated by the makefile, this function defines the
// RegisterDeviceExtensions() function, which calls all the
// registration functions for device-specific extensions.
#include "register.inc"
// Where in the package we expect to find the edify script to execute.
// (Note it's "updateR-script", not the older "update-script".)
#define SCRIPT_NAME "META-INF/com/google/android/updater-script"
struct selabel_handle *sehandle;
int main(int argc, char** argv) {
// Various things log information to stdout or stderr more or less
// at random. The log file makes more sense if buffering is
// turned off so things appear in the right order.
setbuf(stdout, NULL);
setbuf(stderr, NULL);
if (argc != 4) {
fprintf(stderr, "unexpected number of arguments (%d)\n", argc);
return 1;
}
char* version = argv[1];
if ((version[0] != '1' && version[0] != '2' && version[0] != '3') ||
version[1] != '\0') {
// We support version 1, 2, or 3.
fprintf(stderr, "wrong updater binary API; expected 1, 2, or 3; "
"got %s\n",
argv[1]);
return 2;
}
// Set up the pipe for sending commands back to the parent process.
int fd = atoi(argv[2]);
FILE* cmd_pipe = fdopen(fd, "wb");
setlinebuf(cmd_pipe);
// Extract the script from the package.
char* package_data = argv[3];
ZipArchive za;
int err;
err = mzOpenZipArchive(package_data, &za);
if (err != 0) {
fprintf(stderr, "failed to open package %s: %s\n",
package_data, strerror(err));
return 3;
}
const ZipEntry* script_entry = mzFindZipEntry(&za, SCRIPT_NAME);
if (script_entry == NULL) {
fprintf(stderr, "failed to find %s in %s\n", SCRIPT_NAME, package_data);
return 4;
}
char* script = malloc(script_entry->uncompLen+1);
if (!mzReadZipEntry(&za, script_entry, script, script_entry->uncompLen)) {
fprintf(stderr, "failed to read script from package\n");
return 5;
}
script[script_entry->uncompLen] = '\0';
// Configure edify's functions.
RegisterBuiltins();
RegisterInstallFunctions();
RegisterDeviceExtensions();
FinishRegistration();
// Parse the script.
Expr* root;
int error_count = 0;
yy_scan_string(script);
int error = yyparse(&root, &error_count);
if (error != 0 || error_count > 0) {
fprintf(stderr, "%d parse errors\n", error_count);
return 6;
}
struct selinux_opt seopts[] = {
{ SELABEL_OPT_PATH, "/file_contexts" }
};
sehandle = selabel_open(SELABEL_CTX_FILE, seopts, 1);
if (!sehandle) {
fprintf(stderr, "Warning: No file_contexts\n");
fprintf(cmd_pipe, "ui_print Warning: No file_contexts\n");
}
// Evaluate the parsed script.
UpdaterInfo updater_info;
updater_info.cmd_pipe = cmd_pipe;
updater_info.package_zip = &za;
updater_info.version = atoi(version);
State state;
state.cookie = &updater_info;
state.script = script;
state.errmsg = NULL;
char* result = Evaluate(&state, root);
if (result == NULL) {
if (state.errmsg == NULL) {
fprintf(stderr, "script aborted (no error message)\n");
fprintf(cmd_pipe, "ui_print script aborted (no error message)\n");
} else {
fprintf(stderr, "script aborted: %s\n", state.errmsg);
char* line = strtok(state.errmsg, "\n");
while (line) {
fprintf(cmd_pipe, "ui_print %s\n", line);
line = strtok(NULL, "\n");
}
fprintf(cmd_pipe, "ui_print\n");
}
free(state.errmsg);
return 7;
} else {
fprintf(stderr, "script result was [%s]\n", result);
free(result);
}
if (updater_info.package_zip) {
mzCloseZipArchive(updater_info.package_zip);
}
free(script);
return 0;
}
http://forum.cyanogenmod.com/topic/75956-cwm-on-nexus-4-after-43-update/
Okay guys, I will ignore this. Already, I hadn't any error. Thanks.

Accessing full resolution photo of Lumia 1020

I thought it'll be nice to post this here, in any event that it's needed in future. So there was an app called phriz.be in Nokia Collection that was released recently, it was the first third party app that have the ability to upload full resolution photo. I gave it a try on reverse engineering it, hoping that it was an undocumented API and not a new capability.
Unfortunately, there's simply no way to do it unless the device is interop unlocked which is rather useless on Nokia Lumia 1020 when the only WP8 device that's unlocked is Samsung Ativ S.
Deploying an app with such capability will give you the following:
{
"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"
}
Anyway.
<Capability Name="ID_CAP_MEDIALIB_PHOTO_FULL" />
Code:
private struct <getPhotos>d__2a : IAsyncStateMachine
Code:
this.<>4__this.IsPhotoLoading = true;
this.<>4__this.PhotoList.Clear();
taskAwaiter = this.<>4__this._deviceService.GetPhotos(this.<>4__this._currentAlbumName, 0, StateData.RecentMaxCount, true).GetAwaiter();
System.Collections.Generic.List<PhotoDisplay> arg_C9_0 = taskAwaiter.GetResult();
taskAwaiter = default(TaskAwaiter<System.Collections.Generic.List<PhotoDisplay>>);
System.Collections.Generic.List<PhotoDisplay> list = arg_C9_0;
this.<list>5__2b = list;
System.Collections.Generic.List<PhotoDisplay>.Enumerator enumerator = this.<list>5__2b.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
PhotoDisplay current = enumerator.Current;
this.<>4__this.PhotoList.Add(current);
}
}
finally
{
if (flag)
{
((System.IDisposable)enumerator).Dispose();
}
}
this.<>4__this.TryShowMoreLink();
this.<>4__this.RaisePropertyChanged("IsPhotoAvailable");
Code:
// Phrizbe.ViewModel.MainViewModel
private readonly IDeviceService<PhotoDisplay, DocumentDisplay, AlbumDisplay, TransferLogItem, ActivityLogItem, ActivityLog> _deviceService;
Code:
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading.Tasks;
namespace Phrizbe.Lib.Model
{
public interface IDeviceService<P, D, A, TL, ALI, AL>
{
void AddActivityLogItem(string deviceName, long deviceId, long deviceOSPlatform, string emailAddress, ALI logItem);
void AddApprovedDevice(string deviceName);
bool AddDownloadBackgroundTransfer(ALI ali, Target sender);
string AddUploadBackgroundTransfer(TransferItemDetail detail);
void ClearCachedPhotos();
void CreateTransferThumbnail(byte[] bytes, string fileName);
List<AL> GetActivityLogs();
Task<ObservableCollection<string>> GetAlbumNames();
Task<List<A>> GetAlbums();
Task<P> GetAlbumThumbnail(string albumName);
string GetCleanFileName(string fileName);
Device GetDeviceInfo();
Task<List<D>> GetDocuments(bool useCache);
Task<P> GetPhoto(string albumName, string fileName, bool useCache);
Task<List<P>> GetPhotos(string albumName, int startIndex, int returnCount, bool useCache);
Task<LocationReport> GetLocation(bool useCache);
bool IsApprovedDevice(string deviceName);
bool IsNetworkAvailable();
bool IsThumbnailDownloaded(long transferId);
long LoadDeviceId();
void RemoveActivityLogItem(string deviceName, ALI logItem);
void RemoveBackgroundTransfer(string requestId, bool forceRemove);
void RemoveActivityLog(string deviceName);
void SaveDeviceId(long deviceId);
Task<bool> SaveFile(ReceiveDataResponse response, string fileName, ActivityContentTypes contentType);
void SaveLogData();
Task<bool> SavePreviewFile(ReceiveDataResponse response, string fileName, long transferId);
void UpdateActivityLogNewCount(string deviceName, long deviceId, int count, bool saveLogData);
}
}
Task<P> GetPhoto(string albumName, string fileName, bool useCache);

MyVerizon app is now checking if phones are rooted!

Just a heads up for VZW customers, I updated the MyVerizon app today and was doing something on my phone when SuperSU popped up asking to grant MyVerizon root access. I denied it of course and the toast message informed me it was trying to run the ls command as root. This got me suspicious, so I decompiled the new update and went looking for the ls command in the code. Needless to say I found out that they are apparently gathering information about each device and one thing they are checking is if your phone is rooted or not. So if you get the Superuser prompt you might want to deny it!
Here is the dex2jar output of the class file that gathers information about your phone the root check is the second method from the bottom.
Code:
package com.vzw.hss.myverizon.rdd.a;
import android.content.Context;
import android.location.LocationManager;
import android.nfc.NfcAdapter;
import android.nfc.NfcManager;
import android.os.Build;
import android.os.Build.VERSION;
import android.provider.Settings.Secure;
import android.provider.Settings.System;
import android.telephony.TelephonyManager;
import android.view.Display;
import android.view.WindowManager;
import com.vzw.hss.connectionmanager.e;
import com.vzw.hss.myverizon.MyVerizonApplication;
import com.vzw.hss.myverizon.rdd.a;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Locale;
import java.util.TimeZone;
import org.json.JSONObject;
public final class d
{
private static String a(Context paramContext)
{
try
{
int j = Settings.Secure.getInt(paramContext.getContentResolver(), "adb_enabled");
i = j;
}
catch (Exception localException)
{
for (;;)
{
a.a("Exception: " + localException.getMessage());
int i = 0;
continue;
String str = "YES";
}
}
if (i == 0)
{
str = "NO";
return str;
}
}
public static JSONObject a()
{
Context localContext = MyVerizonApplication.a();
JSONObject localJSONObject1 = new JSONObject();
try
{
localJSONObject1.put("Model", Build.MODEL);
localJSONObject1.put("Manufacturer", Build.MANUFACTURER.toUpperCase());
localJSONObject1.put("Kernel Version", System.getProperty("os.version", "NOT RETRIEVABLE"));
localJSONObject1.put("Build ID", Build.ID);
localJSONObject1.put("Android Debug Enabled", a(localContext));
String str1 = Settings.Secure.getString(localContext.getContentResolver(), "android_id");
String str2;
String str3;
if (str1 == null)
{
str2 = "NOT RETRIEVABLE";
localJSONObject1.put("Device ID", str2);
if (Build.VERSION.SDK_INT < 14) {
break label497;
}
if (Build.getRadioVersion() != null) {
break label489;
}
str3 = "NOT RETRIEVABLE";
}
TelephonyManager localTelephonyManager3;
String str12;
label184:
TelephonyManager localTelephonyManager4;
String str13;
label213:
label222:
String str6;
label281:
String str8;
label387:
label426:
String str9;
for (;;)
{
localJSONObject1.put("Baseband Version", str3.toUpperCase());
if (!e.f(localContext)) {
break label589;
}
String str10 = g.b(localContext);
if ((str10 == null) || (str10.isEmpty())) {
break label518;
}
localJSONObject1.put("IMEI", str10);
localTelephonyManager3 = (TelephonyManager)localContext.getSystemService("phone");
if (localTelephonyManager3 != null) {
break label569;
}
str12 = "NOT RETRIEVABLE";
localJSONObject1.put("IMSI", str12);
localTelephonyManager4 = (TelephonyManager)localContext.getSystemService("phone");
if (localTelephonyManager4 != null) {
break label579;
}
str13 = "NOT RETRIEVABLE";
localJSONObject1.put("ICCID", str13);
WindowManager localWindowManager = (WindowManager)localContext.getSystemService("window");
if (localWindowManager == null) {
break label697;
}
str6 = localWindowManager.getDefaultDisplay().getWidth() + " x " + localWindowManager.getDefaultDisplay().getHeight();
localJSONObject1.put("Screen Size", str6);
localJSONObject1.put("Language", Locale.getDefault().getDisplayName());
localJSONObject1.put("Time Zone", TimeZone.getDefault().getDisplayName());
localJSONObject1.put("OS Version", Build.VERSION.RELEASE);
localJSONObject1.put("Rooted", b());
localJSONObject1.put("Screen Timeout", b(localContext));
NfcManager localNfcManager = (NfcManager)localContext.getSystemService("nfc");
if (localNfcManager == null) {
break label673;
}
NfcAdapter localNfcAdapter = localNfcManager.getDefaultAdapter();
if (localNfcAdapter == null) {
break label748;
}
if (!localNfcAdapter.isEnabled()) {
break label740;
}
str7 = "ON";
localJSONObject1.put("NFC", str7);
LocationManager localLocationManager1 = (LocationManager)localContext.getSystemService("location");
if ((localLocationManager1 == null) || (!localLocationManager1.isProviderEnabled("gps"))) {
break label689;
}
str8 = "ON";
localJSONObject1.put("Standalone GPS", str8);
LocationManager localLocationManager2 = (LocationManager)localContext.getSystemService("location");
if ((localLocationManager2 == null) || (!localLocationManager2.isProviderEnabled("network"))) {
break label681;
}
str9 = "ON";
label465:
localJSONObject1.put("Network Location Provider", str9);
localJSONObject2 = localJSONObject1;
break label704;
str2 = str1.toUpperCase();
break;
label489:
str3 = Build.getRadioVersion();
continue;
label497:
if (Build.RADIO == null) {
str3 = "NOT RETRIEVABLE";
} else {
str3 = Build.RADIO;
}
}
label518:
TelephonyManager localTelephonyManager2 = (TelephonyManager)localContext.getSystemService("phone");
if (localTelephonyManager2 != null)
{
str11 = localTelephonyManager2.getDeviceId();
if ((str11 != null) && (!str11.isEmpty())) {}
for (;;)
{
localJSONObject1.put("IMEI", str11);
break;
label569:
str12 = localTelephonyManager3.getSubscriberId();
break label184;
label579:
str13 = localTelephonyManager4.getSimSerialNumber();
break label213;
label589:
String str4 = g.b(localContext);
if ((str4 != null) && (!str4.isEmpty()))
{
localJSONObject1.put("MEID", str4);
break label222;
}
TelephonyManager localTelephonyManager1 = (TelephonyManager)localContext.getSystemService("phone");
if (localTelephonyManager1 == null) {
break label733;
}
str5 = localTelephonyManager1.getDeviceId();
if ((str5 == null) || (str5.isEmpty())) {
break label726;
}
localJSONObject1.put("MEID", str5);
break label222;
label673:
str7 = "Feature Not Supported";
break label387;
label681:
str9 = "OFF";
break label465;
label689:
str8 = "OFF";
break label426;
label697:
str6 = "NOT RETRIEVABLE";
break label281;
label704:
return localJSONObject2;
str11 = "NOT RETRIEVABLE";
}
}
}
catch (Exception localException)
{
for (;;)
{
JSONObject localJSONObject2 = null;
continue;
String str11 = "NOT RETRIEVABLE";
continue;
label726:
String str5 = "NOT RETRIEVABLE";
continue;
label733:
str5 = "NOT RETRIEVABLE";
continue;
label740:
String str7 = "OFF";
continue;
label748:
str7 = "Feature Not Supported";
}
}
}
private static String b()
{
String str = "YES";
try
{
BufferedReader localBufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("su -c ls").getErrorStream()));
char[] arrayOfChar = new char[17];
if ((localBufferedReader.read(arrayOfChar) == arrayOfChar.length) && (new String(arrayOfChar, 0, arrayOfChar.length).trim().equalsIgnoreCase("permission denied"))) {
str = "NO";
}
return str;
}
catch (Exception localException)
{
for (;;)
{
str = "NO";
}
}
}
private static String b(Context paramContext)
{
int i = 0;
try
{
i = Settings.System.getInt(paramContext.getContentResolver(), "screen_off_timeout");
if (i > 0) {
i /= 1000;
}
if (i < 0)
{
str = "NEVER";
return str;
}
}
catch (Exception localException)
{
for (;;)
{
a.a("Exception: " + localException.getMessage());
continue;
String str = i + " SECONDS";
}
}
}
}
{
"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"
}
Conspiracy theory moment:
Maybe they're after the people who paid the chinese seller for unlock codes. Uh oh. ?
Or any root exploits in general....when the phones have bootloaders that should not have been able to be unlocked and technically should never have been able to be rooted. ?
Sent from my N5, N7, Moto X, G Tab 3 or S2.....
Easy way to fix that
kj2112 said:
Conspiracy theory moment:
Maybe they're after the people who paid the chinese seller for unlock codes. Uh oh. ?
Or any root exploits in general....when the phones have bootloaders that should not have been able to be unlocked and technically should never have been able to be rooted. ?
Sent from my N5, N7, Moto X, G Tab 3 or S2.....
Click to expand...
Click to collapse
Shhhhh don't mention the chinese seller Verizon might be listening lol. But yeah I'm uninstalling MyVerizon now because this is sketchy no matter their reasoning behind it!
iKrYpToNiTe said:
Shhhhh don't mention the chinese seller Verizon might be listening lol. But yeah I'm uninstalling MyVerizon now because this is sketchy no matter their reasoning behind it!
Click to expand...
Click to collapse
Don't blame you. Absolute worst case....and unlikely I'm sure.....but they could kill the imei if they wanted to.
I'm sure that's not likely....but better safe than sorry.
Glad Mine is a rogers version anyway. Lol
Sent from my N5, N7, Moto X, G Tab 3 or S2.....
So what if they know your rooted no big deal. Just because your rooted does not mean your unlocked.
I got the update and it never asked me for root. Another way to block it if it is asking you is use the Xposed root cloak module to hide root from it.
Isn't the Developer Edition unlocked so that you can do things like root and make changes?
ghstudio said:
Isn't the Developer Edition unlocked so that you can do things like root and make changes?
Click to expand...
Click to collapse
No, the Developer Edition is not unlocked by default. It still needs to be unlocked but Motorola will give you the code if you ask. And by ask I mean go through their website and request the code.
I've got a Developer Edition but if Verizon asks for SU permission I'll just uninstall the app.
kj2112 said:
Conspiracy theory moment:
Maybe they're after the people who paid the chinese seller for unlock codes. Uh oh. ?
Or any root exploits in general....when the phones have bootloaders that should not have been able to be unlocked and technically should never have been able to be rooted. ?
Sent from my N5, N7, Moto X, G Tab 3 or S2.....
Click to expand...
Click to collapse
Lets expand on this conspiracy theory and focus on root exploits in general....
Technically, rooting voids your warranty (which talks about altering the stock software in anyway not being allowed)
So think about it.. this tool could collect info that you are rooted, and tag/flag your account, then when you call/come in for warranty, the rep can deny it for being rooted without having to look at your phone, or any knowledge of how to check for root.
Of course, this brings up the issue of the flag being still on there even if you later buy a new phone and haven't rooted it.
The Tallest said:
No, the Developer Edition is not unlocked by default. It still needs to be unlocked but Motorola will give you the code if you ask. And by ask I mean go through their website and request the code.
I've got a Developer Edition but if Verizon asks for SU permission I'll just uninstall the app.
Click to expand...
Click to collapse
It asked me on my Developer Edition but I just denied it root access. I then added it to root cloak (xposed module) as an app to hide root from.
Since it works on non-rooted phones, it'll work on a rooted phone with root access denied just the same.
I was curious about this as well. If you deny the root request, would it be the same as the phone not being rooted, to them anyways? Like does that appear to the app to be the same as requesting the command and the phone wasn't rooted?
Mine updated but did not ask for root.
ssoares01 said:
Mine updated but did not ask for root.
Click to expand...
Click to collapse
Do you get a prompt for all apps? In the settings of SuperSU you can set it to auto approve, or not ask for approval when an app updates (if you approved it once, it will be approved for future versions as well).
fury683 said:
Do you get a prompt for all apps? In the settings of SuperSU you can set it to auto approve, or not ask for approval when an app updates (if you approved it once, it will be approved for future versions as well).
Click to expand...
Click to collapse
Yes, I have to approval all. Not setup for auto approval.
If you're rooted, Verizon likely already knows. And probably doesn't actually care that much. When I brought my Dev edition moto X in to get activated, one of the sales guys commented that's he into flashing custom roms and was thinking about rooting his verizon galaxy gear.
If Verizon kills my IMEI, I have no other phone to use. They can't make me buy another phone so they'd better waive my ETF and stop billing me for my debunked-contract phone. I'll take my MAXX for the measly $200 I paid so far and head to AT&T where I can get something else. But I did get SU request and I denied it right away.
Everyone is always worried there account is going to get terminated or phone shut off. The only thing I feel this could mean is they are going to deny warranty claims. So I don't care I China unlocked so I'm screwed either way.
bigv5150 said:
Everyone is always worried there account is going to get terminated or phone shut off. The only thing I feel this could mean is they are going to deny warranty claims. So I don't care I China unlocked so I'm screwed either way.
Click to expand...
Click to collapse
Exactly. Why worry about something we have no control over? I have rooted every android phone and tablet I've ever owned. No problems with Verizon at all. I am a third tier computer tech/analyst/manager, and when I get home from work, I hack equipment. I enjoy it. And I'll keep doing it. IF Verizon even cares, they may be just trying to understand how many phones are out there, eyeing it as a future money maker... It's always about the $$$.
ssoares01 said:
Yes, I have to approval all. Not setup for auto approval.
Click to expand...
Click to collapse
I just checked SU and had it set to automatically grant. I changed the setting to prompt now. I then went into the Play Store since I don't get the notifications that things need updating and sure enough, VZW Mobile is sitting there asking to be updated. I have a Developer Edition so I don't care that it's going to probably ask but I'm going to deny it and then either disable or uninstall it.
EDIT: Meh, I was going to Root Cloak it then update/disable but decided I don't ever use the app so I don't care. I just made a backup and uninstalled it. Screw it.

[Q] empty fields crast my app

Hello everyone,
I have start my first app, with this app, can you count your small change. And It works fine.
But, the fields must have a number, otherwise will my app cras.
Is there a solution to fix this? I mean if the user no number set on a row, that the app see this as a zero?
This looks my app:
{
"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"
}
this is the code what i use, it is maby not perfect but I am a beginner.
Code:
Button btn_optellen = (Button) findViewById(R.id.btn_optellen);
btn_optellen.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
double een = Double.valueOf(txt_001.getText().toString());
double twee = Double.valueOf(txt_002.getText().toString());
double total_een = een * 0.01 ;
double total_twee = twee * 0.02 ;
double totaal = total_een + total_twee;
tt_001.setText(String.format("= €%.2f", total_een ));
tt_002.setText(String.format("= €%.2f", total_twee ));
tt_totaal.setText(String.format("= €%.2f", totaal));
After you write the values to een and twee, you should do a check if they are null. And if that check is true, then set the value to 0.
So to be precise: do this check just before the line
double total_een = een * 0.01;
Click to expand...
Click to collapse
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Thanxs for your answer.
I hope I don't ask to muts. But I am ana beginner. Can your show how I must write it?
Ok so i just researched a bit and found out that if the string to parse is invalid, then there is an exception thrown immediately. I thought that just null would be returned, so we need a different approach. But here os how to do it:
Code:
Button btn_optellen = (Button) findViewById(R.id.btn_optellen);
btn_optellen.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
//we should initialize the two doubles to 0, so that we can just leave it like this in case of an error
double een = 0;
double twee = 0;
try {
een = Double.valueOf(txt_001.getText()); //btw, you dont need to call toString() after getText(). That method already returns a string so doing this would be redundant
} catch (Exception e) {} //nothing has to be done here, because the double has already been initialised to be 0
//same here
try {
twee = Double.valueOf(txt_002.getText());
} catch (Exception e) {}
//so now the two doubles are either set to 0 or to the value entered by the user, if it was a correct number
double total_een = een * 0.01 ;
double total_twee = twee * 0.02 ;
double totaal = total_een + total_twee;
tt_001.setText(String.format("= €%.2f", total_een ));
tt_002.setText(String.format("= €%.2f", total_twee ));
tt_totaal.setText(String.format("= €%.2f", totaal));
--------------------
Phone: Nexus 4
OS: rooted Lollipop LRX21T
Bootloader: unlocked
Recovery: TWRP 2.8.2.0
Very muth thanx, I am going try it out.

Categories

Resources