رفتن به مطلب
  • 0

چگونه به صورت مخفی یه شات از صفحه ای که توش هستیم بگیریم


hakan22

سوال

4 پاسخ به این سوال تاکنون داده شده است

ارسال‌های توصیه شده

بفرما 

Sub TakeScreenshotr
     Dim Obj1, Obj2 As Reflector
  Dim bmp As Bitmap
  Dim C As Canvas
  Obj1.Target = Obj1.GetActivityBA
  Obj1.Target = Obj1.GetField("vg")
  bmp.InitializeMutable(Activity.Width, Activity.Height)

  C.Initialize2(bmp)
  Dim args(1) As Object
  Dim types(1) As String
  Obj2.Target = C
  Obj2.Target = Obj2.GetField("canvas")
  args(0) = Obj2.Target
  types(0) = "android.graphics.Canvas"
  Obj1.RunMethod4("draw", args, types)
  Dim Out As OutputStream
  Out = File.OpenOutput(File.DirRootExternal, "yourscrname" & ".png", False)
  bmp.WriteToStream(Out, 100, "PNG")
  Out.Close
End Sub
لینک ارسال
به اشتراک گذاری در سایت های دیگر

 

بفرما 

Sub TakeScreenshotr
     Dim Obj1, Obj2 As Reflector
  Dim bmp As Bitmap
  Dim C As Canvas
  Obj1.Target = Obj1.GetActivityBA
  Obj1.Target = Obj1.GetField("vg")
  bmp.InitializeMutable(Activity.Width, Activity.Height)

  C.Initialize2(bmp)
  Dim args(1) As Object
  Dim types(1) As String
  Obj2.Target = C
  Obj2.Target = Obj2.GetField("canvas")
  args(0) = Obj2.Target
  types(0) = "android.graphics.Canvas"
  Obj1.RunMethod4("draw", args, types)
  Dim Out As OutputStream
  Out = File.OpenOutput(File.DirRootExternal, "yourscrname" & ".png", False)
  bmp.WriteToStream(Out, 100, "PNG")
  Out.Close
End Sub

ممنون دوست عزیز این رو به چه صورت تو سرویس بزارم که مثلا کاربر داره تو منو میچرخه مخفی عکس بگیره که کاربر نفهمه و استپی و اختلالی برا کاربر پیش نیاد

 

چون تکه کدی که گذاشتید رو سورسش رو دارم نتونستم

 

خدا خیرت بده

#Region Module Attributes
	#FullScreen: False
	#IncludeTitle: True
	#ApplicationLabel: Screenshot
	#VersionCode: 1
	#VersionName: 
	#SupportedOrientations: unspecified
	#CanInstallToExternalStorage: False
#End Region

'تهیه شده در آسمان اندروید
'Apksky.ir
'[email protected]

Sub Process_Globals
	'These global variables will be declared once when the application starts.
	'These variables can be accessed from all modules.

End Sub

Sub Globals
	'These global variables will be redeclared each time the activity is created.
	'These variables can only be accessed from this module.
	Dim Obj1, Obj2 As Reflector
    Dim bmp As Bitmap
    Dim c As Canvas
    Dim now, i As Long
    Dim dt As String
	Dim bt As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
	bt.Initialize("bt")
	Activity.AddView(bt, 200, 200, 200, 200)
	bt.Text = "Shoot"
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub

Sub bt_Click
	TakeScreenshot
	
End Sub


Sub TakeScreenshot
	DateTime.DateFormat = "yyMMddHHmmss"
   	now = DateTime.now
  	dt = DateTime.Date(now) ' e.g.: "110812150355" is Aug.12, 2011, 3:03:55 p.m.
  	Obj1.Target = Obj1.GetActivityBA
  	Obj1.Target = Obj1.GetField("vg")
  	bmp.InitializeMutable(Activity.Width, Activity.Height)
    c.Initialize2(bmp)
    Dim args(1) As Object
    Dim types(1) As String
    Obj2.Target = c
    Obj2.Target = Obj2.GetField("canvas")
    args(0) = Obj2.Target
    types(0) = "android.graphics.Canvas"
    Obj1.RunMethod4("draw", args, types)
    Dim Out As OutputStream
    Out = File.OpenOutput(File.DirRootExternal, dt & ".png", False)
    bmp.WriteToStream(Out, 100, "PNG")
    Out.Close
	ToastMessageShow("Screenshot saved at " & File.DirRootExternal & "\" & dt & ".png", False)
End Sub
 
   
#Region  Service Attributes 
	#StartAtBoot: False
#End Region

Sub Process_Globals
	#Region Standout Var
	Public StandOut As RSStandOut
	
	'Declaration of variabels
	Private mWindow As RSStandOutWindow
	Private mConstants As RSStandOutConstants
	Private mFlags As RSStandOutFlags
	#End Region
	
	Public MaxWidth,MaxHeight,MinWidth,MinHeight As Int
	Public AppName,Icon,HiddenTitle,RestoreTitle,NewTitle,RunningTitle As String
	Public ShowAnimationName,HideAnimationName,RestoreAnimationName As String
	Public LayoutName As String
End Sub

#Region Service
Sub Service_Create

End Sub

Sub Service_Start (StartingIntent As Intent)
	mWindow.Initialize("Window")
	StandOut.Show(mWindow.UniqueId)
End Sub

Sub Service_Destroy

End Sub
#End Region

#Region Window
Sub Window_Initialize (Id As Int, Window As RSStandOutWindow) As RSStandOutLayoutParams
	Dim params As RSStandOutLayoutParams
	params.Initialize4(Id, MaxWidth, MaxHeight, mConstants.AUTO_POSITION, mConstants.AUTO_POSITION, MinWidth, MinHeight)
	Return params
End Sub

'Final clean up that needs to be done.
'Called after all windows have been closed.
Sub Window_Destroy 
	StopService(Me)	
End Sub
#End Region

#Region Panel of window
'Create a panel and add it to the frame.
Sub Window_CreateAndAttachView (Id As Int, Frame As RSFrameLayout) As Panel
	Dim Content As Panel
	Content.Initialize("Content")
	Frame.AddView(Content, MaxWidth, MaxHeight)
	Content.Color = Colors.White
	Return Content
End Sub
#End Region

#Region Manual Setting
'Returns the name of the Window.
Sub Window_AppName As String
	Return AppName
End Sub

'Returns the icon of the window.
Sub Window_AppIcon As String
	If Icon = "" Then Return "icon"
	Return Icon
End Sub

Sub Window_PersistentNotificationTitle(Id As Int) As String
	Return RunningTitle
End Sub

Sub Window_PersistentNotificationMessage(Id As Int) As String
	Return NewTitle
End Sub

Sub Window_HiddenIcon As String
	If Icon = "" Then Return "icon"
	Return Icon
End Sub

Sub Window_HiddenNotificationTitle(Id As Int) As String
	Return HiddenTitle
End Sub

Sub Window_HiddenNotificationMessage(Id As Int) As String
	Return RestoreTitle
End Sub


#End Region

#Region For windows
'Return a list of flags
Sub Window_Flags (Id As Int) As List
	Dim flags As List
	flags.Initialize
	flags.Add(mFlags.FLAG_DECORATION_SYSTEM)
	flags.Add(mFlags.FLAG_BODY_MOVE_ENABLE)
	flags.Add(mFlags.FLAG_WINDOW_HIDE_ENABLE)
	flags.Add(mFlags.FLAG_WINDOW_BRING_TO_FRONT_ON_TAP)
	flags.Add(mFlags.FLAG_WINDOW_EDGE_LIMITS_ENABLE)
	flags.Add(mFlags.FLAG_WINDOW_PINCH_RESIZE_ENABLE)
	Return flags
End Sub

Sub Window_PersistentNotificationIntent(Id As Int) As Intent
	Return StandOut.getShowIntent(mWindow.UniqueId)
End Sub

Sub Window_HiddenNotificationIntent(Id As Int) As Intent
	Return StandOut.getShowIntent(Id)
End Sub

'Data = bundle (Use JavaObject)
Sub Window_ReceiveData (Id As Int, RequestCode As Int, Data As Object, FromId As Int)
	ToastMessageShow("Data received from id: " & FromId & " with RequestCode: " & RequestCode, False)
End Sub
#End Region

#Region Animation
Sub Window_ShowAnimation (Id As Int) As String
	If (mWindow.isExistingId(Id)) Then
		'restore
		If RestoreAnimationName = "" Then Return "slide_in_left"
		Return RestoreAnimationName 'slide_in_left
	Else 
		'show
		If ShowAnimationName = "" Then Return "fade_in"
		Return ShowAnimationName 'fade_in
	End If
	'Return ""
End Sub

Sub Window_HideAnimation (Id As Int) As String
	If HideAnimationName = "" Then Return "slide_out_right"
	
	Return HideAnimationName 'slide_out_right
End Sub

Sub Window_CloseAnimation (Id As Int) As String
	Return "fade_out"
End Sub
#End Region

#Region Menu
Sub Window_DropDownItems (Id As Int) As List
	Dim l As List
	l.Initialize
	Dim item(2) As RSStandOutDropDownItem
	item(0).Initialize("Item", "ic_menu_help", "About", "About") 
	item(1).Initialize("Item", "ic_menu_preferences", "Settings", "Settings") 
	l.Add(item(0))
	l.Add(item(1))
	Return l
End Sub
#End Region

#Region Events
'/**
'	 * Implement this method To be alerted To touch events In the body of the
'	 * window corresponding To the id.
'	 * 
'	 * <p>
'	 * Note that even If you set {@link #FLAG_DECORATION_SYSTEM}, you will not
'	 * receive touch events from the system window decorations.
'	 * 
'	 * @see {@link View.OnTouchListener#onTouch(View, MotionEvent)}
'	 * @param id
'	 *            The id of the View, provided As a courtesy.
'	 * @param window
'	 *            The window corresponding To the id, provided As a courtesy.
'	 * @param View
'	 *            The View where the event originated from.
'	 * @param event
'	 *            See linked method.
'//
Sub Window_TouchBody (Id As Int, Window As RSStandOutWindow, pView As View, MotionEvent As Object) As Boolean
	Return False
End Sub

'/**
'	 * Implement this method To be alerted To when the window corresponding To
'	 * the id Is moved.
'	 * 
'	 * @param id
'	 *            The id of the View, provided As a courtesy.
'	 * @param window
'	 *            The window corresponding To the id, provided As a courtesy.
'	 * @param View
'	 *            The View where the event originated from.
'	 * @param event
'	 *            See linked method.
'	 * @see {@link #onTouchHandleMove(int, Window, View, MotionEvent)}
'	 */
Sub Window_Move (Id As Int, Window As RSStandOutWindow, pView As View, MotionEvent As Object)
	
End Sub

'/**
'	 * Implement this method To be alerted To when the window corresponding To
'	 * the id Is resized.
'	 * 
'	 * @param id
'	 *            The id of the View, provided As a courtesy.
'	 * @param window
'	 *            The window corresponding To the id, provided As a courtesy.
'	 * @param View
'	 *            The View where the event originated from.
'	 * @param event
'	 *            See linked method.
'	 * @see {@link #onTouchHandleResize(int, Window, View, MotionEvent)}
'	 */
Sub Window_Resize (Id As Int, Window As RSStandOutWindow, pView As View, MotionEvent As Object)
	
End Sub

'/**
'	 * Implement this callback To be alerted when a window corresponding To the
'	 * id Is about To be shown. This callback will occur before the View Is
'	 * added To the window manager.
'	 * 
'	 * @param id
'	 *            The id of the View, provided As a courtesy.
'	 * @param View
'	 *            The View about To be shown.
'	 * @Return Return True To cancel the View from being shown, OR False To
'	 *         Continue.
'	 * @see #show(int)
'	 */
Sub Window_Show (Id As Int, Window As RSStandOutWindow) As Boolean
	Return False
End Sub

'/**
'	 * Implement this callback To be alerted when a window corresponding To the
'	 * id Is about To be hidden. This callback will occur before the View Is
'	 * removed from the window manager AND {@link #getHiddenNotification(int)}
'	 * Is called.
'	 * 
'	 * @param id
'	 *            The id of the View, provided As a courtesy.
'	 * @param View
'	 *            The View about To be hidden.
'	 * @Return Return True To cancel the View from being hidden, OR False To
'	 *         Continue.
'	 * @see #hide(int)
'	 */
Sub Window_Hide (Id As Int, Window As RSStandOutWindow) As Boolean
	Return False
End Sub

'/**
'	 * Implement this callback To be alerted when a window corresponding To the
'	 * id Is about To be closed. This callback will occur before the View Is
'	 * removed from the window manager.
'	 * 
'	 * @param id
'	 *            The id of the View, provided As a courtesy.
'	 * @param View
'	 *            The View about To be closed.
'	 * @Return Return True To cancel the View from being closed, OR False To
'	 *         Continue.
'	 * @see #close(int)
'	 */
Sub Window_Close (Id As Int, Window As RSStandOutWindow) As Boolean
	Return False
End Sub

'/**
'	 * Implement this callback To be alerted when all windows are about To be
'	 * closed. This callback will occur before any views are removed from the
'	 * window manager.
'	 * 
'	 * @Return Return True To cancel the views from being closed, OR False To
'	 *         Continue.
'	 * @see #closeAll()
'	 */
Sub Window_CloseAll As Boolean
	Return False
End Sub

'/**
'	 * Implement this callback To be alerted when a Window corresponding To the
'	 * Id Is about To be updated In the layout. This callback will occur before
'	 * the View Is updated by the Window manager.
'	 * 
'	 * @param Id
'	 *            The Id of the Window, provided As a courtesy.
'	 * @param View
'	 *            The Window about To be updated.
'	 * @param Params
'	 *            The updated layout Params.
'	 * @Return Return True To cancel the Window from being updated, OR False To
'	 *         Continue.
'	 * @see #updateViewLayout(int, Window, StandOutLayoutParams)
'	 */
Sub Window_Update (Id As Int, Window As RSStandOutWindow, Params As RSStandOutLayoutParams) As Boolean
	Return False
End Sub

'/**
'	 * Implement this callback To be alerted when a window corresponding To the
'	 * id Is about To be bought To the front. This callback will occur before
'	 * the window Is brought To the front by the window manager.
'	 * 
'	 * @param id
'	 *            The id of the window, provided As a courtesy.
'	 * @param View
'	 *            The window about To be brought To the front.
'	 * @Return Return True To cancel the window from being brought To the front,
'	 *         OR False To Continue.
'	 * @see #bringToFront(int)
'	 */
Sub Window_BringToFront (Id As Int, Window As RSStandOutWindow) As Boolean
	Return False
End Sub

'/**
'	 * Implement this callback To be alerted when a Window corresponding To the
'	 * Id Is about To have its Focus changed. This callback will occur before
'	 * the Window's focus is changed.
'	 * 
'	 * @param Id
'	 *            The Id of the Window, provided As a courtesy.
'	 * @param View
'	 *            The Window about To be brought To the front.
'	 * @param Focus
'	 *            Whether the Window Is gaining OR losing Focus.
'	 * @Return Return True To cancel the Window's focus from being changed, or
'	 *         False To Continue.
'	 * @see #focus(int)
'	 */
Sub Window_FocusChange (Id As Int, Window As RSStandOutWindow, Focus As Boolean) As Boolean
	Return False
End Sub

'/**
'	 * Implement this callback To be alerted when a window corresponding To the
'	 * id receives a key event. This callback will occur before the window
'	 * handles the event with {@link Window#dispatchKeyEvent(KeyEvent)}.
'	 * 
'	 * @param id
'	 *            The id of the window, provided As a courtesy.
'	 * @param View
'	 *            The window about To receive the key event.
'	 * @param event
'	 *            The key event.
'	 * @Return Return True To cancel the window from handling the key event, OR
'	 *         False To let the window handle the key event.
'	 * @see {@link Window#dispatchKeyEvent(KeyEvent)}
'	 */
Sub Window_KeyEvent (Id As Int, Window As RSStandOutWindow, KeyEvent As Object) As Boolean
	Return False
End Sub

Sub Window_ThemeStyle As String
	Return ""
End Sub
#End Region

Public Sub sasd

End Sub







لینک ارسال
به اشتراک گذاری در سایت های دیگر

دوست عزیز به این صورتی که شما فکر میکنید نیست 

دسترسی روت میخواد تا از طریق frambuffer بتونید صفحه فعلی رو به بیتمپ تبدیل کنید

البته یه کتابخونه گوگل زده فک کنم نیاز به این کارا نداره و لی خب جاواس

اسمش android screenshot library یا به اختصار ASL هست میتونید درموردش سرچ کنید

لینک ارسال
به اشتراک گذاری در سایت های دیگر

نه عزیز دسترسی روت نمیخواد برنامه های موجود در نت هست که گوشی بدون روت هم شات میگیره

 

اشتباه نکنید

لینک ارسال
به اشتراک گذاری در سایت های دیگر

بایگانی شده

این موضوع بایگانی و قفل شده و دیگر امکان ارسال پاسخ نیست.

  • کاربران آنلاین در این صفحه   0 کاربر

    • هیچ کاربر عضوی،در حال مشاهده این صفحه نیست.
×
×
  • اضافه کردن...