High FPS Recording on AOSP (40 fps so far) with hax & Mp4SlowMotionMaker - Galaxy S 4 Developer Discussion [Developers-Only]

I was browsing through the decompiled seccamera.jar and found this file called Mp4SlowMotionMaker.java, it includes the code to convert high fps videos to slowmo videos.
I have made an app for it. which I have included the eclipse project from.
{
"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"
}
With a max of 30fps (or actually more like 20fps) its no use, so I did some small tweaks here and there and the result is constant 40fps video on 1920x1080 :good: (buggy though)), I will try to get higher. but when having 40fps and the converting with timescale 1.3 or 1.5 its a nice "fast" slomo video.
What i have done is editing the camera app like this:
Code:
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index ed6e853..a2a377f 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -63,6 +63,7 @@
for time lapse recording -->
<string-array name="pref_video_time_lapse_frame_interval_entryvalues" trans
<item>0</item>
+ <item>25</item>
<item>500</item>
<item>1000</item>
<item>1500</item>
@@ -108,6 +109,7 @@
different units (i.e. seconds, minutes, hours) for time lapse recording -->
<string-array name="pref_video_time_lapse_frame_interval_entries">
<item>@string/pref_video_time_lapse_frame_interval_off</item>
+ <item>@string/pref_video_time_lapse_frame_interval_25</item>
<item>@string/pref_video_time_lapse_frame_interval_500</item>
<item>@string/pref_video_time_lapse_frame_interval_1000</item>
<item>@string/pref_video_time_lapse_frame_interval_1500</item>
@@ -152,6 +154,7 @@
<!-- These values correspond to the time interval between frame capture
for time lapse recording -->
<string-array name="pref_video_time_lapse_frame_interval_duration_values" t
+ <item>0.025</item>
<item>0.5</item>
<item>1</item>
<item>1.5</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index dc23bc1..e55cdb2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -252,6 +252,7 @@
time lapse recording. Appears at top of the dialog. [CHAR LIMIT=30] -->
<string name="pref_video_time_lapse_frame_interval_title">Time lapse</strin
<string name="pref_video_time_lapse_frame_interval_default" translatable="f
+ <string name="pref_video_time_lapse_frame_interval_25">25ms</string>
<!-- Settings screen, Camera setting category title -->
<string name="pref_camera_settings_category">Camera settings</string>
This will make time lapse mode record in 40fps (1000ms / 25ms = 40fps)
And another patch in libstagefright, this was needed because libstagefright forced an error when exceeding range of 15,30
Code:
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/Camera
index 295c0f5..a899855 100644
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -356,8 +356,7 @@ status_t CameraSource::configureCamera(
if (frameRate != -1) {
CHECK(frameRate > 0 && frameRate <= 120);
- const char* supportedFrameRates =
- params->get(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES
+ const char* supportedFrameRates = "15,40";
CHECK(supportedFrameRates != NULL);
ALOGV("Supported frame rates: %s", supportedFrameRates);
char buf[4];
@@ -365,7 +364,7 @@ status_t CameraSource::configureCamera(
if (strstr(supportedFrameRates, buf) == NULL) {
ALOGE("Requested frame rate (%d) is not supported: %s",
frameRate, supportedFrameRates);
- return BAD_VALUE;
+// return BAD_VALUE;
}
// The frame rate is supported, set the camera to the requested value.
and this patch to media_profiles.xml
Code:
diff --git a/media/media_profiles.xml b/media/media_profiles.xml
index 499e1fd..62098ec 100644
--- a/media/media_profiles.xml
+++ b/media/media_profiles.xml
@@ -191,12 +191,12 @@
channels="1" />
</EncoderProfile>
- <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
+ <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="40">
<Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
+ bitRate="15000000"
+ width="1280"
+ height="720"
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mod
@@ -261,10 +261,10 @@
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
<Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mod
@@ -281,7 +281,7 @@
bitRate="17000000"
width="1920"
height="1080"
- frameRate="30" />
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mod
@@ -468,10 +468,10 @@
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
<Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mo
@@ -483,12 +483,12 @@
channels="1" />
</EncoderProfile>
- <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
+ <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="40">
<Video codec="h264"
bitRate="17000000"
width="1920"
height="1080"
- frameRate="30" />
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mo
@@ -519,7 +519,7 @@
minBitRate="64000" maxBitRate="20000000"
minFrameWidth="176" maxFrameWidth="1920"
minFrameHeight="144" maxFrameHeight="1080"
- minFrameRate="1" maxFrameRate="30" />
+ minFrameRate="1" maxFrameRate="40" />
<VideoEncoderCap name="h263" enabled="true"
minBitRate="64000" maxBitRate="1000000"
mare sure not to use h264 but mp4 because else base levels gets too high and it will crash before recording, with mp4 codec it will crash after recording which doesnt seem to affect the output

awesome
broodplank1337 said:
I was browsing through the decompiled seccamera.jar and found this file called Mp4SlowMotionMaker.java, it includes the code to convert high fps videos to slowmo videos.
I have made an app for it. which I have included the eclipse project from.
With a max of 30fps (or actually more like 20fps) its no use, so I did some small tweaks here and there and the result is constant 40fps video on 1920x1080 :good: (buggy though)), I will try to get higher. but when having 40fps and the converting with timescale 1.3 or 1.5 its a nice "fast" slomo video.
What i have done is editing the camera app like this:
Code:
diff --git a/res/values/arrays.xml b/res/values/arrays.xml
index ed6e853..a2a377f 100644
--- a/res/values/arrays.xml
+++ b/res/values/arrays.xml
@@ -63,6 +63,7 @@
for time lapse recording -->
<string-array name="pref_video_time_lapse_frame_interval_entryvalues" trans
<item>0</item>
+ <item>25</item>
<item>500</item>
<item>1000</item>
<item>1500</item>
@@ -108,6 +109,7 @@
different units (i.e. seconds, minutes, hours) for time lapse recording -->
<string-array name="pref_video_time_lapse_frame_interval_entries">
<item>@string/pref_video_time_lapse_frame_interval_off</item>
+ <item>@string/pref_video_time_lapse_frame_interval_25</item>
<item>@string/pref_video_time_lapse_frame_interval_500</item>
<item>@string/pref_video_time_lapse_frame_interval_1000</item>
<item>@string/pref_video_time_lapse_frame_interval_1500</item>
@@ -152,6 +154,7 @@
<!-- These values correspond to the time interval between frame capture
for time lapse recording -->
<string-array name="pref_video_time_lapse_frame_interval_duration_values" t
+ <item>0.025</item>
<item>0.5</item>
<item>1</item>
<item>1.5</item>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index dc23bc1..e55cdb2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -252,6 +252,7 @@
time lapse recording. Appears at top of the dialog. [CHAR LIMIT=30] -->
<string name="pref_video_time_lapse_frame_interval_title">Time lapse</strin
<string name="pref_video_time_lapse_frame_interval_default" translatable="f
+ <string name="pref_video_time_lapse_frame_interval_25">25ms</string>
<!-- Settings screen, Camera setting category title -->
<string name="pref_camera_settings_category">Camera settings</string>
This will make time lapse mode record in 40fps (1000ms / 25ms = 40fps)
And another patch in libstagefright, this was needed because libstagefright forced an error when exceeding range of 15,30
Code:
diff --git a/media/libstagefright/CameraSource.cpp b/media/libstagefright/Camera
index 295c0f5..a899855 100644
--- a/media/libstagefright/CameraSource.cpp
+++ b/media/libstagefright/CameraSource.cpp
@@ -356,8 +356,7 @@ status_t CameraSource::configureCamera(
if (frameRate != -1) {
CHECK(frameRate > 0 && frameRate <= 120);
- const char* supportedFrameRates =
- params->get(CameraParameters::KEY_SUPPORTED_PREVIEW_FRAME_RATES
+ const char* supportedFrameRates = "15,40";
CHECK(supportedFrameRates != NULL);
ALOGV("Supported frame rates: %s", supportedFrameRates);
char buf[4];
@@ -365,7 +364,7 @@ status_t CameraSource::configureCamera(
if (strstr(supportedFrameRates, buf) == NULL) {
ALOGE("Requested frame rate (%d) is not supported: %s",
frameRate, supportedFrameRates);
- return BAD_VALUE;
+// return BAD_VALUE;
}
// The frame rate is supported, set the camera to the requested value.
and this patch to media_profiles.xml
Code:
diff --git a/media/media_profiles.xml b/media/media_profiles.xml
index 499e1fd..62098ec 100644
--- a/media/media_profiles.xml
+++ b/media/media_profiles.xml
@@ -191,12 +191,12 @@
channels="1" />
</EncoderProfile>
- <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="30">
+ <EncoderProfile quality="timelapsehigh" fileFormat="mp4" duration="40">
<Video codec="h264"
- bitRate="17000000"
- width="1920"
- height="1080"
- frameRate="30" />
+ bitRate="15000000"
+ width="1280"
+ height="720"
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mod
@@ -261,10 +261,10 @@
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
<Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mod
@@ -281,7 +281,7 @@
bitRate="17000000"
width="1920"
height="1080"
- frameRate="30" />
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mod
@@ -468,10 +468,10 @@
<EncoderProfile quality="timelapse720p" fileFormat="mp4" duration="30">
<Video codec="h264"
- bitRate="12000000"
- width="1280"
- height="720"
- frameRate="30" />
+ bitRate="17000000"
+ width="1920"
+ height="1080"
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mo
@@ -483,12 +483,12 @@
channels="1" />
</EncoderProfile>
- <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="30">
+ <EncoderProfile quality="timelapse1080p" fileFormat="mp4" duration="40">
<Video codec="h264"
bitRate="17000000"
width="1920"
height="1080"
- frameRate="30" />
+ frameRate="40" />
<!--
The Audio part of the profile will not be used since time lapse mo
@@ -519,7 +519,7 @@
minBitRate="64000" maxBitRate="20000000"
minFrameWidth="176" maxFrameWidth="1920"
minFrameHeight="144" maxFrameHeight="1080"
- minFrameRate="1" maxFrameRate="30" />
+ minFrameRate="1" maxFrameRate="40" />
<VideoEncoderCap name="h263" enabled="true"
minBitRate="64000" maxBitRate="1000000"
mare sure not to use h264 but mp4 because else base levels gets too high and it will crash before recording, with mp4 codec it will crash after recording which doesnt seem to affect the output
Click to expand...
Click to collapse
Sound good
Is this work with cm?
May u upload modified camera.apk and lib?

This can be interesting I read that our hardware could take 60fps video recording

Related

[Q] "UNINSTALL_SHORTCUT" does not work any more for android 4.0 (API 14 and above)

[Q] "UNINSTALL_SHORTCUT" does not work any more for android 4.0 (API 14 and above)
Hi,
The following code "UNINSTALL_SHORTCUT" works for
Android 2.3.3 (API 10) to Android 3.3 (API 13), but does not work any
more with Android 4.0 (API 14) or above.
The Toast message says it is removed, but actually it still exist and
the new one just place on top of the existing one. This creates
multiple shortcuts on top of each other.
Does anyone see the same issue I am seeing or there's other fix for
this with Android 4.0?
Thanks in advance for your help.
=================================
private void deleteShortCut(Context context) {
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
shortcutIntent.setClassName("com.example.androidapp",
"SampleIntent");
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
shortcutIntent.putExtra("someParameter", "HelloWorld");
Intent removeIntent = new Intent();
removeIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT,
shortcutIntent);
removeIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Shortcut
Name");
removeIntent.putExtra("duplicate", false);
removeIntent.setAction("com.android.launcher.action.UNINSTALL_SHORTCUT");
context.sendBroadcast(removeIntent);
}
private void addShortCut(Context context) {
Intent shortcutIntent = new Intent(Intent.ACTION_MAIN);
shortcutIntent.setClassName("com.example.androidapp",
"SampleIntent");
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
shortcutIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
shortcutIntent.putExtra("someParameter", "HelloWorld");
Intent addIntent = new Intent();
addIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, shortcutIntent);
addIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, "Shortcut Name");
addIntent.putExtra(Intent.EXTRA_SHORTCUT_ICON_RESOURCE,
Intent.ShortcutIconResource.fromContext(context, R.drawable.icon));
addIntent.setAction("com.android.launcher.action.INSTALL_SHORTCUT");
context.sendBroadcast(addIntent);
}
=======================================
AndroidManifest.xml...
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="com.example.addDeleteShortcut"
android:versionCode="8" android:versionName="1.0.0.1">
<uses-permission
android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />
<uses-permission
android:name="com.android.launcher.permission.UNINSTALL_SHORTCUT" />
<supports-screens
android:largeScreens="true"
android:anyDensity="true"
android:smallScreens="true"
android:resizeable="true"
android:normalScreens="true"
/>
<application
android:icon="@drawable/icon"
android:label="@string/app_name"
<activity
android:name=".UIShortcuts"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".shortcutActivity"
android:taskAffinity="com.example.Change"
android:theme="@style/NoBackground"
android:excludeFromRecents="true" >
<intent-filter>
<action android:name="com.example.TOGGLE_SHORTCUT" /
>
<category
android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
</application>
</manifest>
Hi there,
Did you mange to solve this issue with API 14 or above?
Nixu

Diagnostic Tool Investigation

Hello Folks,
some time ago I did some examination on the diagnostics tool included with every firmware. I did not make any siginficant progress because most of the things I tried reqiuired certificates and signed libraries. However I want to share my thoughts so maybe someone else is able to do smoething with this tool..
The main "vulnerability" in the diagnostics tool is that it tries to load every DLL that is defined as AssemblyPart. Here is the MainPage Constructor
Code:
public MainPage()
{
base.\u002Ector();
this.InitializeComponent();
this.oddtMenuItems = new List<OddtMenuItem>();
AssemblyPartCollection parts = Deployment.Current.Parts;
RadioTechnology radio = this.GetRadio();
bool flag = this.isLTEnabled();
foreach (AssemblyPart assemblyPart in (PresentationFrameworkCollection<AssemblyPart>) parts)
{
try
{
Assembly assembly = Assembly.Load(assemblyPart.Source.Replace(".dll", string.Empty));
OddtMenuItem oddtMenuItem = (OddtMenuItem) Enumerable.FirstOrDefault<object>((IEnumerable<object>) assembly.GetCustomAttributes(typeof (OddtMenuItem), true));
if (oddtMenuItem != null)
{
if (!assembly.Equals((object) Assembly.GetExecutingAssembly()))
{
if (oddtMenuItem.RadioType != RadioTechnology.NA && (oddtMenuItem.RadioType & radio) == RadioTechnology.NA)
oddtMenuItem.setEnabled(false);
if (oddtMenuItem.Title == "Wireless LAN" || oddtMenuItem.Title == "APN Settings")
{
oddtMenuItem.setEnabled(false);
this.oddtMenuItems.Remove(oddtMenuItem);
}
if (oddtMenuItem.Title == "Life Timer" && !flag)
{
oddtMenuItem.setEnabled(false);
this.oddtMenuItems.Remove(oddtMenuItem);
}
this.oddtMenuItems.Add(oddtMenuItem);
}
}
}
catch (Exception ex)
{
}
}
this.PrioritizeMenuItems();
this.MainListBox.DataContext = (object) this.oddtMenuItems;
if ((bool) Application.Current.Resources[(object) "OddtDisclaimerAccepted"])
{
this.ContentGrid.Visibility = Visibility.Visible;
this.DisclaimerGrid.Visibility = Visibility.Collapsed;
this.get_ApplicationBar().set_IsVisible(true);
}
else
{
this.ContentGrid.Visibility = Visibility.Collapsed;
this.DisclaimerGrid.Visibility = Visibility.Visible;
this.get_ApplicationBar().set_IsVisible(false);
}
}
The AssemblyParts are defined in the WMAppManifest.xaml:
Code:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="OddtApplication" EntryPointType="OddtApplication.App" RuntimeVersion="4.7.50308.0">
<Deployment.Parts>
<AssemblyPart x:Name="OddtApplication" Source="OddtApplication.dll" />
<AssemblyPart x:Name="About" Source="About.dll" />
<AssemblyPart x:Name="Accelerometer" Source="Accelerometer.dll" />
<AssemblyPart x:Name="Als" Source="Als.dll" />
<AssemblyPart x:Name="APN" Source="APN.dll" />
<AssemblyPart x:Name="AudioLoopback" Source="AudioLoopback.dll" />
<AssemblyPart x:Name="Battery" Source="Battery.dll" />
<AssemblyPart x:Name="Bluetooth" Source="Bluetooth.dll" />
<AssemblyPart x:Name="Camera" Source="Camera.dll" />
<AssemblyPart x:Name="CareBattery" Source="CareBattery.dll" />
<AssemblyPart x:Name="CareTestSequence" Source="CareTestSequence.dll" />
<AssemblyPart x:Name="Dtmf" Source="Dtmf.dll" />
<AssemblyPart x:Name="ExampleLibrary" Source="ExampleLibrary.dll" />
<AssemblyPart x:Name="Gyroscope" Source="Gyroscope.dll" />
<AssemblyPart x:Name="HardwareButtons" Source="HardwareButtons.dll" />
<AssemblyPart x:Name="Headset" Source="Headset.dll" />
<AssemblyPart x:Name="LcdWhite" Source="LcdWhite.dll" />
<AssemblyPart x:Name="LedKeypad" Source="LedKeypad.dll" />
<AssemblyPart x:Name="LifeTimer" Source="LifeTimer.dll" />
<AssemblyPart x:Name="LTEBandLock" Source="LTEBandLock.dll" />
<AssemblyPart x:Name="LTETx" Source="LTETx.dll" />
<AssemblyPart x:Name="Magnetometer" Source="Magnetometer.dll" />
<AssemblyPart x:Name="Memory" Source="Memory.dll" />
<AssemblyPart x:Name="Microsoft.Phone.Controls" Source="Microsoft.Phone.Controls.dll" />
<AssemblyPart x:Name="Microsoft.Phone.Controls.Toolkit" Source="Microsoft.Phone.Controls.Toolkit.dll" />
<AssemblyPart x:Name="MMS" Source="MMS.dll" />
<AssemblyPart x:Name="NonLinearNavigationService" Source="NonLinearNavigationService.dll" />
<AssemblyPart x:Name="OddtAttributes" Source="OddtAttributes.dll" />
<AssemblyPart x:Name="PowerSource" Source="PowerSource.dll" />
<AssemblyPart x:Name="Proximity" Source="Proximity.dll" />
<AssemblyPart x:Name="RadioAccess" Source="RadioAccess.dll" />
<AssemblyPart x:Name="Settings" Source="Settings.dll" />
<AssemblyPart x:Name="Speaker" Source="Speaker.dll" />
<AssemblyPart x:Name="Touch" Source="Touch.dll" />
<AssemblyPart x:Name="Vibra" Source="Vibra.dll" />
<AssemblyPart x:Name="WirelessLAN" Source="WirelessLAN.dll" />
<AssemblyPart x:Name="Microsoft.Phone.Media.Extended" Source="Microsoft.Phone.Media.Extended.dll" />
</Deployment.Parts>
</Deployment>
For an MenuItem to appear in the diagnostics app it has to be flagged with the OddtMenuItem-Attribute (or however you call this).
Code:
[AttributeUsage(AttributeTargets.Assembly)]
public class OddtMenuItem : Attribute
{
private OddtMenuItemStatus status;
private string title;
private string description;
private Uri entryPage;
private int priority;
private RadioTechnology radiotype;
public Brush ForegroundColor
{
get
{
if (this.status == OddtMenuItemStatus.Alpha)
return (Brush) new SolidColorBrush(Colors.Gray);
if ((Color) ((FrameworkElement) new PhoneApplicationPage()).Resources[(object) "PhoneBackgroundColor"] == Color.FromArgb(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue))
return (Brush) new SolidColorBrush(Colors.Black);
else
return (Brush) new SolidColorBrush(Colors.White);
}
}
public bool IsEnabled
{
get
{
return this.status > OddtMenuItemStatus.Alpha;
}
}
public RadioTechnology RadioType
{
get
{
return this.radiotype;
}
}
public Visibility Visibility
{
get
{
return this.status == (OddtMenuItemStatus.Alpha | OddtMenuItemStatus.Beta) ? Visibility.Visible : Visibility.Collapsed;
}
}
public string Title
{
get
{
return this.title;
}
}
public string Description
{
get
{
return this.description;
}
}
public Uri EntryPage
{
get
{
return this.entryPage;
}
}
public int Priority
{
get
{
return this.priority;
}
set
{
this.priority = value;
}
}
public OddtMenuItem(OddtMenuItemStatus status, string title, string description, string location, RadioTechnology radiotype = RadioTechnology.NA)
{
this.status = status;
this.title = status != OddtMenuItemStatus.Beta ? title : string.Format("{{{0}}}", (object) title);
this.description = description;
this.entryPage = new Uri(location, UriKind.Relative);
this.priority = 99999;
this.radiotype = radiotype;
}
public void setEnabled(bool enable)
{
if (enable)
return;
this.status = OddtMenuItemStatus.Alpha;
}
}
I think that we can execute code with high Level privileges as soon as we are able to manipulate the WMAppManifest.xaml and copy a DLL into the App folder. The main Problem is that every Manipulation of the Folder or one of ist files invalidates the signature.
Regards
Chris

Nexus Camera Mod work for us?

Making my daily run thru the Android rags I ran across this:
Simple Nexus 4 software mod allows for improved video recording with almost double the bitrate
I wonder if this will work for us?
Using a file browser (like root explorer/es file explorer etc) go to the /system/etc folder
Make sure your system is mounted RW
Search for the media_profiles.xml file and open it up in any text editor
Once you scroll down you will see the following:
Code:
Code:
<EncoderProfile quality="1080p" fileFormat="mp4" duration="30">
<Video codec="h264"
bitRate="12000000"
width="1920"
height="1080"
frameRate="30" />
<Audio codec="aac"
bitRate="96000"
sampleRate="48000"
channels="1" />
</EncoderProfile>
Change the bitRate from 12000000 to 20000000
Save and reboot.

[Q] Help with Android app development

Hello there
i'm trying to make an app that change the ringer profile when receiving a specific sms
i've reached here and i tested the app on the emulator and it's working only with the buttons
here's my codes
MainActivity.java
Code:
import android.media.AudioManager;
import android.os.Bundle;
import android.app.Activity;
import android.content.Context;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;
public class MainActivity extends Activity {
private Button Vibrate , Ring , Silent , Mode;
private TextView Status;
private static AudioManager myAudioManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Vibrate = (Button)findViewById(R.id.button2);
Ring = (Button)findViewById(R.id.button4);
Silent = (Button)findViewById(R.id.button3);
Mode = (Button)findViewById(R.id.button1);
Status = (TextView)findViewById(R.id.textView2);
myAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
}
public static void vibrate(View view){
myAudioManager.setRingerMode(AudioManager.RINGER_MODE_VIBRATE);
}
public static void ring(View view){
myAudioManager.setRingerMode(AudioManager.RINGER_MODE_NORMAL);
}
public static void silent(View view){
myAudioManager.setRingerMode(AudioManager.RINGER_MODE_SILENT);
}
public void mode(View view){
int mod = myAudioManager.getRingerMode();
if(mod == AudioManager.RINGER_MODE_NORMAL){
Status.setText("Current Status: Ring");
}
else if(mod == AudioManager.RINGER_MODE_SILENT){
Status.setText("Current Status: Silent");
}
else if(mod == AudioManager.RINGER_MODE_VIBRATE){
Status.setText("Current Status: Vibrate");
}
else{
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
RecieveSMS.java
Code:
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.telephony.SmsMessage;
import android.view.View;
public class RecieveSMS extends BroadcastReceiver
{
private static final String ACTION_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
private Context mContext;
private Intent mIntent;
@Override
public void onReceive(Context context, Intent intent) {
mContext = context;
mIntent = intent;
String action = intent.getAction();
if(action.equals(ACTION_SMS_RECEIVED)){
String str = "";
View v = null;
/* Get all messages contained in the Intent*/
SmsMessage[] msgs = getMessagesFromIntent(mIntent);
if (msgs != null) {
for (int i = 0; i < msgs.length; i++) {
str += msgs[i].getMessageBody().toString();
}
if(str=="ring")
MainActivity.ring(v);
else if (str=="vibrate")
MainActivity.vibrate(v);
else if(str=="silent")
MainActivity.silent(v);
}
// ---send a broadcast intent to update the SMS received in the
// activity---
Intent broadcastIntent = new Intent();
broadcastIntent.setAction("SMS_RECEIVED_ACTION");
context.sendBroadcast(broadcastIntent);
}
}
public static SmsMessage[] getMessagesFromIntent(Intent intent) {
Object[] messages = (Object[]) intent.getSerializableExtra("pdus");
byte[][] pduObjs = new byte[messages.length][];
for (int i = 0; i < messages.length; i++) {
pduObjs[i] = (byte[]) messages[i];
}
byte[][] pdus = new byte[pduObjs.length][];
int pduCount = pdus.length;
SmsMessage[] msgs = new SmsMessage[pduCount];
for (int i = 0; i < pduCount; i++) {
pdus[i] = pduObjs[i];
msgs[i] = SmsMessage.createFromPdu(pdus[i]);
}
return msgs;
}
activity_main.xml
Code:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp"
android:text="@string/audio"
android:textAppearance="?android:attr/textAppearanceLarge" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="144dp"
android:layout_marginLeft="40dp"
android:layout_toLeftOf="@+id/button2"
android:onClick="silent"
android:text="@string/Silent" />
<Button
android:id="@+id/button4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/button1"
android:layout_alignBottom="@+id/button1"
android:layout_toRightOf="@+id/button1"
android:onClick="ring"
android:text="@string/Ring" />
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/button2"
android:layout_alignLeft="@+id/button3"
android:layout_marginBottom="15dp"
android:onClick="mode"
android:text="@string/Mode" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/textView1"
android:layout_centerHorizontal="true"
android:layout_marginTop="46dp"
android:text="@string/Status"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBaseline="@+id/button3"
android:layout_alignBottom="@+id/button3"
android:layout_alignRight="@+id/textView1"
android:onClick="vibrate"
android:text="@string/Vibrate" />
</RelativeLayout>
strings.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Test</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="audio">Set Audio Profiles</string>
<string name="Ring">Ring</string>
<string name="Vibrate">Vibrate</string>
<string name="Silent">Silent</string>
<string name="Mode">Current Mode</string>
<string name="Status">Current Status</string>
</resources>
manifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.test"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="22" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="com.example.test.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".RecieveSMS">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED"></action>
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.RECEIVE_SMS"></uses-permission>
</manifest>
can anyone help me please ??

[SOLVED][Debug Help] Empty/White Activity (invisible UI controls)

Hello! I generated a very simple 2 activities app using Google's Android Studio, and the target is an Android 8.1 phone. The problem is that the main activity doesn't show the edit box and buttons (that are obviously visible in the Design page). If I start my login activity (in the onCreate() function of the main activity), the login activity UI is visible and the main activity UI is still not visible. If I single step debug the app, the main activity UI seems present (as no error is encountered). They are just invisible. I compared the XML of both activities, and couldn't find a different setting that would fix this problem.
PS: I could't find a solution in Google search either.
PS: I added a space to break the URL links below.
AndroidManifest.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http: //schemas.android.com/apk/res/android"
package="com.example.test2">
<application
android:allowBackup="true"
android:allowTaskReparenting="false"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="false"
android:theme="@style/AppTheme">
<activity
android:alwaysRetainTaskState="false"
android:label="@string/app_name"
android:launchMode="singleInstance"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:alwaysRetainTaskState="false"
android:label="@string/app_name"
android:name=".LoginActivity"
android:parentActivityName=".MainActivity">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.test2.MainActivity" />
</activity>
</application>
</manifest>
activity_main.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http: //schemas.android.com/apk/res/android"
xmlns:app="http: //schemas.android.com/apk/res-auto"
xmlns:tools="http: //schemas.android.com/tools"
android:id="@+id/containerMain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingStart="16dp"
android:paddingTop="16dp"
android:paddingEnd="16dp"
android:paddingBottom="16dp"
android:visibility="visible"
tools:context=".MainActivity">
<android.support.design.widget.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="0dp"
android:layout_height="46dp"
android:layout_marginStart="16dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent">
<android.support.design.widget.TextInputEditText
android:id="@+id/textName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/TextNameHint"
android:visibility="visible" />
</android.support.design.widget.TextInputLayout>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginTop="24dp"
android:layout_marginEnd="8dp"
android:clickable="true"
android:enabled="true"
android:focusable="true"
android:longClickable="false"
android:onClick="buttonClick"
android:text="@string/Button"
android:visibility="visible"
app:layout_constraintEnd_toEndOf="parent" />
</android.support.constraint.ConstraintLayout>
MainActivity.java
Code:
package com.example.test2;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;
import android.widget.ToggleButton;
public class MainActivity extends AppCompatActivity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
Thanks in advance!
[SOLVED] [Debug Help] Empty/White Activity (invisible UI controls)
Even though the design view seemed fine to me, including constraints and all, something was off to make the UI controls invisible. To try to isolate the problen, I decided to delete the controls one by one, and then I started to see something.
So, I made a different UI design. :cyclops:

Categories

Resources